文章目录
基于二层交换机的vlan之间通信-(单臂路由)
交换机配置
[2S]interface e0/0/1
port link-type access #设置端口模式,默认模式是不能加入vlan的
[2S]interface e0/0/2
port link-type access
[2S]interface e0/0/3
port link-type access
[2S]interface g0/0/24
port link-type trunk
port trunk allow-pass vlan all #允许所有vlan的数据通过
[2S]vlan 100 #创建vlan
port ethernet 0/0/1
[2S]vlan 200
port ethernet 0/0/2
[2S]vlan 300
port ethernet 0/0/3
(R)路由器配置
[R]interface g0/0/0.1
dot1q termin vid 100 #开启处理标记的功能,添加和删除标记
arp broadcast enable #如果不开启,只能收不能发
ip address 192.168.10.254 255.255.255.0
[R]interface g0/0/0.2
dot1q termin vid 200
arp broadcast enable
ip address 192.168.20.254 255.255.255.0
[R]interface g0/0/0.3
dot1q termin vid 300
arp broadcast enable
ip address 192.168.30.254 255.255.255.0
基于三层交换机的vlan之间通信
[3S]interface g0/0/1
port link-type access
[3S]interface g0/0/2
port link-type access
[3S]interface g0/0/3
port link-type access
[3S]vlan 100
port g 0/0/1
[3S]vlan 200
port g 0/0/2
[3S]vlan 300
port g 0/0/3
[3S]interface vlanif 100
ip address 192.168.10.254 255.255.2550
[3S]interface vlanif 200
ip address 192.168.20.254 255.255.2550
[3S]interface vlanif 300
ip address 192.168.30.254 255.255.2550
如果文章对你有帮助,欢迎点击上方按钮打赏作者
暂无评论