Lec 15
Lec 15
Configuring a Router from the Command Line Interface (CLI) in Cisco Packet
Tracer
In Cisco Packet Tracer, you can configure routers through the CLI. The following steps will
guide you in setting up a router, creating a second network, and building a WAN between two
LANs.
1. Add a Router
In Cisco Packet Tracer, drag and drop a router onto the workspace.
Right-click on the router and select CLI to open the Command Line Interface.
shell
Copy code
Router> enable
Router#
arduino
Copy code
Router# configure terminal
Router(config)#
scss
Copy code
Router(config)# hostname R1
R1(config)#
4. Configure Interfaces
Configure the GigabitEthernet interface for LAN connectivity:
arduino
Copy code
R1(config)# interface gigabitEthernet 0/0
R1(config-if)# ip address 192.168.1.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit
arduino
Copy code
R1(config)# interface serial 0/0/0
R1(config-if)# ip address 10.0.0.1 255.255.255.252
R1(config-if)# clock rate 64000
R1(config-if)# no shutdown
5. Save Configuration
lua
Copy code
R1# copy running-config startup-config
6. Verify Configuration
sql
Copy code
R1# show ip interface brief
R1# show running-config
Now we will create another network with a second router, which will later connect to the first
network via a WAN.
2. Configure R2
arduino
Copy code
Router# configure terminal
Router(config)# hostname R2
arduino
Copy code
R2(config)# interface gigabitEthernet 0/0
R2(config-if)# ip address 192.168.2.1 255.255.255.0
R2(config-if)# no shutdown
R2(config-if)# exit
arduino
Copy code
R2(config)# interface serial 0/0/0
R2(config-if)# ip address 10.0.0.2 255.255.255.252
R2(config-if)# no shutdown
lua
Copy code
R2# copy running-config startup-config
Now that both routers are configured with their respective LAN and WAN interfaces, we will
build a WAN to connect these two LANs.
Use a Serial DCE Cable to connect Serial 0/0/0 on R1 to Serial 0/0/0 on R2.
We will use RIP (Routing Information Protocol) to share routing information between
the routers.
On R1:
arduino
Copy code
R1(config)# router rip
R1(config-router)# version 2
R1(config-router)# network 192.168.1.0
R1(config-router)# network 10.0.0.0
R1(config-router)# exit
On R2:
arduino
Copy code
R2(config)# router rip
R2(config-router)# version 2
R2(config-router)# network 192.168.2.0
R2(config-router)# network 10.0.0.0
R2(config-router)# exit
3. Verify Connectivity
Use the ping command to check the connectivity between the two networks.
From a PC in LAN 1 (192.168.1.2), ping a PC in LAN 2 (192.168.2.2):
shell
Copy code
PC1> ping 192.168.2.2
If the routing is properly set up, you should get a successful reply.
1. Network Diagram:
oTwo routers (R1 and R2) connected via a Serial DCE Cable to form a WAN.
oEach router connects to its own LAN via GigabitEthernet interfaces.
2. Router CLI Configuration:
o Router 1 (R1) and Router 2 (R2) CLI views where IP addresses and routing
protocols (RIP) are configured.
1. Configure routers from the CLI in Packet Tracer, setting up interfaces for LAN and
WAN.
2. Build a second network with another router (R2).
3. Connect the two LANs using a WAN link between the routers.
4. Enable dynamic routing (RIP) or configure static routes to ensure connectivity between
the two networks.
5. Verify connectivity by pinging devices in the opposite LAN.
By following these steps, you will be able to configure routers in Cisco Packet Tracer and
establish communication between two separate LANs using a WAN connection.