Basic Router Configuration, Static Routing Implementation
Working-Network Example
Configuring Router,switches and hosts
1. Router Configuration
Router>en
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#no ip domain-lookup
Router(config)#interface gigabitEthernet 0/0
Router(config-if)#no shut down
Router(config-if)#exit
Router(config)#exit
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface gigabitEthernet 0/0.10
Router(config-subif)#encapsulation dot1Q 10
Router(config-subif)#ip address 10.1.1.1 255.255.255.0
Router(config-subif)#exit
Router(config)#interface gigabitEthernet 0/0.20
Router(config-subif)#encapsulation dot1Q 20
Router(config-subif)#ip address 20.1.1.1 255.255.255.0
Router(config-subif)#exit
Router(config)#interface gigabitEthernet 0/0.30
Router(config-subif)#encapsulation dot1Q 30
Router(config-subif)#ip address 30.1.1.1 255.255.255.0
Router(config-subif)#exit
Router(config)#do write
Router(config)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 unassigned YES unset up up
GigabitEthernet0/0.10 10.1.1.1 YES manual up up
GigabitEthernet0/0.20 20.1.1.1 YES manual up up
GigabitEthernet0/0.30 30.1.1.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
Router(config)#do show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.1.1.0/24 is directly connected, GigabitEthernet0/0.10
L 10.1.1.1/32 is directly connected, GigabitEthernet0/0.10
20.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 20.1.1.0/24 is directly connected, GigabitEthernet0/0.20
L 20.1.1.1/32 is directly connected, GigabitEthernet0/0.20
30.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 30.1.1.0/24 is directly connected, GigabitEthernet0/0.30
L 30.1.1.1/32 is directly connected, GigabitEthernet0/0.30
Router(config)#end
2.Switches Configuration
i. Top switch (switch0)
Switch>
Switch>en
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname VTP-Server
VTP-Server(config)#VTP mode server
Device mode already VTP SERVER.
VTP-Server(config)#vtp domain bct73
Changing VTP domain name from NULL to bct73
VTP-Server(config)#vlan 10
VTP-Server(config-vlan)#name admin
VTP-Server(config-vlan)#exit
VTP-Server(config)#vlan 20
VTP-Server(config-vlan)#name labs
VTP-Server(config-vlan)#exit
VTP-Server(config)#vlan 30
VTP-Server(config-vlan)#name students
VTP-Server(config-vlan)#exit
VTP-Server(config)#do show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
10 admin active
20 labs active
30 students active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
VTP-Server(config)#
VTP-Server(config)#interface range gigabitEthernet 0/1-2
VTP-Server(config-if-range)#switchport mode trunk
VTP-Server(config-if-range)#exit
VTP-Server(config)#interface range fa 0/1
VTP-Server(config-if-range)#switchport mode trunk
VTP-Server(config-if-range)#exit
VTP-Server(config)#exit
VTP-Server#
VTP-Server#show interface gigabitEthernet 0/1 switchport
Name: Gig0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: All
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
VTP-Server#show interface gigabitEthernet 0/2 switchport
Name: Gig0/2
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: All
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
VTP-Server#show interface fa 0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: All
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
ii. Leftmost bottom switch (switch 1) & hosts
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#
Switch(config)#hostname client1
client1(config)#vtp mode client
Setting device to VTP CLIENT mode.
client1(config)#vtp domain bct73
Domain name already set to bct73.
client1(config)#no ip domain-lookup
client1(config)#interface range fa 0/1-8
client1(config-if-range)#switchport mode access
client1(config-if-range)#switchport access vlan 10
client1(config-if-range)#exit
client1(config)#interface range fa 0/9-16
client1(config-if-range)#switchport mode access
client1(config-if-range)#switchport access vlan 20
client1(config-if-range)#exit
client1(config)#interface range fa 0/17-24
client1(config-if-range)#switchport mode access
client1(config-if-range)#switchport access vlan 30
client1(config-if-range)#exit
client1(config)#interface gigabitEthernet 0/1
client1(config-if)#switchport mode trunk
client1(config-if)#exit
client1(config)#do show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gig0/2
10 admin active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
20 labs active Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
30 students active Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
30 enet 100030 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
client1#wr
Building configuration...
[OK]
client1#
Add static IP to hosts which are connected to leftmost bottom switch(switch1)
PC 0
IP-Address : 10.1.1.2
Subnet Mask : 255.255.255.0
Default Gateway : 10.1.1.1
DNS Server : 10.1.1.1
PC 1
IP-Address : 20.1.1.2
Subnet Mask : 255.255.255.0
Default Gateway : 20.1.1.1
DNS Server : 20.1.1.1
laptop 0
IP-Address : 30.1.1.2
Subnet Mask : 255.255.255.0
Default Gateway : 30.1.1.1
DNS Server : 30.1.1.1
Simulate by adding PDU to PC 0 and PC 1 of switch 1
iii. Rightmost bottom switch(switch2) and hosts
Switch>en
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vtp mode client
Setting device to VTP CLIENT mode.
Switch(config)#vtp domain bct73
Domain name already set to bct73.
Switch(config)#do show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/2
10 admin active
20 labs active
30 students active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
10 enet 100010 1500 - - - - - 0 0
20 enet 100020 1500 - - - - - 0 0
30 enet 100030 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
--------- ----------------- ------------------------------------------
Switch(config)#
Switch(config)#interface gigabitEthernet 0/1
Switch(config-if)#switchport mode trunk
Switch(config-if)#exit
Switch(config)#
Switch(config)#interface range fa 0/1-8
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 10
Switch(config-if-range)#exit
Switch(config)#
Switch(config)#interface range fa 0/9-16
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 20
Switch(config-if-range)#exit
Switch(config)#
Switch(config)#interface range fa 0/17-24
Switch(config-if-range)#switchport mode access
Switch(config-if-range)#switchport access vlan 30
Switch(config-if-range)#exit
Switch(config)#exit
Switch#wr
Building configuration...
[OK]
Switch#
Add static IP to hosts which are connected to Rightmost bottom switch(switch2)
PC 3
IP-Address : 10.1.1.3
Subnet Mask : 255.255.255.0
Default Gateway : 10.1.1.1
DNS Server : 10.1.1.1
PC 4
IP-Address : 20.1.1.3
Subnet Mask : 255.255.255.0
Default Gateway : 20.1.1.1
DNS Server : 20.1.1.1
laptop 1
IP-Address : 30.1.1.3
Subnet Mask : 255.255.255.0
Default Gateway : 30.1.1.1
DNS Server : 30.1.1.1
Simulate by adding PDU to PC 0 of switch 1 and PC 2 of switch 2 & analyse message flow in network