1、先对PC0和PC1配置IP和网关。
PC0 1.1.1.1 255.0.0.0(子网掩码) 1.1.1.2(默认网关)
PC1 1.1.4.1 255.0.0.0(子网掩码) 1.1.4.2(默认网关)
2、在三层交换机上划分vlan10和vlan20,创建虚拟接口并设置IP,使之开启路由功能。
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport access vlan 10
Switch(config)#interface vlan 10
Switch(config-if)#ip address 1.1.1.2 255.0.0.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#interface vlan 20
Switch(config-if)#ip address 1.1.2.1 255.0.0.0
Switch(config-if)#no shutdown
3、对两台路由设备配置IP地址,找出DCT串口设置时钟频率、。
假如DCT串口是ROUTER0
对ROUTER0的设置:
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 1.1.2.2 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 2/0
Router(config-if)#ip address 1.1.3.1 255.0.0.0
Router(config-if)#clock rate 64000
Router(config-if)#no shutdown
对ROUTER2 的设置:
Router(config)#interface serial 2/0
Router(config-if)#ip address 1.1.3.2 255.0.0.0
Router(config-if)#no shutdown
4、对三层交换机和两台路由器查看路由表(show ip route)。
交换机:
Switch#show ip rout
Switch#show ip route
Codes: C - connected, S - static, I - IGRP, 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
C 1.0.0.0/8 is directly connected, Vlan10
ROUTER0:
Router#show ip rou
Router#show ip route
Codes: C - connected, S - static, I - IGRP, 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
C 1.0.0.0/8 is directly connected, FastEthernet0/0
ROUTER1:
Router#SHOW IP ROUte
Codes: C - connected, S - static, I - IGRP, 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
5、对三层交换机和两台路由器均开启RIP或者开启OSPF进程,再次查看路由表。对比两次查看的结果。
开启OSPF进程
三层交换机的:
Switch(config)#router ospf
Switch(config-router)#network 192.168.2.0 0.0.0.255 area 0
Switch(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#end
对两个个路由器进行同样的设置:
Router(config)#router ospf 1
Router(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router(config-router)#network 192.168.4.0 0.0.0.255 area 0
Router(config-router)#end
也可以开启RIP进程
三层交换机的:
Switch(config)#router rip
Switch(config-router)#network 192.168.1.0
Switch(config-router)#network 192.168.2.0
Switch(config-router)#version 2
对路由器进行同样的设置:
Router(config)#ROUter RIP
Router(config-router)#NETwork 192.169.3.0
Router(config-router)#NETwork 192.169.4.0
Router(config-router)#VERsion 2
Router(config-router)#END
6、测试PC0和PC1的连通性。