Cisco CLI 101
A Basic Guide to Cisco Packet tracer’s CLI. From IPs to Inter-Vlans Configuration.
Most Students use Graphical User Interface(GUI) feature of the cisco packet tracer, It may work for them and it will never have the soul as they say. Using and knowing Command Line Interface (CLI) is one of the most important skill in all of IT industry, and it is pretty fun at the same time.
This is a short introduction along side a few important commands to configure most of the network, from basic to moderate configurations.
How does it look like?
Lets take a Basic Network with 2 routers, same amount of switches and PCs.
Router : 2811 with WIC-2T part integrated explicitly
Switch : 2960
As, You can see nothing is configured yet, so we will start configuring it using the CLI commands.
- Physical Layer & Interface Config
Router 0:
Router> en
Router# conf t
Router(config)# hostname R0
R0(config)# interface fa0/0
R0(config-if)# ip address 192.168.1.1 255.255.255.0
R0(config-if)# no shutdown
R0(config-if)# exit
R0(config)# interface s0/0/0
R0(config-if)# ip address 10.0.0.1 255.0.0.0
R0(config-if)# clock rate 64000
R0(config-if)# no shutdown
Similarly with the second router,
Router 1:
Router> en
Router# conf t
Router(config)# hostname R1
R1(config)# interface fa0/0
R1(config-if)# ip address 192.168.2.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface s0/0/0
R1(config-if)# ip address 10.0.0.2 255.0.0.0
R1(config-if)# no shutdown
2. Configuring few Dynamic Routing Protocols:
I used Enhanced Interior Gateway Routing Protocol (EIGRP) & Routing Information Protocol (RIP).
EIGRP:
Router 0:
R0(config)# router eigrp 100
R0(config-router)# network 192.168.1.0
R0(config-router)# network 10.0.0.0
R0(config-router)# no auto-summary
Get Simmba7x’s stories in your inbox
Join Medium for free to get updates from this writer.
Router 1:
R1(config)# router eigrp 100
R1(config-router)# network 192.168.2.0
R1(config-router)# network 10.0.0.0
R1(config-router)# no auto-summary
RIP:
Router 0:
R0> en
R0# conf t
R0(config)# router rip
R0(config-router)# version 2
R0(config-router)# network 192.168.1.0
R0(config-router)# network 10.0.0.0
R0(config-router)# no auto-summary
Router 1:
R1> en
R1# conf t
R1(config)# router rip
R1(config-router)# version 2
R1(config-router)# network 192.168.2.0
R1(config-router)# network 10.0.0.0
R1(config-router)# no auto-summary
3. VLAN Configuration
I made 2 Vlans in network 1, Following is the configuration.
Network’s Switch Configuration:
Switch> en
Switch# conf t
Switch(config)# vlan 10
Switch(config-vlan)# name HR
Switch(config-vlan)# exit
Switch(config)# vlan 20
Switch(config-vlan)# name Sales
Switch(config-vlan)# exit
Switch(config)# interface fa0/2
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config)# interface range fa0/3
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20
Switch(config)# int fa0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# no shut
Inter-Vlan Routing:
Our VLANs would be useless without inter-vlan routing, following is the router’s configuration:
Network’s Router Configuration:
R0(config)# interface fa0/0
R0(config-if)# no shutdown
R0(config-if)# exit
R0(config)# interface fa0/0.10
R0(config-subif)# encapsulation dot1Q 10
R0(config-subif)# ip address 192.168.10.1 255.255.255.0
R0(config)# interface fa0/0.20
R0(config-subif)# encapsulation dot1Q 20
R0(config-subif)# ip address 192.168.20.1 255.255.255.0
4. DHCP with VLANs
Now I have to assign appropriate IPs to the devices so they can communicate with each other, i can either do manually but it would be a great headache for a large scale network, So i am using Dynamic Host Configuration Protocol (DHCP) to automatically assign IPs to all the devices on the network.
Network’s Router Configuration:
Router(config)# ip dhcp pool HR_POOL
Router(dhcp-config)# network 192.168.10.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.10.1
Router(dhcp-config)# exit
Router(config)# ip dhcp pool SALES_POOL
Router(dhcp-config)# network 192.168.20.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.20.1
And that’s how you configure a basic setup using CLI! Hope you all learnt something, Peace.




