IP 源防护(IP Source Guard,简称 IPSG)
华为交换机配置文件
Switch的配置文件
#
sysname Switch
#创建Host_1和Host_2的静态绑定表项
user-bind static ip-address 10.0.0.1 mac-address xxxx-xxxx-xxx1
user-bind static ip-address 10.0.0.11 mac-address xxxx-xxxx-xxx2
#使能IPSG并设置丢弃报文上报告警功能
#在连接GE1/0/1接口使能IPSG和IP报文检查告警功能,当丢弃报文阈值到达200将上报告警。
interface GigabitEthernet1/0/1
ipv4 source check user-bind enable
ipv6 source check user-bind enable
ip source check user-bind alarm enable
ip source check user-bind alarm threshold 200
#在连接GE1/0/2接口使能IPSG和IP报文检查告警功能,当丢弃报文阈值到达200将上报告警。
interface GigabitEthernet1/0/2
ipv4 source check user-bind enable
ipv6 source check user-bind enable
ip source check user-bind alarm enable
ip source check user-bind alarm threshold 200
#
验证配置结果
在Switch上执行display dhcp static user-bind all命令,可以查看静态绑定表信息。
[Switch] display dhcp static user-bind all
DHCP static Bind-table:
Flags:O - outer vlan ,I - inner vlan ,P - Vlan-mapping
IP Address MAC Address VSI/VLAN(O/I/P) Interface
--------------------------------------------------------------------------------
10.0.0.1 xxxx-xxxx-xxx1 -- /-- /-- --
10.0.0.11 xxxx-xxxx-xxx2 -- /-- /-- --
--------------------------------------------------------------------------------
Print count: 2 Total count: 2
使用管理员分配的固定IP地址可以正常访问网络,更改IP地址后无法访问网络。