Here are some configuration Snippets and commands related to most common DHCP features. This is a way for me to have a reference for configuration commands and scenarios.
Configuration Snippets and Commands.
-DHCP Server.
-DHCP Client.
-DHCP Relay.
-DHCP Host Pool.
-DHCP On-Demand Pool.
-DHCP Proxy.
-DHCP Information Option.
-DHCP Authorized ARP.
-DHCP Client.
-DHCP Relay.
-DHCP Host Pool.
-DHCP On-Demand Pool.
-DHCP Proxy.
-DHCP Information Option.
-DHCP Authorized ARP.
DHCP Server Configuration Commands:
Example:
{
ip dhcp excluded-address 10.1.1.100 10.1.1.254
ip dhcp pool TEST_POOL
network 10.1.1.0 /24
default-router 10.1.1.4 10.1.1.3
dns-server 10.1.1.6 10.1.1.7
lease 0 12
network 10.1.1.0 /24
default-router 10.1.1.4 10.1.1.3
dns-server 10.1.1.6 10.1.1.7
lease 0 12
ip dhcp database flash:/bindings
}
DHCP Server Verification Commands:
Verify DHCP pool configuration: show ip dhcp pool
Verifying DHCP database: show ip dhcp database.
Verifying DHCP database: show ip dhcp database.
Example:
{
MinasTirith#show ip dhcp pool
Pool Voice-VLAN :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 1022
Leased addresses : 195
Excluded addresses : 33
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased/Excluded/Total
10.0.2.78 10.0.0.1 - 10.0.3.254 195 / 33 / 1022
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 1022
Leased addresses : 195
Excluded addresses : 33
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased/Excluded/Total
10.0.2.78 10.0.0.1 - 10.0.3.254 195 / 33 / 1022
Pool Users :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 1022
Leased addresses : 340
Excluded addresses : 77
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased/Excluded/Total
172.20.0.182 172.20.0.1 - 172.20.3.254 340 / 77 / 1022
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 1022
Leased addresses : 340
Excluded addresses : 77
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased/Excluded/Total
172.20.0.182 172.20.0.1 - 172.20.3.254 340 / 77 / 1022
}
{
Arnor#show ip dhcp database
URL : nvram:dhcp_data.txt
Read : Feb 06 2013 04:05 PM
Written : Feb 13 2013 01:15 PM
Status : Last write succeeded. Agent information is up-to-date.
Delay : 300 seconds
Timeout : 300 seconds
Failures : 0
Successes: 21
URL : nvram:dhcp_data.txt
Read : Feb 06 2013 04:05 PM
Written : Feb 13 2013 01:15 PM
Status : Last write succeeded. Agent information is up-to-date.
Delay : 300 seconds
Timeout : 300 seconds
Failures : 0
Successes: 21
}
DHCP Client Configuration Commands:
Configuring an router interface to take an ip addres from a DHCP Server:
ip address dhcp
ip address dhcp
How to configure an interface to use the BIA of a specific interface as client-id
ip address dhcp client-id
ip address dhcp client-id
DHCP Client verification Commands:
Verifying an DHCP binding
show ip dhcp binding
show ip dhcp binding
Example:
MinasTirith#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.0.102 0100.21a0.2d46.7f Feb 20 2013 06:35 PM Automatic
10.0.0.127 0100.09e8.b4a9.fa Feb 21 2013 10:33 AM Automatic
10.0.0.208 0100.0ab7.c6b4.8c Feb 21 2013 04:43 PM Automatic
10.0.0.242 0100.0ab7.b145.bc Feb 21 2013 09:46 AM Automatic
10.0.0.252 0100.0a8a.5c66.ff Feb 21 2013 12:39 PM Automatic
10.0.1.63 0100.0a8a.5cc6.69 Feb 19 2013 11:28 AM Automatic
10.0.1.64 0100.0a8a.5ccc.20 Feb 21 2013 09:46 AM Automatic
10.0.1.73 0100.1da2.19fb.40 Feb 23 2013 12:02 PM Automatic
10.0.1.86 0100.0ab7.ed8e.7f Feb 23 2013 12:25 PM Automatic
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.0.0.102 0100.21a0.2d46.7f Feb 20 2013 06:35 PM Automatic
10.0.0.127 0100.09e8.b4a9.fa Feb 21 2013 10:33 AM Automatic
10.0.0.208 0100.0ab7.c6b4.8c Feb 21 2013 04:43 PM Automatic
10.0.0.242 0100.0ab7.b145.bc Feb 21 2013 09:46 AM Automatic
10.0.0.252 0100.0a8a.5c66.ff Feb 21 2013 12:39 PM Automatic
10.0.1.63 0100.0a8a.5cc6.69 Feb 19 2013 11:28 AM Automatic
10.0.1.64 0100.0a8a.5ccc.20 Feb 21 2013 09:46 AM Automatic
10.0.1.73 0100.1da2.19fb.40 Feb 23 2013 12:02 PM Automatic
10.0.1.86 0100.0ab7.ed8e.7f Feb 23 2013 12:25 PM Automatic
DHCP Relay.
To Configure a router as a relay agent: ip helper-address <ip address of DHCP Server>
DHCP on-demand Pool:
Sample Config:
{
ODAP_POOL router
int s0/0
encapsulation ppp
ip address negotiated ------> Request IP via IPCP.
ppp ipcp mask request -----> Requesting a subnet mask via IPCP.
ppp ipcp dns request ------> DNS IP request via IPCP.
no peer neighbor-route
encapsulation ppp
ip address negotiated ------> Request IP via IPCP.
ppp ipcp mask request -----> Requesting a subnet mask via IPCP.
ppp ipcp dns request ------> DNS IP request via IPCP.
no peer neighbor-route
ip dhcp pool On_Demand_Pool
import all -----> Import Command.
origin ipcp ----> From where is the DHCP pool importing (IPCP).
import all -----> Import Command.
origin ipcp ----> From where is the DHCP pool importing (IPCP).
}
{
Peer
int s1/1
encapsulation ppp
ip add 10.1.13.1 255.255.255.0
peer default ip add 10.1.13.3 ------> Defining the Peer IP address.
ppp ipcp mask 255.255.255.0 -----> Subnet mask to be send via IPCP.
ppp ipcp dns 10.1.13.4 10.1.13.6 ----> DNS IPs to be send via IPCP.
no peer neighbor-route
encapsulation ppp
ip add 10.1.13.1 255.255.255.0
peer default ip add 10.1.13.3 ------> Defining the Peer IP address.
ppp ipcp mask 255.255.255.0 -----> Subnet mask to be send via IPCP.
ppp ipcp dns 10.1.13.4 10.1.13.6 ----> DNS IPs to be send via IPCP.
no peer neighbor-route
}
Verification Commands:
show ip dhcp import
Sample:
{
R1#show ip dhcp import
Address Pool Name: On_Demand_Pool
Domain Name Server(s): 10.1.13.4 10.1.13.6
Address Pool Name: On_Demand_Pool
Domain Name Server(s): 10.1.13.4 10.1.13.6
}
DHCP Proxy
Sample Configuration:
In this scenario R2 is requesting an ip address via IPCP and R3 is relaying to another router (R6).
{
R2:
int s0/1
encapsulation ppp
ip address negotiated
no peer neighbor-route
int s0/1
encapsulation ppp
ip address negotiated
no peer neighbor-route
R3:
int s1/3
encapsulation ppp
ip address 10.1.23.3 255.255.255.0
peer default ip address dhcp -----> Defines address needs to be obtained via DHCP.
no peer neighbor-route
int s1/3
encapsulation ppp
ip address 10.1.23.3 255.255.255.0
peer default ip address dhcp -----> Defines address needs to be obtained via DHCP.
no peer neighbor-route
ip address-pool dhcp-proxy-client ----> Specifying the DHCP-Proxy Feature.
ip dhcp-server 10.1.26.6 -----> DHCP server IP address.
ip dhcp-server 10.1.26.6 -----> DHCP server IP address.
R6:
ip dhcp pool R2_Serial
network 10.1.23.0 /24
!
ip dhcp excluded-address 10.1.23.1
ip dhcp excluded-address 10.1.23.3 10.1.23.254
ip dhcp pool R2_Serial
network 10.1.23.0 /24
!
ip dhcp excluded-address 10.1.23.1
ip dhcp excluded-address 10.1.23.3 10.1.23.254
}
DHCP Information Option.
Sample Config:
{
ip dhcp relay information option
!
int f0/0
ip dhcp relay information option subscriber-id vlan58
!
int f0/0
ip dhcp relay information option subscriber-id vlan58
}
{
ip dhcp class TEST
relay agent information
relay-information hex
020c020a00009b013a05000000000606564c414e3538
!
ip dhcp pool VLAN58
class TEST
address range 10.1.58.8 10.1.58.8
relay agent information
relay-information hex
020c020a00009b013a05000000000606564c414e3538
!
ip dhcp pool VLAN58
class TEST
address range 10.1.58.8 10.1.58.8
}
DHCP Authorized ARP.
Sample Config:
{
R6:
ip dhcp pool VLAN146
update arp
!
ip dhcp pool R1_HOST
update arp
!
int f0/0.146
arp authorize
ip dhcp pool VLAN146
update arp
!
ip dhcp pool R1_HOST
update arp
!
int f0/0.146
arp authorize
R6:
arp 10.1.146.4 0008.0e9c.dac2 arpa
}
Further Reading.
Cisco IOS DHCP Configuration Guide: http://www.cisco.com/en/US/docs/ios-xml/ios/ipaddr_dhcp/configuration/12-4t/dhcp-12-4t-book.html
Further Reading.
Cisco IOS DHCP Configuration Guide: http://www.cisco.com/en/US/docs/ios-xml/ios/ipaddr_dhcp/configuration/12-4t/dhcp-12-4t-book.html
No comments:
Post a Comment