Configuring a Router-Based DHCP Server
We currently made it to Step 4 in the preceding IP phone boot process. The phones in our network now need to receive IP address and TFTP server information. In the network design scenario used in this chapter, we use the WAN branch router as the DHCP server.
Using a router as a DHCP server is a somewhat common practice in smaller networks. Once you move into larger organizations, DHCP services are typically centralized onto server platforms. Either DHCP option is capable of sending TFTP server information to the IP phones.
Example 3-3 shows the syntax used to configure a WAN branch router as a DHCP server.
Example 3-3. Configuring Router-Based DHCP Services
WAN_RTR(config)#ip dhcp excluded-address 172.16.1.1 172.16.1.9
WAN_RTR(config)#ip dhcp excluded-address 172.16.2.1 172.16.2.9
WAN_RTR(config)#ip dhcp pool DATA_SCOPE
WAN_RTR(dhcp-config)#network 172.16.2.0 255.255.255.0
WAN_RTR(config)#ip dhcp pool VOICE_SCOPE
WAN_RTR(dhcp-config)#network 172.16.1.0 255.255.255.0
WAN_RTR(dhcp-config)#option 150 ip 172.16.1.1
The way in which Cisco routers approach DHCP configurations is slightly different from how many other DHCP servers do so. Most DHCP servers allow you to specify a range of IP addresses that you would like to hand out to clients. Cisco routers take the opposite approach: you first specify a range of addresses that you do not want to hand out to clients (using the ip dhcp excluded-address syntax from global configuration mode). Configuring the excluded addresses before you configure the DHCP pools ensures that the Cisco router does not accidentally hand out IP addresses before you have a chance to exclude them from the range. The DHCP service on the router will begin handing out IP addresses from the first nonexcluded IP address in the network range. In Example 3-3, this is 172.16.1.10 for the voice scope and 172.16.2.10 for the data scope.
Also notice that the VOICE_SCOPE DHCP pool includes the option 150 syntax. This creates the custom TFTP server option to be handed out to the Cisco IP Phones along with their IP address information. In this case, the TFTP server of the IP phones is the same as the default gateway because we use the CME router as a call processing agent. As mentioned in the section, "Understanding the Cisco IP Phone Boot Process," the TFTP server holds the configuration files for the phones. When you configure a Cisco IP Phone in Cisco Unified Communications Manager (CUCM) or CME, an XML configuration file is generated and stored on a TFTP server. These CML configuration files have a filename format of SEP<IP Phone MAC Address>.cnf.xml and contain a base configuration for the IP phone (specifying language settings, URLs, and so on). Most importantly, these XML files contain a list of up to three CUCM server or CME IP addresses the Cisco IP Phone uses for registration. After the IP phone receives the XML file, it attempts to register with the first CUCM or CME server listed in the file. If it is unable to reach that server, it moves down to the next until the list is exhausted (at which point the IP phone reboots and tries it all over again).