CCNP(BCMSN)实验:VLAN间路由--配置多台三层交换VLAN间相互通信(ensp三层交换机实现vlan间路由)

网友投稿 217 2022-09-21


CCNP(BCMSN)实验:VLAN间路由--配置多台三层交换VLAN间相互通信(ensp三层交换机实现vlan间路由)

实验过程:

第一步:配置sw1sw1(config)# int f2/13sw1(config-if)#no sw//将2层变为3层sw1(config-if)#ip add 12.0.0.1 255.255.255.0sw1(config-if)#no sh第二步:配置sw2

sw2(config)#int f2/13sw2(config-if)#no sw//将2层变为3层sw2(config-if)#ip add 12.0.0.2 255.255.255.0sw2(config-if)#no sh第三步:在sw1上vlan配置

sw1#vlan dasw1#vlan database sw1(vlan)#vlan 100 name pc1-192VLAN 100 added:Name: pc1-192sw1(vlan)#exiAPPLY completed.Exiting....sw1#conf tEnter configuration commands, one per line. End with CNTL/Z.sw1(config)#int f2/1sw1(config-if)#sw mo accsw1(config-if)#sw acc vlan 100sw1(config-if)#no shsw1(config-if)#spanning-tree portfast

sw1#sh vlan-s

VLAN Name Status Ports

1 default active Fa2/0, Fa2/2, Fa2/3, Fa2/4Fa2/5, Fa2/6, Fa2/7, Fa2/8Fa2/9, Fa2/10, Fa2/11, Fa2/12Fa2/14, Fa2/15100 pc1-192 active Fa2/11002 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 - - - - - 1002 1003100 enet 100100 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 1 10031003 tr 101003 1500 1005 0 - - srb 1 10021004 fdnet 101004 1500 - - 1 ibm - 0 0 1005 trnet 101005 1500 - - 1 ibm - 0 0 第四步:在sw2上配置vlan

sw2#vlan dasw2#vlan database sw2(vlan)#vlan 200 name pc2-172VLAN 200 added:Name: pc2-172sw2(vlan)#exiAPPLY completed.Exiting....sw2#conf tEnter configuration commands, one per line. End with CNTL/Z.sw2(config)#int f2/2sw2(config-if)#sw mo accsw2(config-if)#sw acc vlan 200sw2(config-if)#spanning-tree portfast第五步:在sw1 和sw2配置SVI(交换机虚拟接口)并给各自连接的pc配置相应的地址和网关(pc相关配置:略)

①SW1上的配置sw1(config)#int vlan 100

sw1(config-if)#ip ad 172.16.0.1 255.255.255.0sw1(config-if)#no sh

sw1#ping 192.168.0.200

Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.0.200, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 8/20/56 ms//在sw上ping pc

R1# ping 192.168.0.1

Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 4/17/36 ms//在pc1上ping网关②SW上的配置sw2(config)#int vlan 200sw2(config-if)#ip add 1sw2(config-if)#ip add 172.16.0.1 255.255.255.0sw2(config-if)#no sh

sw2# ping 172.16.0.100

Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.0.100, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 8/27/64 ms//sw2上ping pc

R2#ping 172.16.0.1

Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 8/22/48 ms//从pc上ping sw2

第六步 :在sw1和sw2上开启路由功能,这里我们运行动态路由协议,并查看路由协议

sw1(config)#router ossw1(config)#router ospf 11sw1(config-router)#net 12.0.0.1 0.0.0.255 a 0sw1(config-router)#net 192.168.0.1 0.0.0.255 a 0sw1(config-router)#end

sw2(config)#router ospf 11sw2(config-router)#net 12.0.0.2 0.0.0.255 a 0sw2(config-router)#net 172.16.0.1 0.0.0.255 a 0

sw1#sh ip rou………………172.16.0.0/24 is subnetted, 1 subnetsO 172.16.0.0 [110/2] via 12.0.0.2, 00:00:33, FastEthernet2/13C 192.168.0.0/24 is directly connected, Vlan10012.0.0.0/24 is subnetted, 1 subnetsC 12.0.0.0 is directly connected, FastEthernet2/13

sw2#sh ip rou………………172.16.0.0/24 is subnetted, 1 subnetsC 172.16.0.0 is directly connected, Vlan200O 192.168.0.0/24 [110/2] via 12.0.0.1, 00:00:58, FastEthernet2/1312.0.0.0/24 is subnetted, 1 subnetsC 12.0.0.0 is directly connected, FastEthernet2/13第七步:测试

R2#ping 192.168.0.200

Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.0.200, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 52/77/108 ms

sw2# ping 172.16.0.100

Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.0.100, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 4/18/52 ms


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:CCNP(BCMSN)实验:DHCP监听、IP源防护、DAI
下一篇:Java面试最容易被刷的重难点之锁的使用策略
相关文章

 发表评论

暂时没有评论,来抢沙发吧~