拓扑图如上
1. PC设置IP
PC15:192.168.10.10/24 网关:10.1
PC19:192.168.20.10/24 网关: 20.1
PC17:192.168.30.10/24 网关: 30.1
PC18:192.168.30.10/24 网关:40.1
2.配置SW6
# vlan batch 10 20
# inter face vlanif 10
ip address 192.168.10.1 24
ip address 192.168.20.1 24 sub
# inter face Ethernet 0/0/2
port link-type access
port default vlan 10
# interface Ethernet 0/0/3
port link-type access
port default vlan 10
#interface vlanif 20
ip address 192.168.60.1 24
#int g0/0/1
port link-type trunk
port trunk allow-pass vlan 20
3.配置SW7
#vlan batch 30 20
#
# inter face vlanif 30
ip address 192.168.30.1 24
ip address 192.168.40.1 24 sub
# inter face Ethernet 0/0/2
port link-type access
port default vlan 30
# interface Ethernet 0/0/3
port link-type access
port default vlan 30
#interface vlanif 20
ip address 192.168.60.2 24
#int g0/0/1
port link-type trunk
port trunk allow-pass vlan 20
3.配置静态路由
LSW6: ip route-static:0.0.0.0 0.0.0.0 192.168.60.2
LSW7: ip roue-static:0.0.0.0 0.0.0.0 192.168.60.1
主机互通测试成功!
没有通的可以私信我要源文件!!!!!!!!!!!