1.SW1配置VLAN
[SW1]vlan batch 10 30
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 10
[SW1]interface GigabitEthernet 0/0/24
[SW1-GigabitEthernet0/0/24]port link-type trunk
[SW1-GigabitEthernet0/0/24]port trunk allow-pass vlan all
[SW1]interface Vlanif 10
[SW1-Vlanif10]IP address 192.168.10.254 24
[SW1]interface Vlanif 30
[SW1-Vlanif30]ip address 192.168.30.254 24
2.SW2配置VLAN
[SW2]vlan batch 20 30
[SW2]interface GigabitEthernet 0/0/1
[SW2-GigabitEthernet0/0/1]port link-type access
[SW2-GigabitEthernet0/0/1]port default vlan 20
[SW2]interface GigabitEthernet 0/0/2
[SW2-GigabitEthernet0/0/2]port link-type access
[SW2-GigabitEthernet0/0/2]port default vlan 20
[SW2]interface GigabitEthernet 0/0/24
[SW2-GigabitEthernet0/0/24]port trunk allow-pass vlan all
[SW2]interface Vlanif 20
[SW2-Vlanif20]ip address 192.168.20.254 24
[SW2]interface Vlanif 30
[SW2-Vlanif30]ip address 192.168.30.253 24
3.SW1、SW2配置静态路由
[SW1]ip route-static 192.168.20.0 24 192.168.30.253
[SW2]ip route-static 192.168.10.0 24 192.168.30.254
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容