vlan、vlan间路由、ospf协议等来实现三层交换机和单臂路由之间的通信
拓扑图:
1. 配置三层交换机vlan和vlan间路由
SW1
#进入视图
sys
sysn sw1
undo info-center enable
#配置vlan
vlan batch 10 20 30 40 50 60
#配置access口
int g0/0/1
port link-type access
port default vlan 60
int g0/0/2
port link-type access
port default vlan 50
#配置trunk口
int g0/0/3
port link-type trunk
port trunk allow-pass vlan all
int g0/0/4
port link-type trunk
port trunk allow-pass vlan all
#配置vlan间路由
int vlan 10
ip add 172.16.10.254 24
int vlan 20
ip add 172.16.20.254 24
int vlan 30
ip add 172.16.30.254 24
int vlan 40
ip add 172.16.40.254 24
int vlan 50
ip add 172.16.88.254 24
int vlan 60
ip add 172.16.0.1 24
SW2
#进入视图
sys
sysn sw2
undo info-center enable
#配置vlan
vlan batch 10 20 30 40 50 60
#配置trunk口
int e0/0/1
port link-type trunk
port trunk allow-pass vlan all
#配置access口
int e0/0/2
port link-type access
port default vlan 10
int e0/0/3
port link-type access
port default vlan 20
SW3
#进入视图
sys
sysn sw2
undo info-center enable
#配置vlan
vlan batch 10 20 30 40 50 60
#配置trunk口
int e0/0/1
port link-type trunk
port trunk allow-pass vlan all
#配置access口
int e0/0/2
port link-type access
port default vlan 30
int e0/0/3
port link-type access
port default vlan 40
2. 配置OSPF和AR1、AR2的ip
SW1
ospf 1
area 0.0.0.0
network 172.16.0.0 0.0.0.255
network 172.16.10.0 0.0.0.255
network 172.16.20.0 0.0.0.255
network 172.16.30.0 0.0.0.255
network 172.16.40.0 0.0.0.255
network 172.16.88.0 0.0.0.255
AR1
#进入视图
sys
sysn AR1
undo info-center enable
#配置ip
int g0/0/0
ip address 202.2.2.254 24
int g0/0/1
ip address 202.1.1.1 24
#配置ospf协议 宣告网络
ospf 1
area 0.0.0.0
network 202.1.1.0 0.0.0.255
network 202.2.2.0 0.0.0.255
AR2
#进入视图
sys
sysn AR2
undo info-center enable
#配置ip
int g0/0/0
ip address 202.1.1.2 24
int g0/0/1
ip address 172.16.0.2 24
#配置ospf协议 宣告网络
ospf 1
area 0.0.0.0
network 172.16.0.0 0.0.0.255
network 202.1.1.0 0.0.0.255
network 172.16.10.0 0.0.0.255
network 172.16.20.0 0.0.0.255
network 172.16.30.0 0.0.0.255
network 172.16.40.0 0.0.0.255
network 172.16.88.0 0.0.0.255
#进入子接口 标记vlan 启用arp广播功能
int g0/0/1.1
dot1q termination vid 10
arp broadcast enable
int g0/0/1.2
dot1q termination vid 20
arp broadcast enable
int g0/0/1.3
dot1q termination vid 30
arp broadcast enable
int g0/0/1.4
dot1q termination vid 40
arp broadcast enable
int g0/0/1.5
dot1q termination vid 50
arp broadcast enable
3. 测试连通性
PC:
测试
感谢世间的烟火和朝夕,陪伴我在尘世里,走过一程又一程。
谢谢大家的观看!
Thank you for everything!