华为交换机:基于ip子网(subnet)划分vlan
华为交换机:基于ip子网(subnet)划分vlan
(1)拓扑图
(2)配置基于subnet划分
sw1:
sysname sw1
#
vlan batch 5 10 12 20
#
#
vlan 10
vlan 20
#
interface Vlanif1
ip address 192.168.0.254 255.255.255.0
dhcp select interface
dhcp server excluded-ip-address 192.168.0.200 192.168.0.253
dhcp server lease unlimited
dhcp server dns-list 223.5.5.5 223.6.6.6
interface Vlanif5
ip address 192.168.5.1 255.255.255.0
interface Vlanif10
ip address 192.168.10.254 255.255.255.0
interface Vlanif12
ip address 192.168.12.254 255.255.255.0
dhcp select interface
dhcp server lease day 0 hour 0 minute 1
dhcp server dns-list 223.5.5.5 223.6.6.6
#
interface Vlanif20
ip address 192.168.20.254 255.255.255.0
#
#
interface GigabitEthernet0/0/1
port hybrid untagged vlan 10 20
ip-subnet-vlan enable
#
interface GigabitEthernet0/0/2
port hybrid untagged vlan 10 20
ip-subnet-vlan enable
interface GigabitEthernet0/0/5
port link-type trunk
port trunk allow-pass vlan 2 to 4094
sw2:
interface Vlanif5
ip address 192.168.5.2 255.255.255.0
#
interface Vlanif10
ip address 192.168.10.253 255.255.255.0
ip address 192.168.100.253 255.255.255.0 sub
#
interface Vlanif20
ip address 192.168.20.253 255.255.255.0
#
interface GigabitEthernet0/0/5
port link-type trunk
port trunk allow-pass vlan 2 to 4094
测试:不通
sw1:
vlan 10
ip-subnet-vlan 1 ip 192.168.10.0 255.255.255.0
(3)接口开启mac-vlan
sw1:
interface GigabitEthernet0/0/1
port hybrid untagged vlan 10 20
mac-vlan enable
ip-subnet-vlan enable
#
interface GigabitEthernet0/0/2
port hybrid untagged vlan 10 20
ip-subnet-vlan enable
测试前可以清除下设备的arp表或者保存配置重启后才生效。
结果:pc1 ping不通,pc2可以正常ping通。
sw1:
vlan 10
mac-vlan mac-address 5489-98b8-7070 priority 0
结果:pc1和pc2都可以ping通了。
结论:基于ip-subnet与基本地mac-vlan可以一起结合使用。
[sw1]display mac-vlan vlan 10
---------------------------------------------------
MAC Address MASK VLAN Priority
---------------------------------------------------
5489-98b8-7070 ffff-ffff-ffff 10 0
Total MAC VLAN address count: 1
[sw1]
[sw1]display ip-subnet-vlan vlan 10
----------------------------------------------------------------
Vlan Index IpAddress SubnetMask Priority
----------------------------------------------------------------
10 1 192.168.10.0 255.255.255.0 0
----------------------------------------------------------------
ip-subnet-vlan count: 1 total count: 1
[sw1]
2、本资源基本为原创,部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
3、本站大部分文章的截图来源实验测试环境,请不要在生产环境中随意模仿,以免带来灾难性后果。
转载请保留出处: www.zh-cjh.com珠海陈坚浩博客 » 华为交换机:基于ip子网(subnet)划分vlan
作者: cjh
手机扫一扫,手机上查看此文章: |
一切源于价值!
其他 模板文件不存在: ./template/plugins/comment/pc/index.htm