Thursday, January 31, 2008

Cisco Router as DHCP Server

All Cisco Layer3 switches & routers, have the capability to run a DHCP server. Sooner or latter you will find yourself with the need to configure a router as a DHCP Server.

The configuration is quiet straight forward. Lets say we have the following interface to our LAN:
!
interface FastEthernet 0/0
 description Uplink to Users Segment
 ip address 10.10.10.1 255.255.255.0
 ...
!


Lets configure a DHCP server with the following parameters:
  1. Exclude the first 10 IPs from the DHCP range 
  2. Use 172.16.10.10 and 172.16.10.11 as the DNS servers 
  3. Use monids.org as the domain 
  4. Max lease will be set to 4 hours 
  5. Secure ARP table entries to DHCP leases in the DHCP database 
  6. Disable dynamic ARP learning on an interface (DHCP leases will be installing the authorized entries)
Well, the first four (4) parameters are the most common parameters, but lets do them all together:


!
ip dhcp excluded-address 10.10.10.1 10.10.10.10
!
ip dhcp pool MyPOOL
 network 10.10.10.0 255.255.255.0
 default-router 10.10.10.1
 dns-server 172.16.10.10 172.16.10.11
 domain-name monids.org
 lease 0 4
 update arp ! This will keep tracking of the mac-address of the client
!
!
interface FastEthernet 0/0
 description Uplink to Users Segment
 ip address 10.10.10.1 255.255.255.0
 ...
 arp authorized !IP to MAC mapping can only be installed by the authorized subsystem
 arp timeout 60 !How long an entry remains in the ARP cache
 arp probe interval 5 count 15 !Interval, in seconds, and number of probe retries!
!

And this will be the whole configuration. For clarification of the syntax of two parameters:
  • "lease {days [hours] [minutes]| infinite}" will
  • "arp probe interval {seconds} count {number}" will remove the arp cache entry if the peer does not answer after "{number}" amount of probes. Each probe will be send "{seconds}" seconds apart.
The "update arp" and "arp authorized" are some of the DHCP security features available at the Cisco IOS.

For more information on DHCP configuration on IOS and features available visit this link.

1 comment:

  1. I was searching this up for my brother's assignment. I don't get much of it, but I understand the idea. Hopefully this will help him through. Thank you so much for sharing this informationl

    ReplyDelete