S3900 Series Switches DHCP-Snooping Configuration
S3900 Series Switches DHCP-Snooping Configuration
S3900 Series Switches DHCP-Snooping Configuration
11
www.fs.com
S3900 SERIES SWITCHES DHCP-SNOOPING CONFIGURATION
Contents
1 DHCP-Snooping Configuration.............................................................................................................................1
1.1.9 Setting an Interface to the One Which is Trusted by IP Source Address Monitoring............................................. 4
www.fs.com
S3900 SERIES SWITCHES DHCP-SNOOPING CONFIGURATION
2. 1 DHCP-Snooping Configuration
DHCP-Snooping is to prevent the fake DHCP server from providing the DHCP service by judging the DHCP
packets, maintaining the binding relationship between MAC address and IP address. The L2 switch can conduct
the DAI function and the IP source guard function according to the binding relationship between MAC address
and IP address. The DHCP-snooping is mainly to monitor the DHCP packets and dynamically maintain the MAC-IP
binding list. The L2 switch filters the packets, which do not meet the MAC-IP binding relationship, to prevent the
network attack from illegal users.
Command Purpose
This command is used to enable DHCP snooping in global configuration mode. After this command is run, the
switch is to monitor all DHCP packets and form the corresponding binding relationship.
NOTE:
If the client obtains the address of a switch before this command is run, the switch cannot add the corresponding
binding relationship.
If DHCP snooping is enabled in a VLAN, the DHCP packets which are received from all distrusted physical ports in
a VLAN will be legally checked. The DHCP response packets which are received from distrusted physical ports in
a VLAN will then be dropped, preventing the faked or mis-configured DHCP server from providing address
distribution services. For the DHCP request packet from distrusted ports, if the hardware address field in the
DHCP request packet does not match the MAC address of this packet, the DHCP request packet is then thought as
www.fs.com 1
S3900 SERIES SWITCHES DHCP-SNOOPING CONFIGURATION
a fake packet which is used as the attack packet for DHCP DOS and then the switch will drop it.
Command Purpose
To enable attack prevention in a VLAN, you need to configure the allowable maximum DHCP clients in a specific
VLAN and conduct the principle of “first come and first serve”. When the number of users in the specific VLAN
reaches the maximum number, new clients are not allowed to be distributed.
Command Purpose
If an interface is set to be a DHCP-trusting interface, the DHCP packets received from this interface will not be
checked.
Command Operation
This function is disabled by default. When this function is disabled and a port has been bound to client A, the
DHCP request of the same MAC address on other ports will be regarded as a fake MAC attack even if client A is off
line.
When this function is enabled, the above-mentioned case will not occur.
It is recommended to use this function in case that a client frequently changes its port and address lease,
distributed by DHCP server, cannot be modified to a short period of time.
www.fs.com 2
S3900 SERIES SWITCHES DHCP-SNOOPING CONFIGURATION
Command Operation
ip dhcp-relay snooping Enables the fast update function of the binding table.
rapid-refresh-bind
no ip dhcp-relay snooping Disables the fast update function of the binding table.
rapid-refresh-bind
When dynamic ARP monitoring is conducted in all physical ports of a VLAN, a received ARP packet will be
rejected if the source MAC address and the source IP address of this packet do not match up with the configured
MAC-IP binding relationship. The binding relationship on an interface can be dynamically bound by DHCP or
configured manually. If no MAC addresses are bound to IP addresses on a physical interface, the switch rejects
forwarding all ARP packets.
Command Operation
ip arp inspection vlan vlanid Enables dynamic ARP monitoring on all distrusted ports in a
VLAN.
no ip arp inspection vlan vlanid Disables dynamic ARP monitoring on all distrusted ports in a
VLAN.
ARP monitoring is not enabled on those trusted interfaces. The interfaces are distrusted ones by default.
Command Operation
After source IP address monitoring is enabled in a VLAN, IP packets received from all physical ports in the VLAN
will be rejected if their source MAC addresses and source IP addresses do not match up with the configured
MAC-to-IP binding relationship. The binding relationship on an interface can be dynamically bound by DHCP or
configured manually. If no MAC addresses are bound to IP addresses on a physical interface, the switch rejects
forwarding all IP packets received from the physical interface.
Command Operation
ip verify source vlan vlanid Enables source IP address checkup on all distrusted
interfaces in a VLAN.
www.fs.com 3
S3900 SERIES SWITCHES DHCP-SNOOPING CONFIGURATION
no ip verify source vlan vlanid Disables source IP address checkup on all interfaces in a
VLAN.
NOTE:
If the DHCP packet (also the IP packet) is received, it will be forwarded because global snooping is configured.
1.1.9 Setting an Interface to the One Which is Trusted by IP Source Address Monitoring
The source address detection function will not be enabled for the IP source address trust interface.
Run the following commands in interface configuration mode.
Command Operation
Option 82 brings the local information to a server and helps the server to distribute addresses to clients.
Run the following commands in global configuration mode.
Command Operation
To specify the format of option82, conduct the following settings in global mode.
Command Operation
ip dhcp-relay snooping Sets the format of option82 that the DHCP packets carry
information option format when they are forwarded by DHCP-Snooping.
{snmp-ifindex/manual/hn-type /
cm-type/ [host]/hw-type}
If a manual mode is set to enter in option82, conduct the following configurations in interface mode to set the
circuit-id:
Command Operation
dhcp snooping information If option82 is set to be in the manual format, you need to
circuit-id string [STRING] set DHCP-snooping to forward DHCP packets with
bearing of option82, whose content is the character string
written by STRING. This command is set on the port that
www.fs.com 4
S3900 SERIES SWITCHES DHCP-SNOOPING CONFIGURATION
dhcp snooping information If option82 is set to be in the manual format, you need to
circuit-id hex set DHCP-snooping to forward DHCP packets with
[xx-xx-xx-xx-xx-xx] bearing of option82, whose content is the Hex system..
This command is set on the port that connects the client.
If a manual mode is set to enter in option82, conduct the following configurations in interface mode to set the
remote-id:
Command Operation
dhcp snooping information If option82 is set to be in the manual format, you need to
remote-id string [STRING] set DHCP-snooping to forward DHCP packets with
bearing of option82, whose content is the character string
written by STRING. This command is set on the port that
connects the client.
dhcp snooping information If option82 is set to be in the manual format, you need to
remote-id hex set DHCP-snooping to forward DHCP packets with
[xx-xx-xx-xx-xx-xx] bearing of option82, whose content is the Hex system..
This command is set on the port that connects the client.
If a manual mode is set to enter in option82, conduct the following configurations in interface mode to set the
vendor-specific:
Command Operation
dhcp snooping information If option82 is set to be in the manual format, you need to
vendor-specific string STRING set DHCP-snooping to forward DHCP packets with
bearing of option82, whose content is the character string
written by STRING. This command is set on the port that
connects the client.
dhcp snooping information If option82 is set to be in the manual format, you need to
vendor-specific hex set DHCP-snooping to forward DHCP packets with
[xx-xx-xx-xx-xx-xx] bearing of option82, whose content is the Hex system..
This command is set on the port that connects the client.
You can set the policy for the DHCP request packets, which carry with option82, after these packets are received.
The policies include the following ones:
“Drop” policy: Run the following command in port mode to drop the request packets with option82.
Command Operation
www.fs.com 5
S3900 SERIES SWITCHES DHCP-SNOOPING CONFIGURATION
dhcp snooping information Drops the request packets that contain option82.
drop
“Append” policy: Run the following command in port mode to add the request packets with option82.
Command Operation
dhcp snooping information Stands for the first parameter carried by option82
append first-subop9-param vendor-specific (suboption9).
{ hex xx-xx-xx-xx-xx-xx | vlanip |
hostname }
dhcp snooping information Stands for the second parameter carried by option82
append second-subop9-param vendor-specific (suboption9).
{ hex xx-xx-xx-xx-xx-xx | vlanip |
hostname }
After the switch configuration is rebooted, the previously-configured interface binding will be lost. In this case,
there is no binding relationship on this interface. After source IP address monitoring is enabled, the switch
rejected forwarding all IP packets. After the TFTP server is configured for interface binding backup, the binding
relationship will be backed up to the server through the TFTP protocol. After the switch is restarted, the switch
automatically downloads the binding list from the TFTP server, securing the normal running of the network.
Run the following commands in global configuration mode.
Command Operation
When backing up the interface binding relationship, the corresponding file name will be saved on the TFTP server.
In this way, different switches can back up their own interface binding relationships to the same TFTP server.
Run the following commands in global configuration mode.
By default IGMP-snooping sensitive is disabled.
Command Operation
ip dhcp-relay snooping db-file Configures a file name for interface binding backup.
name [timestamp]
www.fs.com 6
S3900 SERIES SWITCHES DHCP-SNOOPING CONFIGURATION
The MAC-to-IP binding relationship on an interface changes dynamically. Hence, you need check whether the
binding relationship updates after a certain interval. If the binding relationship updates (adds or deletes binding
entries), it need be backed up again. The default time interval is 30mins.
Run the following commands in global configuration mode.
Command Operation
If a host does not obtain the address through DHCP, you can add the binding item on an interface of a switch to
enable the host to access the network. You can run no ip source binding MAC IP to delete items from the
corresponding binding list.
Note that the manually-configured binding items have higher priority than the dynamically-configured binding
items. If the manually-configured binding item and the dynamically-configured binding item have the same MAC
address, the manually-configured one updates the dynamically-configured one. The interface binding item takes
the MAC address as the unique index.
Run the following commands in global configuration mode.
Command Operation
Command Operation
show ip dhcp-relay snooping binding Displays the effective address binding items
on an interface.
www.fs.com 7
S3900 SERIES SWITCHES DHCP-SNOOPING CONFIGURATION
show ip dhcp-relay snooping binding all Displays all binding items which are
generated by DHCP snooping.
The following shows the information about the DHCP snooping configuration.
GigaEthernet0/1
GigaEthernet0/11
The following shows how to debug the information about dhcp-relay snooping.
www.fs.com 8
S3900 SERIES SWITCHES DHCP-SNOOPING CONFIGURATION
Configuring Switch
Sets the interface which connects the DHCP server to a DHCP-trusting interface.
www.fs.com 9
S3900 SERIES SWITCHES DHCP-SNOOPING CONFIGURATION
!
ip dhcp-relay snooping
ip dhcp-relay snooping vlan 1-100
ip arp inspection vlan 1
ip verify source vlan 1
ip dhcp-relay snooping information option fo
www.fs.com 10
S3910 SERIES SWITCHES DATASHEET
www.fs.com 10