【基于MAC地址的vlan】

vlan 5

mac-vlan mac-address 5489-983e-251f priority 0

mac-vlan mac-address 5489-98c6-337e priority 0

 

 

interface GigabitEthernet0/0/1

port hybrid untagged vlan 5

mac-vlan enable

#

interface GigabitEthernet0/0/2

port hybrid untagged vlan 5

mac-vlan enable

 

 

 

 

【基于 IP地址的vlan】

 

SW1的配置

vlan 6

ip-subnet-vlan 1 ip 192.168.1.3 255.255.255.255

ip-subnet-vlan 2 ip 192.168.1.4 255.255.255.255

 

 

interface GigabitEthernet0/0/3

port hybrid untagged vlan 2 to 4094

mac-vlan enable

ip-subnet-vlan enable

#

interface GigabitEthernet0/0/4

port hybrid untagged vlan 2 to 4094 //一种偷懒的配置方法

mac-vlan enable

ip-subnet-vlan enable

 

 

interface GigabitEthernet0/0/5

port link-type trunk

port trunk allow-pass vlan 2 to 4094 //设置上联端口

 

 

 

SW2的配置

vlan 6

ip-subnet-vlan 2 ip 192.168.1.5 255.255.255.255

#

 

 

 

interface GigabitEthernet0/0/1

port hybrid untagged vlan 6

ip-subnet-vlan enable //开启IP-subnet-vlan 功能

 

 

interface GigabitEthernet0/0/5

port link-type trunk

port trunk allow-pass vlan 2 to 4094 //设置上联端口

 

版权声明:本文为yy50567893原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/yy50567893/p/13569019.html