代码:
对LSW1:
Vlan 10
Interface ethernet 0/0/1
Port link-type access
Port default vlan 10
Interface ethernet 0/0/2
Port link-type access
Port default vlan 10
Vlan 20
Interface ethernet 0/0/3
Port link-type access
Port default vlan 20
Interface ethernet 0/0/4
Port link-type access
Port default vlan 20
Interface GigabitEther 0/0/2
Port link-type trunk
Port trunk allow-pass vlan 10 20
对LSW2:
Vlan 10
Interface ethernet 0/0/1
Port link-type access
Port default vlan 10
Interface ethernet 0/0/2
Port link-type access
Port default vlan 10
Vlan 20
Interface ethernet 0/0/3
Port link-type access
Port default vlan 20
Interface ethernet 0/0/4
Port link-type access
Port default vlan 20
Internet GigabitEther 0/0/2
Port link-type trunk
Port trunk allow-pass vlan 10 20
对LSW4:
Interface GigabitEthernet 0/0/1
Port link-type trunk
Port trunk allow-pass vlan 10 20
Interface GigabitEthernet 0/0/2
Port link-type trunk
Port trunk allow-pass vlan 10 20
Int vlanif 10
Ip address 192.168.10.254(注释:这里写vlan 10的网关) 255.255.255.0
Vlan 20
Int vlanif 20
Ip address 192.168.20.254.( 这里写vlan 20的网关)24