Allocating Static IP Addresses with DHCP
Problem
You want to ensure that your router assigns the same IP address to a particular device every time it connects.
Solution
The following commands ensure that the router assigns the same IP address to a device each time it requests one:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#ip dhcp pool
Router1(dhcp-config)#
IAN
host
Router1(dhcp-config)#
172.25.1.33 255.255.255.0
client-identifier
Router1(dhcp-config)#
0100.0103.85e9.87
client-name
Router1(dhcp-config)#
win2k
default-router
Router1(dhcp-config)#
172.25.1.1
domain-name
Router1(dhcp-config)#
oreilly.com
dns-server
Router1(dhcp-config)#
172.25.1.1
exit
Router1(config)#end
Router1#
Discussion
The router allows you to statically bind an IP address to a MAC address to ensure that a particular device always receives the same IP address. This is particularly useful for devices such as servers that must be available for access via a well-known IP address or DNS entry. Any device that accepts inbound sessions will probably require a static address. Being able to allocate these addresses via DHCP provides network administrator with greater control.
The configuration for a static DHCP mapping is slightly
different than a dynamic pool. In particular, you must assign a
separate dhcp pool for each
static server. In our example, we created a pool named IAN
to allocate a static IP address to user Ian. Also, instead of defining a network range of IP ...
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.