ENSP配置 实例一 不同VLAN间通信
SW1
[SW1]vlan batch 10 20
[SW1]interface g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1-GigabitEthernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 20
[SW1-GigabitEthernet0/0/1]int g0/0/3
[SW1-GigabitEthernet0/0/3]port link-type trunk
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan all
SW2
[SW2]vlan b 10 20
[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1]p l a
[SW2-GigabitEthernet0/0/1]p d v 10
[SW2-GigabitEthernet0/0/1]int g0/0/2
[SW2-GigabitEthernet0/0/2]p l a
[SW2-GigabitEthernet0/0/2]p d v 20
[SW2-GigabitEthernet0/0/2]int g0/0/3
[SW2-GigabitEthernet0/0/3]p l t
[SW2-GigabitEthernet0/0/3]p t a vlan all
在SW1上设置网关
[SW1]int vlan 10
[SW1-Vlanif10]ip add 192.168.1.254 24
[SW1-Vlanif10]int vlan 20
[SW1-Vlanif20]ip add 192.168.2.254 24
拓展:不同vlan之间通信
vlan是二层中不能互相通信的,所以我们要经过三层才能相互通信。
vlan设置IP就像是虚拟端口设置IP