限制用户使用静态IP,只能通过DHCP获取地址的方法
L3(dhcp server/93 1/0/0)------(0/0/3)L2(33 0/0/1口)-----pc(4487-fc43-2dea)
需求:要求L3作dhcp server,仅为某一些mac分配固定的ip,其他未明示的mac不允许获得ip,同时已经明示的mac只能使用指定的ip,不能私自修改ip.
1、在dhcp server组里做静态的ip和mac绑定,使ip分配正确。
2、在dhcp server全局再单独做ip和mac的静态表,并在接口开启ip check/arp check,使用户私改ip无法上网,同时也不会产生arp冲突。
3、在L2上作静态表,只写mac,然后在接口开启ip检查,或者在vlan开启ip检查.
L2配置:
!Software Version V100R005C01SPC100
sysnameQuidway
#
vlan batch 10
#
user-bind static mac-address 4487-fc43-2dea--------允许pc mac通过,不能写ip,因为dhcp discover交互的报文没有ip。
user-bind static mac-address 0018-82b3-c6ff--------允许服务器的mac。
#
undo http server enable
#
drop illegal-mac alarm
#
vlan 10
ip source check user-bind enable-------------------在vlan里开启ip检查。
ip sour
#
L3配置:
[Quidway]dis cu
#
!Software Version V100R003C00SPC200
sysnameQuidway
#
vlan batch 1 6 10 20
#
dhcp enable
user-bind static ip-address 1.1.1.2 mac-address 4487-fc43-2dea------配置静态绑定表,为接口安全使用。
#
interface Vlanif10
ip address 1.1.1.1 255.255.255.0
dhcp select interface
dhcp server static-bind ip-address 1.1.1.2 mac-address 4487-fc43-2dea-----配置dhcp静态绑定表,为dhcp精确分配ip使用,支持多条。
#
interface GigabitEthernet1/0/0
port link-type trunk
port trunk allow-pass vlan 10
arp anti-attack check user-bind enable--------------------------------开启arp检查,避免用户误配ip后产生ip冲突。
ip source check user-bind enable--------------------------------------开启ip检查,防止非法用户接入。
combo-port copper
port-group 1
group-member GigabitEthernet 0/0/1 to g0/0/2
user-bind ip sticky-mac
dhcp snooping check dhcp-request enable
quit
arp dhcp-snooping-detect enable
stp bpdu-protection
error-down auto-recovery cause bpdu-protection interval 30
quit
save
你全局要开启DHCP ENABLE
DHCP SNOOPING ENABLE。