12.2.2 Basic Settings
This subsection describes the basic configuration for using DHCP snooping.
Before you use DHCP snooping, you need to use the flow detection mode configuration command to set the applicable receiving side flow detection mode.
The following figure shows an example of a basic configuration for DHCP snooping.
|
- <Structure of this section>
(1) Enable DHCP snooping
- Points to note
-
Enable DHCP snooping on the entire switch and specifies the VLAN where DHCP snooping needs to be enabled.
Command examples
-
(config)# ip dhcp snooping
Enables DHCP snooping on the entire switch.
-
(config)# vlan 2
(config-vlan)# exit
(config)# ip dhcp snooping vlan 2
Enables DHCP snooping on VLAN ID 2. DHCP snooping is enabled only on the VLANs that are specified by using this command.
-
(config)# interface gigabitethernet 1/0/1
(config-if)# switchport mode access
(config-if)# switchport access vlan 2
(config-if)# exit
Sets port 1/0/1 as an access port, and sets VLAN ID 2 as the VLAN containing port 1/0/1.
(2) Configuring DHCP snooping's trust
- Points to note
-
Set the port that connects to DHCP server (in "Basic Configuration of 12-10 DHCP snooping Diagram", the port that connects to the Layer 3 Switch/router) as trust port.
Command examples
-
(config)# interface gigabitethernet 1/0/5
(config-if)# ip dhcp snooping trust
(config-if)# switchport mode access
(config-if)# switchport access vlan 2
(config-if)# exit
Sets port 1/0/5 as a trusted port. Other ports are untrusted. The sequence also sets port 1/0/5 as an access port and sets VLAN ID 2 as the VLAN containing port 1/0/5.
(3) Setting the Binding Database Destination
(a) To save data to the internal flash memory
- Points to note
-
Set internal flash memory as the location for saving the binding database.
Command examples
-
(config)# ip dhcp snooping database url flash
Sets internal flash memory as the save location.
(b) To save to MC
- Points to note
-
Set an external memory card as the location for saving a binding database. If you set an external memory card, you can specify the name of the file for saving the database.
Command examples
-
(config)# ip dhcp snooping database url mc dhcpsn-db
Sets an external memory card as the save location and sets dhcpsn-db as the name of the file for saving the binding database.
- Notes
-
Before you set an external memory card as the save location, make sure a card is already inserted in the memory card slot on the Switch. In addition, use memory cards manufactured by ALAXALA.
(4) Setting the Write Latency to the Binding Database Destination
- Points to note
-
Set a delay time to be applied before a binding database is saved.
Command examples
-
(config)# ip dhcp snooping database write-delay 3600
Sets 3600 seconds as the length of time to wait after one of the following save events occurs before saving actually starts:
-
When terminal information is dynamically registered, updated, or deleted in the binding database
-
When the ip dhcp snooping database url configuration command is specified (includes a change of save location)
-
When the clear ip dhcp snooping binding operation command is executed
-
- Notes
-
The length of time set by this command becomes operationally effective from the next save event.