Ip dhcp snooping settings

Source: Internet
Author: User

We have learned a lot about the network protocol, and we have come into contact with a lot of DHCP. Next we will mainly analyze the configuration of ip dhcp snooping on the cisco device. In a cisco network environment, when a device with dhcp snooping enabled is configured for a boot request, option 82 is inserted into the DHCP packet. For details, see RFC3046 ). In this case, the gateway ip address in the packet in the boot request is 0, so once the dhcp relay device detects such a packet, it will discard it.

Although dhcp snooping is used to prevent illegal dhcp server access, it plays an important role once the client obtains a valid dhcp offer. When dhcp snooping is enabled, the obtained IP address and the mac address of the client are recorded under the corresponding interface. This is a basis for ARP inspection detection by another technology. ARP inspection is used to detect arp requests and prevent invalid ARP requests. The table created in the previous dhcp snooping is the legal standard. The table is created when the dhcp server responds normally, including the correct arp information. If there is arp attack information at this time, ARP inspection technology can be used to intercept this illegal arp packet. In fact, using this method can also prevent users from arbitrarily modifying IP addresses, resulting in address conflicts.

 
 
  1. Ip dhcp excluded-address 10.63.150.100 10.63.150.120 address not allocated by dhcp
  2.  
  3. !
  4. Ip dhcp pool main defines the address pool
  5.  
  6. Network 10.63.144.0 255.255.255.0 defines the network segment and address range used by the address pool.
  7. Default-router 10.63.144.1 defines the default gateway of the Client
  8. Domain-name nbyzzj.cn defines the domain of the Client
  9. Dns-server 10.60.12.11 defines the dns of the Client
  10. Lease 7 defines the address lease time as 7 days
  11.  
  12. Ip dhcp snooping enable dhcp snooping
  13.  
  14. Ip dhcp snooping vlan 10-12,101-108,315 defines the vlan used by snooping
  15. Ip dhcp snooping database flash: The dhcp-snooping.db saves the binding table in flash, avoid restarting the device, re-binding
 
 
  1. Ip arp inspection vlan 10-12,101-108,315 defines the vlan used by arp inspection. It is determined based on the dhcp snooping binding table.
  2. Ip arp inspection validate src-mac dst-mac ip detection valid client must meet the src-mac dst-mac ip no error
  3. Ip arp inspection log-buffer entries 1024 inspection log Size
  4. Ip arp inspection log-buffer logs 1024 interval 300 inspection log refresh time, interval is too small will occupy a lot of cpu time
  5. !
  6. !
  7. !
  8. Errdisable recovery cause udld
  9. Errdisable recovery cause bpduguard
  10. Errdisable recovery cause security-violation
  11. Errdisable recovery cause channel-misconfig
  12. Errdisable recovery cause pagp-flap
  13. Errdisable recovery cause dtp-flap
  14. Errdisable recovery cause link-flap
  15. Errdisable recovery cause gbic-invalid
  16. Errdisable recovery cause l2ptguard
  17. Errdisable recovery cause vulnerability cure-violation
  18. Errdisable recovery cause dhcp-rate-limit
  19. Errdisable recovery cause unicast-flood
  20. Errdisable recovery cause vmps
  21. Errdisable recovery cause arp-inspection
  22. Errdisable recovery interval 30

When the application of Dynamic ARP Inspection is started, the switch records a large number of data packets. when too many data packets pass through the port, the switch will consider it to be under DoS attack, thus automatically disable the port and cause communication interruption. To solve this problem, we need to add the command errdisable recovery cause arp-inspection.

 
 
  1. No file verify auto
  2.  
  3. Logging on: When logging is disabled, it will occupy a large amount of cpu resources. Do not forget to enable it.
  4.  
  5. No spanning-tree loopguard default should not be enabled
  6.  
  7. Ip source binding 0004.76f6.e3e9 vlan 315 10.63.150.100 interface Gi1/0/11 manually add static address entries
  8. !
 
 
  1. interface GigabitEthernet1/0/11  
  2. switchport trunk encapsulation dot1q  
  3. switchport mode trunk  
  4. ip arp inspection limit none  
  5. arp timeout 2  
  6. ip dhcp snooping limit rate 100 

Due to the downlink device, in order to prevent inspection from making the port errdisable, there is no restriction on arp detection. If it is an access device directly, ip arp inspection limit rate 100 can be used.

Related commands:

 
 
  1. Sh logging check whether Dymatic Arp Inspection (DAI) takes effect.
  2. Sh ip dhcp snooping binding check whether snooping takes effect
  3. Sh ip dhcp binding check whether the dhcp server takes effect.
  4. Sh arp check if arp information is consistent with dhcp snooping binding table

If a sub-device supports dhcp snooping, you can configure it as follows:

 
 
  1. Ip dhcp snooping
  2. Int g0/1 upstream Port
  3. Switchport trunk encapsulation dot1q
  4. Switchport mode trunk
  5. Ip dhcp snooping trust defines this port as a trusted port. The dhcp server data from this port is valid and prevents other dhcp servers from sending dhcp data.

After the experiment, for hosts that already have a relationship between mac and ip addresses in the binding table, whether obtained through dhcp or statically specified, you only need to comply with this table. If the table does not exist, the corresponding traffic will be blocked.

If the dhcp relay service is used, enter the following command on the Gateway Switch:

Method 1:

 
 
  1. inter vlan10  
  2. ip dhcp relay information trusted 

Method 2:

 
 
  1. switchconfig)# ip dhcp relay information trust-all 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.