侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

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

2023-04-06 星期四 / 0 评论 / 0 点赞 / 72 阅读 / 5540 字

本实验要求:通过在SW1来规划vlan 100,sw2上规划vlan200.因为vlan100和vlan200因为业务上的关系,需要两台pc之间相互通信,保证不同vlan之间可以互访。实验过程:第一步

.


本实验要求:
通过在SW1来规划vlan 100,sw2上规划vlan200.因为vlan100和vlan200因为业务上的关系,需要两台pc之间相互通信,保证不同vlan之间可以互访。

实验过程:

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

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

sw1#vlan da
sw1#vlan database
sw1(vlan)#vlan 100 name pc1-192
VLAN 100 added:
Name: pc1-192
sw1(vlan)#exi
APPLY completed.
Exiting....
sw1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
sw1(config)#int f2/1
sw1(config-if)#sw mo acc
sw1(config-if)#sw acc vlan 100
sw1(config-if)#no sh
sw1(config-if)#spanning-tree portfast

sw1#sh vlan-s

VLAN Name Status Ports


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

sw2#vlan da
sw2#vlan database
sw2(vlan)#vlan 200 name pc2-172
VLAN 200 added:
Name: pc2-172
sw2(vlan)#exi
APPLY completed.
Exiting....
sw2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
sw2(config)#int f2/2
sw2(config-if)#sw mo acc
sw2(config-if)#sw acc vlan 200
sw2(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.0
sw1(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 200
sw2(config-if)#ip add 1
sw2(config-if)#ip add 172.16.0.1 255.255.255.0
sw2(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 os
sw1(config)#router ospf 11
sw1(config-router)#net 12.0.0.1 0.0.0.255 a 0
sw1(config-router)#net 192.168.0.1 0.0.0.255 a 0
sw1(config-router)#end

sw2(config)#router ospf 11
sw2(config-router)#net 12.0.0.2 0.0.0.255 a 0
sw2(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 subnets
O 172.16.0.0 [110/2] via 12.0.0.2, 00:00:33, FastEthernet2/13
C 192.168.0.0/24 is directly connected, Vlan100
12.0.0.0/24 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, FastEthernet2/13

sw2#sh ip rou
………………
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, Vlan200
O 192.168.0.0/24 [110/2] via 12.0.0.1, 00:00:58, FastEthernet2/13
12.0.0.0/24 is subnetted, 1 subnets
C 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

.

广告 广告

评论区