413
Dynamic IPv4 source guard binding by DHCP relay
configuration example
Network requirements
, the host and the DHCP server are connected to the router through the router
interfaces VLAN-interface 100 and VLAN-interface 200, respectively. DHCP relay is enabled on the
router. The host (with the MAC address of 0001-0203-0406) obtains an IP address from the DHCP
server through the DHCP relay agent.
Enable the dynamic IPv4 source guard binding function on interface VLAN-interface 100 to filter packets
based on the DHCP relay entry, allowing only packets from clients that obtain IP addresses from the
DHCP server to pass.
Figure 143
Network diagram for configuring dynamic IPv4 source guard binding by DHCP relay
Configuration procedure
1.
Configure the dynamic IPv4 source guard binding function.
# Configure IP addresses for the interfaces. (Omitted)
# Configure the dynamic IPv4 source guard binding function on VLAN-interface 100 to filter packets
based on both the source IP address and MAC address.
<Router> system-view
[Router] vlan 100
[Router-Vlan100] quit
[Router] interface vlan-interface 100
[Router-Vlan-interface100] ip check source ip-address mac-address
[Router-Vlan-interface100] quit
2.
Configure DHCP relay.
# Enable DHCP relay.
[Router] dhcp enable
# Configure the IP address of the DHCP server.
[Router] dhcp relay server-group 1 ip 10.1.1.1
# Configure VLAN-interface 100 to work in DHCP relay mode.
[Router] interface vlan-interface 100
[Router-Vlan-interface100] dhcp select relay
# Correlate VLAN-interface 100 with DHCP server group 1.
[Router-Vlan-interface100] dhcp relay server-select 1
[Router-Vlan-interface100] quit