H3C S3100v2 防止客户端私设DHCP服务影响服务
交换机千兆端口1/0/25连接上级核心交换机,以其中一个端口1/0/1配置。
<S3100V2>display dhcp-snooping
DHCP Snooping is disabled. #缺省情况下,DHCP Snooping功能处于关闭状态 DHCP Snooping is enabled.
<S3100V2>system-view
[S3100V2]dhcp-snooping
[S3100V2]display dhcp-snooping DHCP Snooping is enabled.
The client binding table for all ports.
Type : D–Dynamic , S–Static , R–Recovering
Type IP Address MAC Address Lease VLAN SVLAN Interface
=======================================================================
— 0 dhcp-snooping item(s) found —
[S3100V2]interface GigabitEthernet 1/0/25 #此接口为连接DHCP服务器的接口
[S3100V2-GigabitEthernet1/0/25]dhcp-snooping trust #在使能DHCP Snooping功能后,设备的所有端口均为不信任端口
[S3100V2-GigabitEthernet1/0/25]quit
<S3100V2>display dhcp-snooping trust
DHCP Snooping is enabled.
DHCP Snooping trust becomes active.
Interface Trusted
========================= ============
GigabitEthernet1/0/25 Trusted
# 显示DHCP Snooping设备上的DHCP报文统计信息。 <Sysname> display dhcp-snooping packet statistics
DHCP packets received : 100接收的DHCP报文数 DHCP packets sent : 200发送的DHCP报文数
Packets dropped due to rate limitation : 20由于报文限速丢弃的报文数 Dropped invalid packets : 0丢弃的无效报文数
[S3100V2]interface Ethernet 1/0/1
[S3100V2-Ethernet1/0/1]dhcp-snooping check mac-address
使能DHCP Snooping的MAC地址检查功能,防止饿死攻击。
[S3100V2-Ethernet1/0/1]dhcp-snooping check request-message
使能DHCP Snooping的DHCP Request报文检查功能,防止伪造DHCP续约攻击报文。
# 配置以太网端口Ethernet1/0/1最多学习到的地址的数目为20。 [Sysname-Ethernet1/0/1] mac-address max-mac-count 20
如果要取消:[Sysname-Ethernet1/0/1] undo mac-address max-mac-count #取消学习数目
备份DHCH Snooping表
[S3100V2]dhcp-snooping binding database filename dhcpbak.
缺省情况下,未指定存储文件名称执行本命令后,会立即触发一次表项备份。
[S3100V2]dhcp-snooping binding database update interval 14400 #分钟定期刷新DHCP Snooping表项存储文件
评论已关闭!