PC>ping 192.168.3.11 可以ping通主机D
Pinging 192.168.3.11 with 32 bytes of data:
Reply from 192.168.3.11: bytes=32 time=62ms TTL=127 Reply from 192.168.3.11: bytes=32 time=62ms TTL=127 Reply from 192.168.3.11: bytes=32 time=47ms TTL=127 Reply from 192.168.3.11: bytes=32 time=62ms TTL=127
Ping statistics for 192.168.3.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 47ms, Maximum = 62ms, Average = 58ms
连通路由器和交换机的命令
R10006(config)#int f0/0
R10006 (config-if)#ip address 192.168.2.1 255.255.255.0 R10006 (config-if)#no shutdown R10006 (config-if)#ex
R10006 (config)#router ospf 1 /在路由器R6上配置OSPF协议
R10006 (config-router)#network 192.168.2.0 255.255.255.0 area 2 //声明网段和区域,拓扑图给出
R10006 (config-router)#
SW10007 (config)#router ospf 1 //在交换机SW7上配置OSPF协议
SW10007 (config-router)#network 192.168.2.0 255.255.255.0 area 2 //声明网段和区域 SW10007 (config-router)#network 192.168.3.0 255.255.255.0 area 2 //声明网段和区域 SW10007 (config-router)#
此时主机C和主机D都可以pingt通R6的f0/0接口
R10006#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 192.168.2.0/24 is directly connected, FastEthernet0/0
O 192.168.3.0/24 [110/2] via 192.168.2.2, 00:50:20, FastEthernet0/0 路由表中有R6学习交换机vlan400的路由
方法二
用交换机SW8和R5
SW10008(config)#vlan 500 //创建vlan500 SW10008 (config-vlan)#ex
SW10008(config)#vlan 600 //创建vlan600 SW10008 (config-vlan)#ex
SW10008 (config)#int range f0/1-4
SW10008(config-if-range)#switchport access vlan 500 //将端口f0/1-4划归到vlan500中 SW10008 (config-if-range)#ex SW10008 (config)#int range f0/5-8
SW10008(config-if-range)#switchport access vlan 600 //将端口f0/1-4划归到vlan600中 SW10008 (config-if-range)#ex SW10008 (config)#int f0/24
SW10008(config-if)#switchport access vlan 1 //将端口f0/24划归到vlan1中 SW10008 (config-if)#ex
SW10008 (config)#int vlan 500 //进入vlan接口配置模式 SW10008 (config-if)#ip address 192.168.7.1 255.255.255.0 //分配IP SW10008 (config-if)#no shutdown SW10008 (config-if)#ex
SW10008 (config)#int vlan 600 //vlan400同理 SW10008(config-if)#ip address 192.168.6.1 255.255.255.0 SW10008 (config-if)#no shutdown
SW10008 (config)#int vlan 1 //vlan1同理 SW10008(config-if)#ip address 192.168.4.2 255.255.255.0 SW10008 (config-if)#no shutdown SW10008 (config-if)#ex
SW10008 (config)#ip routing //开启三层交换机路由功能 SW10008 (config)#
此时SW10008中的vlan500,vlan600和vlan1 之间都是互通的 主机E 192.168.7.11/24 网关192.168.7.1 //vlan500IP地址 主机F 192.168.6.11/24 网关192.168.6.1 //vlan600IP地址 主机E ping结果
PC>ping 192.168.7.1
Pinging 192.168.7.1 with 32 bytes of data:
Reply from 192.168.7.1: bytes=32 time=63ms TTL=255 Reply from 192.168.7.1: bytes=32 time=32ms TTL=255 Reply from 192.168.7.1: bytes=32 time=13ms TTL=255 Reply from 192.168.7.1: bytes=32 time=31ms TTL=255
Ping statistics for 192.168.7.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 13ms, Maximum = 63ms, Average = 34ms
PC>ping 192.168.6.1
Pinging 192.168.6.1 with 32 bytes of data:
Reply from 192.168.6.1: bytes=32 time=17ms TTL=255 Reply from 192.168.6.1: bytes=32 time=16ms TTL=255 Reply from 192.168.6.1: bytes=32 time=15ms TTL=255 Reply from 192.168.6.1: bytes=32 time=32ms TTL=255
Ping statistics for 192.168.6.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 15ms, Maximum = 32ms, Average = 20ms
PC>ping 192.168.4.1
Pinging 192.168.4.1 with 32 bytes of data:
Reply from 192.168.4.1: bytes=32 time=31ms TTL=254 Reply from 192.168.4.1: bytes=32 time=63ms TTL=254 Reply from 192.168.4.1: bytes=32 time=63ms TTL=254 Reply from 192.168.4.1: bytes=32 time=63ms TTL=254
Ping statistics for 192.168.4.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 31ms, Maximum = 63ms, Average = 55ms
PC>ping 192.168.6.11
Pinging 192.168.6.11 with 32 bytes of data:
Reply from 192.168.6.11: bytes=32 time=46ms TTL=127
Reply from 192.168.6.11: bytes=32 time=63ms TTL=127 Reply from 192.168.6.11: bytes=32 time=63ms TTL=127 Reply from 192.168.6.11: bytes=32 time=30ms TTL=127
Ping statistics for 192.168.6.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 30ms, Maximum = 63ms, Average = 50ms
连通路由器和交换机的命令
R10005(config)#int f0/0
R10005 (config-if)#ip address 192.168.4.1 255.255.255.0 R10005 (config-if)#no shutdown R10005 (config-if)#ex
R10005 (config)#router ospf 1
R10005 (config-router)#network 192.168.4.0 255.255.255.0 area 3 R10005 (config-router)#
SW10008#conf
SW10008 (config)#router ospf 1
SW10008 (config-router)#network 192.168.4.0 255.255.255.0 area 3 SW10008 (config-router)#network 192.168.6.0 255.255.255.0 area 3 SW10008 (config-router)#network 192.168.7.0 255.255.255.0 area 3 SW10008 (config-router)#
R10005 #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 192.168.4.0/24 is directly connected, FastEthernet0/0
O 192.168.6.0/24 [110/2] via 192.168.4.2, 00:13:55, FastEthernet0/0 O 192.168.7.0/24 [110/2] via 192.168.4.2, 00:13:55, FastEthernet0/0 路由表中有R5学习交换机vlan500和vlan600的路由 此时三个边缘区域已经成功创建,开始创建骨干区域
相关推荐: