Dynamically Allocating Client IP Addresses via DHCP
Problem
You want to configure your router to be a DHCP server and allocate dynamic IP addresses to client workstations.
Solution
The following set of configuration commands allows the router to dynamically allocate IP addresses to client workstations:
Router1#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router1(config)#service dhcpRouter1(config)#ip dhcp poolRouter1(dhcp-config)#172.25.1.0/24networkRouter1(dhcp-config)#172.25.1.0 255.255.255.0default-routerRouter1(dhcp-config)#172.25.1.1exitRouter1(config)#ip dhcp excluded-addressRouter1(config)#172.25.1.1 172.25.1.50ip dhcp excluded-addressRouter1(config)#172.25.1.200 172.25.1.255endRouter1#
Discussion
Cisco incorporated DHCP server functionality starting in IOS Version 12.0(1)T. This allows routers to dynamically allocate IP addresses to client workstations without needing a centralized DHCP server.
Providing DHCP services from a router has some interesting advantages over using a central server. First, distributing the DHCP functionality into the access routers of a large network reduces the risk of a server configuration problem affecting the entire corporate network. Second, maintaining DHCP services within each remote branch router reduces the utilization over expensive WAN links. Third, when a WAN link fails, workstations are still able to function on the local segment. And fourth, the router based DHCP services can easily be administered ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access