Packet Tracer is Cisco's network simulator: you drag routers, switches and PCs onto a canvas, cable them together and type real IOS commands into each device. Your first useful lab takes about 15 minutes: two routers, one cable, an IP address on each side, and a successful ping between them.
This article covers the first steps only. It assumes you already have Packet Tracer installed, and shows the exact IOS commands and how to read the results.
Where to get Packet Tracer
Cisco Networking Academy publishes Packet Tracer on its own site, in a page titled "Free Training and Download" (see the first source below). Sign in or create a NetAcad account there and follow the download instructions for your operating system. Avoid third-party download sites: you cannot tell whether a copy is current or unmodified.
Version numbers and supported operating systems change between releases, and I could not read them from Cisco's page, so check the page itself before you install.
Build the lab: two routers and one cable
In Packet Tracer, do this in the device pane at the bottom left of the window:
- Open the routers category and drag two routers onto the canvas.
- Open the connections category and choose a copper cable. A cross-over cable is the textbook choice for connecting two like devices directly. Packet Tracer also has an automatic cable choice if you are unsure.
- Click the first router, pick an Ethernet port, then click the second router and pick an Ethernet port. Use the same port type on both ends, for example GigabitEthernet0/0 on each.
- Wait for the link markers on the cable to turn green. Red or amber markers mean the link is not up yet.
Port names depend on the router model you picked. Whatever name Packet Tracer shows next to the cable end is the name you will type in the commands below. In this article the example uses GigabitEthernet0/0.
Configure the first router
Click the router and open its CLI tab. If the setup dialog asks whether to continue, answer no. At the Router> prompt, enter privileged mode, then global configuration mode, then select the interface. This is the sequence Cisco's IPv4 addressing guide uses:
Router> enable
Router# configure terminal
Router(config)# hostname R1
R1(config)# interface GigabitEthernet0/0
R1(config-if)# no shutdown
R1(config-if)# ip address 192.168.1.1 255.255.255.0
R1(config-if)# end
What each line does:
enablemoves from user mode (>) to privileged mode (#).configure terminalenters global configuration mode.hostname R1renames the device so you can tell the two routers apart in the prompt.interface GigabitEthernet0/0selects the port you cabled.no shutdownturns the interface on. Router interfaces are administratively down by default in IOS, and a shut-down interface is a classic reason a ping fails.ip address 192.168.1.1 255.255.255.0sets the address and subnet mask. Cisco's own example orders the lines asno shutdownthenip address, but putting the address first and enabling the interface afterwards also appears in Cisco's guides. The result is the same.endreturns to privileged mode.
Configure the second router
Repeat the steps on the other router with a different host name and the next address in the same network:
Router> enable
Router# configure terminal
Router(config)# hostname R2
R2(config)# interface GigabitEthernet0/0
R2(config-if)# no shutdown
R2(config-if)# ip address 192.168.1.2 255.255.255.0
R2(config-if)# end
Both addresses must share the same network. With the mask 255.255.255.0, that means the first three numbers match (192.168.1) and the last number differs. The two routers must not share an identical address, or one of them will not work correctly.
Check the configuration with show commands
Cisco's guide lists two verification commands. Run them on either router from privileged mode:
R1# show ip interface
R1# show ip route connected
show ip interface displays the IP settings of each interface, including the address you just set. show ip route connected lists the networks the router is directly attached to. If the interface is up and addressed, 192.168.1.0/24 should appear in that list. If the network is missing, the interface is probably still shut down or has no address.
Test the link with ping
From R1, ping the address on R2:
R1# ping 192.168.1.2
Example output of a working link (your times will differ):
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/6/8 ms
Cisco documents the characters in the middle line like this:
| Character | Meaning (Cisco's description) |
|---|---|
! | Each exclamation point indicates receipt of a reply. |
. | Each period indicates the network server timed out as it waits for a reply. |
U | A destination unreachable error PDU was received. |
Q | Source quench (destination too busy). |
M | Could not fragment. |
? | Unknown packet type. |
& | Packet lifetime exceeded. |
Five exclamation points and "Success rate is 100 percent (5/5)" mean the two routers can talk. Run the same ping from R2 toward 192.168.1.1 to confirm the path works in both directions.
If the ping fails
- Dots (
.....). Requests are timing out. Check that both interfaces are up withshow ip interface, that both addresses are in the same network, and that you typed the mask correctly. - Interface still shut down. Cisco's ping and traceroute article describes an interface that has been shut down as one cause of lost connectivity. Re-enter interface mode and run
no shutdown. - Red link markers on the cable. The link is not up. Remove the cable and reconnect it, and make sure you used a copper cable between two Ethernet ports, not a serial or console cable.
- Wrong port name. If IOS rejects the interface name, type
interface ?to list what the router model accepts. - Ping works in one direction only. Compare the two addresses and masks character by character. A single typo in a mask is enough to break one side.
What to build next
Once two routers can ping each other, extend the same lab. Add a third router and a second network such as 192.168.2.0/24, and see which pings fail until you add routing. Each step gives you a new way to break things and a show command to find out why, and that loop of change, test and inspect is where a simulator pays off.
Frequently asked questions
- Is Cisco Packet Tracer free?
- Cisco Networking Academy offers Packet Tracer through a page titled 'Free Training and Download', and it is distributed through a Networking Academy (NetAcad) account. Get it only from netacad.com, not from third-party download sites, which can host outdated or modified copies. Check the NetAcad page for the current version and operating systems it supports, because those change between releases.
- Why does my ping show dots instead of exclamation points?
- In Cisco IOS, each exclamation point means a reply was received, and each period means the wait for a reply timed out. A row of dots usually means the packets are not getting an answer: a wrong IP address or mask, an interface that is still shut down, or a cable plugged into the wrong port. Check each interface with show ip interface.
- Why do the first pings in a lab often fail and later ones work?
- Interfaces and links take a moment to come up, and the first packet to a new neighbour may time out while the device works out how to reach it. A pattern such as a dot followed by four exclamation points is common. If every attempt still fails after the link lights are green, treat it as a real fault and check addresses and masks.
- Do I need a real Cisco router to practise these commands?
- No. Packet Tracer simulates the devices and gives you an IOS-style command line, so the configuration commands in this lab are the same ones you would type on equipment. A simulator does not reproduce every feature or every IOS release, so confirm unusual commands against Cisco's documentation for your platform.