| ccnaguru.com | CCNA Articles | CCNA - CCNP Articles | CCNP Articles | Network+ | CCNA Training - CCNP Training Exams | |
| Cisco CCNP BSCI Exam Tutorial: Configuring Cisco Router As DHCP Server | |
Careful planning is the first step to success when working with Cisco routers, and that's particularly true of a DHCP deployment. We may have a situation where we want to exclude a certain range of addresses from the DHCP pool, and oddly enough, we need to do that in global configuration mode.
Let's say we are going to assign addresses to DHCP clients from the 11.0.0.0
/8 range, but we don't want to assign the addresses 11.1.1.1 - 11.1.1.255.
We need to use the ip dhcp excluded-address command to do that, and again,
that's a global command. (I mention that twice because that drives everyone
crazy - it's very easy to forget!) |
|
R1(config)#ip dhcp excluded-address ? R1(config)#ip dhcp excluded-address 11.1.1.1 ? R1(config)#ip dhcp excluded-address 11.1.1.1 11.1.1.255 ? R1(config)#ip dhcp excluded-address 11.1.1.1 11.1.1.255 |
|
Note that there are no masks used in this command - just the numerically lowest and highest IP addresses in the excluded range. We're ready to create the DHCP pool! We enter DHCP config mode with the ip dhcp pool command, followed by the name we want the pool to have. R1(config)#ip dhcp pool ? R1(config)#ip dhcp pool NETWORK11 The range of addresses to be assigned to the clients is defined with the network command. Note that for the mask, we're given the option of entering the value in either prefix notation or the more familiar dotted decimal. R1(dhcp-config)#network ? R1(dhcp-config)#network 11.0.0.0 ? R1(dhcp-config)#network 11.0.0.0 /8 We can specify a domain name with the domain-name command, and give the clients the location of DNS servers with the dns-server command. The DNS servers can be referred to by either their hostname or IP address. R1(dhcp-config)#domain-name ? R1(dhcp-config)#domain-name bryantadvantage.com R1(dhcp-config)#dns-server ? R1(dhcp-config)#dns-server 11.1.1.255 To specify a default router for the clients, use the default-router command. R1(dhcp-config)#default-router ? R1(dhcp-config)#default-router 11.1.1.100 You can also use the netbios-name-server and netbios-node-type commands as needed for Microsoft DHCP clients. The netbios-name-server command indicates the location of WINS servers. Note that the netbios-name-server commands allows more than one WINS server to be specified with a single command. R1(dhcp-config)#netbios-name-server ? R1(dhcp-config)#netbios-name-server 11.1.1.51 ? R1(dhcp-config)#netbios-name-server 11.1.1.51 11.1.1.52 R1(dhcp-config)#netbios-node-type ? Not only can you specify the length of the DHCP address lease, you can be really specific about that value - down to the minute! The lease can also be made indefinite with the infinite option. R1(dhcp-config)#lease ? R1(dhcp-config)#lease 30 ? R1(dhcp-config)#lease 30 23 ? R1(dhcp-config)#lease 30 23 59 ? R1(dhcp-config)#lease 30 23 59 At the beginning of this section, I mentioned that a Cisco router acting as a DHCP server will check for IP address conflicts before assigning an IP address. This check consists of the router sending two ping packets to an IP address before assigning that address; those pings will time out in 500 milliseconds. If the ping times out, the address will be assigned. If an echo returns, obviously that address should not and will not be assigned! If you want to change either the number of pings sent or the ping timeout value during this process, use the ip dhcp ping packets and ip dhcp ping timeout commands. Note that these are global commands as well. You can also disable this pinging by entering zero for the ping packets value. R1(config)#ip dhcp ping packets ? R1(config)#ip dhcp ping packets 5
R1(config)#ip dhcp ping timeout 1000 Finally, if you need to disable the DHCP service on this router, run
the no service dhcp command. It can be reenabled at any time with the
service dhcp command. Chris Bryant, CCIE #12933 |
|
| Copyright © 2007 WWW.CCNAGURU.COM All rights reserved | |