华为交换机user-bind IPSG实机配置

华为交换机user-bind 绑定IP、MAC、VLAN安全接入


绑定IP、MAC、VLAN安全接入)

user-bind static与 arp static 的区别

一、原理区别:
1、arp static 是用于做arp表的静态持久化,在ARP表项匹配时生效
2、user-bind static 是用于在数据包进入时进行筛选过滤,在入向接口匹配生效。属于IPSG应用

二、绑定生效规则:
arp static 类似黑名单制
1、IP及MAC均匹配正确 规则生效,放通。
2、IP-MAC无匹配(IP及MAC均无匹配)规则无效,底层放通。
3、IP或MAC有其中一方匹配上,另一方匹配错误,即规则生效,拦截。

user-bind static 类似白名单制(结合vlan或端口中使用 ip source check user-bind enable 进行IPSG检查)
1、IP及MAC均匹配正确 规则生效,放通。
2、IP-MAC无匹配(IP及MAC均无匹配)规则生效,拦截。
3、IP或MAC有其中一方匹配上,另一方匹配错误,即规则生效,拦截。

三、使用前提
1、arp static 直接作用于全局,无需借助其它功能做铺垫
2、user-bind static 必须结合ip source check user-bind enable 进行IPSG的检查部署。并且可以通过 dhcp snooping trusted 的方式来放通接口信任

user-bind static 的应用

在这里插入图片描述

SW1:

[SW1]vlan batch 100 200 300
[SW1]interface Vlanif 100
[SW1-Vlanif100]ip address 192.168.1.1 24
[SW1]interface Vlanif 200
[SW1-Vlanif200]ip address 192.168.2.1 24
[SW1]interface Vlanif 300
[SW1-Vlanif300]ip address 192.168.3.1 24
[SW1]interface GigabitEthernet 0/0/3
[SW1-GigabitEthernet0/0/3]port link-type access
[SW1-GigabitEthernet0/0/3]port default vlan 300
[SW1]interface GigabitEthernet 0/0/5
[SW1-GigabitEthernet0/0/5]port link-type access
[SW1-GigabitEthernet0/0/5]port default vlan 200
[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 100
[SW1]interface Eth-Trunk 0
[SW1-Eth-Trunk0]port link-type trunk
[SW1-Eth-Trunk0]port trunk allow-pass vlan 100 200 300
[SW1-Eth-Trunk0]trunkport GigabitEthernet 0/0/1
[SW1-Eth-Trunk0]trunkport GigabitEthernet 0/0/4
[SW1]dhcp enable
[SW1]dhcp snooping enable
[SW1]user-bind static ip-address 192.168.1.10 mac-address 5489-989A-2605 vlan 100 #绑定IP-MAC 到VLAN100
[SW1]user-bind static ip-address 192.168.2.10 mac-address 5489-980B-6D74 vlan 200 #绑定IP-MAC 到VLAN200
[SW1]user-bind static ip-address 192.168.3.10 mac-address 5489-9868-129A vlan 300 #绑定IP-MAC 到VLAN300(根据无线AP固定分配的IP与MAC进行绑定)
[SW1]vlan 100
[SW1-vlan100]ip source check user-bind enable #开启IPSG检查
[SW1-vlan100]dhcp snooping enable #开启vlan dhcp snooping 功能,防止接入错误的DHCP服务器
[SW1-vlan200]ip source check user-bind enable
[SW1-vlan200]dhcp snooping enable
[SW1-vlan300]ip source check user-bind enable
[SW1-vlan300]dhcp snooping enable
[SW1]interface Eth-Trunk 0
[SW1-Eth-Trunk0]dhcp snooping trusted #在eth-trunk上设置dhcp snooping trusted 信任,否则当数据三层转发时MAC发生翻转会导致user-bind 匹配错误

SW2:

[SW2]vlan batch 100 200 300
[SW2]interface Vlanif 100
[SW2-Vlanif100]ip address 192.168.1.2 24
[SW2]interface Vlanif 200
[SW2-Vlanif200]ip address 192.168.2.2 24
[SW2]interface Vlanif 300
[SW2-Vlanif300]ip address 192.168.3.2 24 #为方便在sw2上做本地三层转发,因此需配置一下vlan ip
[[SW2]interface GigabitEthernet 0/0/2
[SW2-GigabitEthernet0/0/2]port link-type access
[SW2-GigabitEthernet0/0/2]port default vlan 200
[SW2]interface GigabitEthernet 0/0/3
[SW2-GigabitEthernet0/0/3]port link-type access
[SW2-GigabitEthernet0/0/3]port default vlan 100
[SW2]interface Eth-Trunk 0
[SW2-Eth-Trunk0]port link-type trunk
[SW2-Eth-Trunk0]port trunk allow-pass vlan 100 200 300
[SW2-Eth-Trunk0]trunkport GigabitEthernet 0/0/1
[SW2-Eth-Trunk0]trunkport GigabitEthernet 0/0/4
[SW2]dhcp enable
[SW2]dhcp snooping enable
[SW2]user-bind static ip-address 192.168.2.20 mac-address 5489-986F-1264 vlan 200 #绑定IP-MAC 到VLAN200
[SW2]user-bind static ip-address 192.168.1.20 mac-address 5489-987A-41C0 vlan 100 #绑定IP-MAC 到VLAN100
[SW2]vlan 100
[SW2-vlan100]ip source check user-bind enable #与SW1一样开启IPSG检查
[SW2-vlan100]dhcp snooping enable #与SW1一样开启vlan dhcp snooping 功能,防止接入错误的DHCP服务器
[SW2-vlan200]ip source check user-bind enable
[SW2-vlan200]dhcp snooping enable
[SW2-vlan300]ip source check user-bind enable
[SW2-vlan300]dhcp snooping enable
[SW2]interface Eth-Trunk 0
[SW2-Eth-Trunk0]dhcp snooping trusted #与SW1一样在eth-trunk上设置dhcp snooping trusted 信任,否则当数据三层转发时MAC发生翻转会导致user-bind 匹配错误

以上是eth-trunk 的绑定方式,trunk类型 在接口上直接应用 dhcp snooping trusted 即可

注意事项

ENSP虽能进行配置,但IPSG不生效。以上方案是在实机上验证配置的

  • 6
    点赞
  • 69
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值