Configuring Routers and PC’s in Packet Tracer
In this tutorial I am going to show you how to configure routers and PC’s in Cisco’s Packet Tracer. The logical network we are going to configure is very similar to the skills test for CCNA1 so this will hopefully be usefull if you are going to sit the CCNA course.
Before I begin I will assume that you have Packet Tracer installed and that you know the basics in how to use it, i.e how to drag devices onto the workspace and access configuration dialogues, etc.
First of all the logical network we will be configuring looks like this:
Logical Network in Packet Tracer
As you can see this network consists of 2 subnets 192.168.1.0/24 and 192.168.2.0/24.
- PC0 is directly connected to router0 via interface fa0/0. pc0 is on the 192.168.1.0/24 network. pc0 is connected to the router using copper cross-over cable.
- pc1 is connected to a switch, the switch is connected to router0 via interface 1/0. pc1 is on the 192.168.2.0/24 network. pc1 is connected to the switch using copper straightthrough cable, the switch is connected to the router using copper straightthrough cable.
- The goal is to configure IP addresses for the router interfaces and end devices(PC’s) so the can communicate with each other, this will be tested by using the ping command.
Once we have our network devices on the workspace and connected using the appropriate cables we can begin to configure them, first of all we will configure the router. To access the router’s CLI left click the router and selct the CLI tab. The first thing that you see will be this:
Packet Tracer router Command Line Interface
Now we must type in the commands to configure the router.
Firstly we type
enable to access the priviliged mode. Once in enable mode we type
config terminal to access terminal configuration mode. Note: commands in packet tracer (and cisco routers) can be abbreviated so you can also type config t.
Once in config mode (router0(config)#) we can give the router a hostname, for this tutorial we will call the router ‘router0′ so we type
hostname router0 then hit enter. The next thing to do is to enable a password so we type
enable secret cisco with ‘cisco’ being the password, we can also enable password encryption so if any one looks at the startup-config file the password will be encrypted we can do this by typing
service password-encryption while we are stil in enable mode we can also type
no ip domain-lookup this disables the default behavior of the router of attempting to resolve an invalid command into an IP address.
The next thing we have to do is to configure the terminal line and the console line, to configure the virtual terminal line we type
line vty 0 4 (make sure you’re still in config mode when you type this). The prompt should now look like router0(config-line)#. We will now set a password to access the terminal line by typing
password class ‘code’ being the password, hit enter then we type
login and hit enter. Now type
exit and hit enter to get back into config mode.
We will now configure the console line by typing
line con 0 and hit enter the password and login commands are the same for the console line.
Once that’s done type
exit to return to config mode. We will now set a message of the day banner, this will be seen when someone first access the router CLI.
To se the message of the day we type (while in config mode)
banner motd #Message Goes Here# and then hit enter, a good message to use is Authorised Access Only!.
Now we can configure the router interfaces.
First we will configure interface fast ethernet 0/0, while in config mode type
inf fa0/0 then hit enter, now we input the IP address and subnet mask, the IP of int fa0/0 is 192.168.1.1 (default gateway) so we type
ip address 192.168.1.1 255.255.255.0 and then hit enter. Now we must put in a description of this interface, so we type
description subnet1 and hit enter, the last thing to do to type
no shutdown which basically puts the interface into the up state.
We can now type exit to go back to config mode and configure interface fast ethernet 1/0 which has the ip address of 192.168.2.1. We type
int fa1/0 to enter the interface config mode and then we input the ip addres and subnet mask by typing
ip address 192.168.2.1 255.255.255.0 and hit enter. The rest of the commands are the same except we enter a different description for this interface (subnet2).
Now that we have the routers interfaces configured we need to configure IP information for the PC’s.
Left click on pc0,which is on the 192.168.1.0/24 network, got the desktop tab and then IP configuration and enter the information shown in the image below.
pc0 IP configuration in Packet Tracer
We can now go and configure IP address information for pc1, which is on the 192.168.2.0/24 network, with the following information.
PC1 IP address configuration
Once that is done we can close the IP configuration dialog box and click on the command prompt so we can test connectivity.
We test connectivity by issuing the
ping command. First we ping the default gateway which has the IP address of 192.168.2.1 as shown below.
Testing connectivity using the ping command
We can also ping the default gateway of subnet 1 and the end devide on subnet 1 (192.168.1.2) to make sure we can connect to that network.
Now we can test connectivity from pc0 which is on the 192.168.1.0/24 network, do the same as PC1 and ping the default gateway (192.168.1.1}, subnet 2’s default gateway and pc1.
Testing connectivity with the ping command
We can also issue the ping command from the router CLI when in normal user mode or config mode.
Now that we have tested that our network is configured and working properly we can save the routers config file by typing
copy run start whilst in the routers CLI. To view the running-config file you can type
show running-config, the running-config file should look something like this:
router0#show running-config Building configuration... Current configuration : 847 bytes ! version 12.2 no service timestamps log datetime msec no service timestamps debug datetime msec service password-encryption ! hostname router0 ! ! ! enable secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0 ! ! ! ! ! ! ! ! no ip domain-lookup ip name-server 0.0.0.0 ! ! ! ! ! ! interface FastEthernet0/0 description subnet1 ip address 192.168.1.1 255.255.255.0 duplex auto speed auto ! interface FastEthernet1/0 description subnet2 ip address 192.168.2.1 255.255.255.0 duplex auto speed auto ! interface Serial2/0 no ip address shutdown ! interface Serial3/0 no ip address shutdown ! interface FastEthernet4/0 no ip address shutdown ! interface FastEthernet5/0 no ip address shutdown ! ip classless ! ! ! ! ! banner motd ^CAuthorised^C ! ! ! ! line con 0 password 7 0822404F1A0A login line vty 0 4 password 7 0822404F1A0A login ! ! ! end