华为交换机配置IPSG防止主机私自更改IP地址示例教程

最近网络中总有人私自乱接路由器,乱设置IP导致网路总是不稳定,每次都要排查很长时间。经过配置交换机的IPSG功能,将各端口配置指定IP,就成功的解决的此类问题的发生。示例教程如下:

配置IPSG防止主机私自更改IP地址(静态绑定)组网图

 

一、组网需求

如上图所示,Host通过Switch接入网络,Gateway为企业出口网关,各Host均使用静态配置的IP地址。管理员希望Host使用管理员分配的固定IP地址上网,不允许私自更改IP地址非法获取网络访问权限。

二、配置思路

采用如下的思路在Switch上配置IPSG功能,实现上述需求。

  1. Switch上配置Host_1和Host_2的静态绑定表,固定IP和MAC的绑定关系。
  2. Switch连接用户主机的接口使能IPSG,实现Host只能使用管理员分配的固定IP地址上网。同时,在接口开启IP报文检查告警功能,当交换机丢弃非法上网用户的报文达到阈值后上报告警。

三、操作步骤

  1. 创建Host_1和Host_2的静态绑定表项
    <HUAWEI> system-view
    [HUAWEI] sysname Switch
    [Switch] user-bind static ip-address 10.0.0.1 mac-address xxxx-xxxx-xxx1
    [Switch] user-bind static ip-address 10.0.0.11 mac-address xxxx-xxxx-xxx2
  2. 使能IPSG并设置丢弃报文上报告警功能# 在连接Host_1的GE0/0/1接口使能IPSG和IP报文检查告警功能,当丢弃报文阈值到达200将上报告警。
    [Switch] interface gigabitethernet 0/0/1
    [Switch-GigabitEthernet0/0/1] ip source check user-bind enable
    [Switch-GigabitEthernet0/0/1] ip source check user-bind alarm enable
    [Switch-GigabitEthernet0/0/1] ip source check user-bind alarm threshold 200
    [Switch-GigabitEthernet0/0/1] quit

    # 在连接Host_2的GE0/0/2接口使能IPSG和IP报文检查告警功能,当丢弃报文阈值到达200将上报告警。

    [Switch] interface gigabitethernet 0/0/2
    [Switch-GigabitEthernet0/0/2] ip source check user-bind enable
    [Switch-GigabitEthernet0/0/2] ip source check user-bind alarm enable
    [Switch-GigabitEthernet0/0/2] ip source check user-bind alarm threshold 200
    [Switch-GigabitEthernet0/0/2] quit
  3. 验证配置结果在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

    Host_1和Host_2使用管理员分配的固定IP地址可以正常访问网络,更改IP地址后无法访问网络。

四、配置文件

Switch的配置文件

#
sysname Switch
#
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
#
interface GigabitEthernet0/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
#
interface GigabitEthernet0/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
#
return
●本文来源互联网及网友投稿,如有侵权请及时联系本站进行删除。
●转载原创文章请保留地址及版权信息,否则侵权必究。
●分享目的仅供大家学习和交流,请不要用于商业用途。
●该资源版权归原著作者所有,请于下载后24小时内删除。
●如有链接无法下载、失效或广告,请联系右侧点击QQ咨询处理。
●本站资源售价只是赞助,收取费用仅维持本站的日常运营所需。
●如遇到加密压缩包,默认解压密码为"fdeer.com",如遇到无法解压的请联系管理员。

飞鹿日志 » 华为交换机配置IPSG防止主机私自更改IP地址示例教程