一. 网关在核心上【192.168.1.10 192.168.2.20 192.168.2.20】
二. 接入写默认路由,作为带内管理
三. 交换机没有写路由话终端可以ping通1,2,3网段地址,终端之间也可以通信
SW4 system-view # vlan batch 10 20 30 # interface Vlanif 10 ip address 192.168.1.10 24 # quit # interface Vlanif 20 ip address 192.168.2.20 24 # quit # interface Vlanif 30 ip address 192.168.3.30 24 # quit # interface GigabitEthernet0/0/22 port link-type trunk port trunk allow-pass vlan all # interface GigabitEthernet0/0/23 port link-type trunk port trunk allow-pass vlan all # interface GigabitEthernet0/0/24 port link-type trunk port trunk allow-pass vlan all # quit # save force |
SW5 system-view # vlan batch 10 # interface Vlanif 10 ip address 192.168.1.11 24 # interface GigabitEthernet0/0/1 port link-type access port default vlan 10 # interface GigabitEthernet0/0/2 port link-type access port default vlan 10 # interface GigabitEthernet0/0/22 port link-type trunk port trunk allow-pass vlan all # quit # save force |
SW6 system-view # vlan batch 20 # interface Vlanif 20 ip address 192.168.2.21 24 # interface GigabitEthernet0/0/1 port link-type access port default vlan 20 # interface GigabitEthernet0/0/23 port link-type trunk port trunk allow-pass vlan all # quit # save force |
SW7 system-view # vlan batch 30 # interface Vlanif 30 ip address 192.168.3.31 24 # interface GigabitEthernet0/0/1 port link-type access port default vlan 30 # interface GigabitEthernet0/0/24 port link-type trunk port trunk allow-pass vlan all # quit # save force |