Showing posts with label DHCP. Show all posts
Showing posts with label DHCP. Show all posts

Wednesday, September 15, 2010

Confgure a DHCP Server

Confgure a DHCP Server

In this post I will configure DHCP Settings on my router. I turn on the DHCP service, create a pool and configure it with an IP range, domain name, DNS server, default router and lease. I add in exclusions for the addresses I do not want leased. Finally I check the running config.



router1(config)#service dhcp
router1(config)#ip dhcp pool dmz
router1(dhcp-config)#network 10.0.2.0 /24
router1(dhcp-config)#domain-name lab.local
router1(dhcp-config)#dns-server 8.8.8.8
router1(dhcp-config)#default-router 10.0.2.254
router1(dhcp-config)#lease 7
router1(dhcp-config)#exit
router1(config)#ip dhcp excluded-address 10.0.2.10 10.0.2.255
router1(config)#end


router1#sh run

!
ip subnet-zero
no ip dhcp use vrf connected
ip dhcp excluded-address 10.0.2.10 10.0.2.255
!
ip dhcp pool dmz
network 10.0.2.0 255.255.255.0
domain-name lab.local
dns-server 8.8.8.8
default-router 10.0.2.254
lease 7
!
!

Useful DHCP Show Commands


In this post I will demonstrate a few useful show commands that will help me see the state of the routers DHCP server which I set up in the previous post.

  • show ip dhcp binding
  • show ip dhcp pool
  • show ip dhcp server statistics

These commands were run after a computer was issued the IP 10.0.2.1 from the dmz pool.


router1#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.0.2.1 0100.1e68.ffd3.5f Oct 13 2009 10:08 PM Automatic


router1#show ip dhcp pool
Pool dmz :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 254
Leased addresses : 1
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased addresses
10.0.2.2 10.0.2.1 - 10.0.2.254 1



router1#show ip dhcp server statistics
Memory usage 23991
Address pools 1
Database agents 0
Automatic bindings 1
Manual bindings 0
Expired bindings 0
Malformed messages 9
Secure arp entries 0

Message Received
BOOTREQUEST 0
DHCPDISCOVER 8
DHCPREQUEST 12
DHCPDECLINE 0
DHCPRELEASE 0
DHCPINFORM 5

Message Sent
BOOTREPLY 0
DHCPOFFER 1
DHCPACK 4
DHCPNAK 0

Home Router Setup

Home Router Setup - Part 2: Interfaces & Services

In this post I'll be setting up my network interfaces and some network services, DNS and DHCP.

Below is a diagram of the lab I'll be using.




Part 2 - Interfaces and Services


Here I will set up the 2 network interfaces and remove CDP from the Test Network interface.

Router1(config)#interface ethernet 0
Router1(config-if)#ip address 10.0.2.254 255.255.255.0
Router1(config-if)#no cdp enable
Router1(config-if)#exit

Router1(config)#interface ethernet 1
Router1(config-if)#ip address 10.0.1.254 255.255.255.0
Router1(config-if)#no shut
Router1(config-if)#exit



I configure the router to use the Extreme router as it's default gateway. I will also configure it to use OpenDNS name servers and to resolve DNS queries for other network hosts.

Router1(config)#ip route 0.0.0.0 0.0.0.0 10.0.1.1
Router1(config)#ip domain-lookup
Router1(config)#ip name-server 208.67.222.222
Router1(config)#ip name-server 208.67.220.220
Router1(config)#ip dns server
Router1(config)#exit



Next I configure DHCP for the Test Network.

Router1(config)#service dhcp
Router1(config)#ip dhcp pool TEST_NETWORK_DHCP_POOL
Router1(dhcp-config)#network 10.0.2.0 /24
Router1(dhcp-config)#domain-name walliford.local
Router1(dhcp-config)#dns-server 10.0.2.254
Router1(dhcp-config)#default-router 10.0.2.254
Router1(dhcp-config)#lease 7
Router1(dhcp-config)#exit



I include exclusions so only 10.0.2.10 - 10.0.2.20 are used for DHCP clients.

Router1(config)#ip dhcp excluded-address 10.0.2.1 10.0.2.9
Router1(config)#ip dhcp excluded-address 10.0.2.21 10.0.2.255
Router1(config)#end