In this activity, we are going to set up a simple network containing 1 cisco router, 1 cisco switch and 2 windows devices with terminals. We will learn how to use the Command Line Interface (CLI) on these devices and how to configure the devices as well as validate our connections. We will be using the above topology and addressing table as a reference.
Part 1: Set Up topology and Initialize Devices
First, we open a new empty file on packet tracer where we drag and drop the devices required.
- 1 Cisco Router (4221 Preferably, 4321 also works since we don’t use Serial ports in this exercise).
- 1 Cisco Switch (2960).
- 2 Devices (Windows devices that can run a terminal emulation program).
- Console cables to configure the Cisco Switch and Router via console ports.
- Ethernet cables
Note: In this topology, since we do not have similar devices connecting to each other, we can use straight through cables. If we have inter-connecting routers, we would have to use crossover cables. We would also be required to use cross over cables if we weren’t using Cisco 4221/4321 Routers because these devices are autosensing.
A well-connected network should look like this. However, before setting up the router and switch the links between the switch to router and router to PC-B will have red link lights. The image below is of the final topology.
Part 2: Configure Devices and Verify Connectivity
Once you have connected the devices, refer to the addressing table and assign a static IPv4, IPv6 and default gateway address to PC-A and PC-B. After this, try pinging PC-B from PC-A. This will most likely fail because the default gateways on the router have not been configured and thus layer 3 traffic cannot be routed between subnets. If your devices do ping, it means there was a prior configuration on the devices, you should clear this configuration before going ahead with this exercise. This can be done using the erase command paired with the config you want to erase. After this, you can issue the reload command.
Next, console into the router from PC-B. Enter the terminal and accept default settings. Follow these steps to configure the router.
a. Console into the router and enable privileged EXEC mode.
- Router> enable
b. Enter configuration mode.
- Router# config terminal
c. Assign a device name to the router.
- Router(config)# hostname R1
d. Disable DNS lookup to prevent the router from attempting to translate incorrectly entered commands as though they were host names.
- R1(config)# no ip domain lookup
e. Assign class as the privileged EXEC encrypted password.
- R1(config)# enable secret class
f. Assign cisco as the console password and enable login.
- R1(config)# line console 0
- R1(config-line)# password cisco
- R1(config-line)# loging.
g.Assign cisco as the VTY password and enable login.
- R1(config)# line vty 0 4
- R1(config-line)# password cisco
- R1(config-line)# login
h. Encrypt the plaintext passwords.
- R1(config)# service password-encryption
i. Create a banner that warns anyone accessing the device that unauthorized access is prohibited.
- R1(config)# banner motd $ Authorized Users Only! $
j. Configure and activate both interfaces on the router.
- R1(config)# interface g0/0/0
- R1(config-if)# ip address 192.168.0.1 255.255.255.0
- R1(config-if)# ipv6 address 2001:db8:acad::1/64
- R1(config-if)# ipv6 address FE80::1 link-local
- R1(config-if)# no shutdown
- R1(config-if)# exit
- R1(config)# interface g0/0/1
- R1(config-if)# ip address 192.168.1.1 255.255.255.0
- R1(config-if)# ipv6 address 2001:db8:acad:1::1/64
- R1(config-if)# ipv6 address fe80::1 link-local
- R1(config-if)# no shutdown
- R1(config-if)# exit
k. Configure an interface description for each interface indicating which device is connected to it.
- R1(config)# interface g0/0/1
- R1(config-if)# description Connected to F0/5 on S1
- R1(config-if)# exit
- R1(config)# interface g0/0/0
- R1(config-if)# description Connected to Host PC-B
- R1(config-if)# exit
l. To enable IPv6 routing, enter the command ipv6 unicast-routing.
- R1(config)# ipv6 unicast-routing
m. Save the running configuration to the startup configuration file.
- R1(config)# exit
- R1# copy running-config startup-config
n. Set the clock on the router.
- R1# clock set 15:30:00 27 Aug 2019
Try pinging PC-B from PC-A now. The pings should be successful now since we have the router’s interfaces configured and PC-A and PC-B can find their default gateways. The switch will automatically pick up the devices connected to it.
Let us now configure the switch. By default, a switch has a VLAN, VLAN 1, which is preset in the device. We will be assigning this VLAN an IP address. To do this console into the switch from PC-A. Use default terminal configuration.
a. Console into the switch and enable privileged EXEC mode.
- Switch> enable
b. Enter configuration mode.
- Switch# config terminal
c. Assign a device name to the switch.
- Switch(config)# hostname S1
d. Disable DNS lookup to prevent the router from attempting to translate incorrectly entered commands as though they were host names.
- S1(config)# no ip domain-lookup
e. Configure and activate the VLAN interface on the switch S1.
- S1(config)# interface vlan 1
- S1(config-if)# ip address 192.168.1.2 255.255.255.0
- S1(config-if)# no shutdown
- S1(config-if)# exit
f. Configure the default gateway for the switch S1.
- S1(config)# ip default-gateway 192.168.1.1
- S1(config-if)# exit
g. Save the running config to a startup file
- S1# copy running-config startup-config
Pinging the PC-B from PC-A should now be successful. Pinging the switch S1 from PC-B should also be successful.
Part 3: Displaying Device Information
Show the IP routing table on router R1 using the command show ip route. This can be done via the console on PC-B.
The codes C and L signify the connection type for the respective IP addresses. Code C shows a directly connected subnet and code L shows a local interface. In our case, R1 is connected to 2 subnets and it has a link on both of these, one of them is on the Gig0/0/0 interface and the other on Gig0/0/1 interface.
We can also view the IPv6 routing table on R1. To do this connect to the router via the console and input the command show ipv6 route. This gives us the following result.
We can also see the specific information for a particular interface on the router R1. Let us take Gig0/0/1 for example, we issue the command show ip interface g0/0/1 on the terminal. This gives us the following results.
We can see that the interface Gig0/0/1 is up and the results also show the IPv4 address of the interface together with its subnet mask. We can issue a command to get IPv6 information on the interface as well. The results are as so.
We can also view an overview of all the interface on the device R1 using the command show ip interface brief for IPv4 overview and show ipv6 interface brief for IPv6 brief.
Let us console onto the switch S1 and get information about its interfaces. We can use the command show ip interface brief. These are the results we obtain. Your results might vary based on the interfaces you have used.
I hope you have learnt something in this exercise. This lab was set up for me thanks to to Cisco and CyberShujaa.