H3C S3100-SI系列交换机利用DHCP Snooping防止内网私自接入DHCPServer

H3C3100SI系列交换机因默认端口信任特性,无法直接通过DHCPSnooping屏蔽非法DHCP服务器。通过启用DHCP防伪冒功能并设置端口为不信任及shutdown策略,可有效检测和阻止非法DHCP服务器。

H3C 3100 SI系列的交换机与其他高端系列相比,功能方面相对弱了很多,而DHCP Snooping 功能支持也有差异。

正常情况下,设备启用了DHCP Snooping之后,所有端口都属于不受信任端口,我们可以将直接或者间接连接至DHCPSnooping的端口通过 "dhcp-snooping trust"命令设置为信任端口,其他端口则默认属于不受信任端口,这样就可以通过dhcp ack和dhcp offer 包来屏蔽掉非法的dhcp server.

而3100 SI系列启用dhcp snooping后,默认所有端口都是可信任端口。 这样就导致了单纯启用dhcp snooping 起不到屏蔽非法dhcp server的作用。

因此 3100 SI系列交换机多了一项DHCP防伪冒功能,这个功能的原理就是交换机会从启用防伪冒功能的端口向外发送DHCP-DISCOVER报文,用于探测连接到该端口的DHCP服务器,如果接收到回应报文DHCP-OFFER报文,则认为该端口连接了仿冒的DHCP服务器,交换机会根据配置的处理策略进行处理,通常可以配置的策略为trap和shutdown。

配置非常简单:

#全局启用dhcp snooping:
[6FB-S3100-57]dhcp-snooping
#在直接连接dhcp 客户端的端口上启用防伪冒功能和处理策略
[6FB-S3100-57-Ethernet1/0/33]dhcp-snooping server-guard enable

[6FB-S3100-57-Ethernet1/0/33]dhcp-snooping server-guard method shutdown

当对应端口接入非法dhcp server 后,交换机会自动将端口管理型shutdown.
看一下日志:

2018-05-10 14:01:55 Local7.Alert    172.16.1.57 May 10 14:01:55 2018 6FB-S3100-57 %%10DHCP-SNP/2/DHCPSNOOPING SERVER GUARD(t):- 1 -  Trap 1.3.6.1.4.1.2011.10.2.36.2.0.1(h3cDhcpSnoopSpoofServerDetected): portIndex 4227882 detect DHCP server in VLAN 4 MAC is 1c.39.47.c6.a8.a2 IP is 172.16.4.21  
2018-05-10 14:01:55 Local7.Warning  172.16.1.57 May 10 14:01:55 2018 6FB-S3100-57 %%10DHCP-SNP/5/dhcp-snooping server guard(l):- 1 -   Port 33 detect DHCP server in VLAN 4 MAC is 1c39-47c6-a8a2 IP is 172.16.4.21   
2018-05-10 14:01:56 Local7.Alert    172.16.1.57 May 10 14:01:56 2018 6FB-S3100-57 %%10L2INF/2/PORT LINK STATUS CHANGE(t):- 1 -  Trap 1.3.6.1.6.3.1.1.5.3(linkDown): portIndex is 4227882, ifAdminStatus is 2, ifOperStatus is 2 
2018-05-10 14:01:56 Local7.Warning  172.16.1.57 May 10 14:01:56 2018 6FB-S3100-57 %%10L2INF/5/PORT LINK STATUS CHANGE(l):- 1 -  Ethernet1/0/33 is DOWN  

这样我们可以通过监控平台监控交换机的端口管理状态(正常为1,管理性关闭变为2)即可及时知道哪些端口介入了非法DHCP Server,如下图示

H3C S3100-SI系列交换机利用DHCP Snooping防止内网私自接入DHCPServer

解决IP地址冲突的完美方法--DHCP SNOOPING 使用的方法是采用DHCP方式为用户分配IP,然后限定这些用户只能使用动态IP的方式,如果改成静态IP的方式则不能连接上网络;也就是使用了DHCP SNOOPING功能。 例子: version 12.1 no service pad service timestamps debug uptime service timestamps log uptime no service password-encryption service compress-config ! hostname C4-2_4506 ! enable password xxxxxxx! clock timezone GMT 8 ip subnet-zero no ip domain-lookup ! ip dhcp snooping vlan 180-181 // 对哪些VLAN 进行限制 ip dhcp snooping ip arp inspection vlan 180-181 ip arp inspection validate src-mac dst-mac ip errdisable recovery cause udld errdisable recovery cause bpduguard errdisable recovery cause security-violation errdisable recovery cause channel-misconfig errdisable recovery cause pagp-flap errdisable recovery cause dtp-flap errdisable recovery cause link-flap errdisable recovery cause l2ptguard errdisable recovery cause psecure-violation errdisable recovery cause gbic-invalid errdisable recovery cause dhcp-rate-limit errdisable recovery cause unicast-flood errdisable recovery cause vmps errdisable recovery cause arp-inspection errdisable recovery interval 30 spanning-tree extend system-id ! ! interface GigabitEthernet2/1 // 对该端口接入的用户进行限制,可以下联交换机 ip arp inspection limit rate 100 arp timeout 2 ip dhcp snooping limit rate 100 ! interface GigabitEthernet2/2 ip arp inspection limit rate 100 arp timeout 2 ip dhcp snooping limit rate 100 ! interface GigabitEthernet2/3 ip arp inspection limit rate 100 arp timeout 2 ip dhcp snooping limit rate 100 ! interface GigabitEthernet2/4 ip arp inspection limit rate 100 arp timeout 2 ip dhcp snooping limit rate 100 --More-- 编者注:对不需要明确地址的所有人的时候是一个很好的解决办法。另外,可以查看www.cisco.com的 IP Source Guard Similar to DHCP snooping, this feature is enabled on a DHCP snooping untrusted Layer 2 port. Initially, all IP traffic on the port is blocked except for DHCP packets that are captured by the DHCP snooping process. When a client receives a valid IP address from the DHCP server, or when a static IP source binding is configured by the user, a per-port and VLAN Access Control List (PACL) is installed on the port. This process restricts the client IP traffic to those source IP addresses configured in the binding; any IP traffic with a source IP address other than that in the IP source binding will be filtered out. This filtering limits a host's ability to attack the network by claiming neighbor host's IP address.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值