Router as a DHCPv4 Client
There are scenarios where you might have access to a DHCP server through your ISP. In these instances, you can configure a Cisco IOS router as a DHCPv4 client.
Configuring an Interface to be a DHCPV4 Client
Commands to configure an interface on a router as a DHCP client
R1(config)# interface G0/0/1 R1(config-if)# ip address dhcp R1(config-if)# no shutdown Jul 1 17:21:25.773: %DHCP-6-ADDRESS_ASSIGN: Interface GigabitEthernet0/0/1 assigned DHCP address 209.165.201.12, mask 255.255.255.224, hostname R1
This configuration assumes that the ISP has been configured to provide select customers with IPv4 addressing information.
Confirming a DHCP Client Interface
Command to confirm that an interface was set to obtain an IP Address via DHCPv4
R1# show ip interface g0/0/1 GigabitEthernet0/0/1 is up, line protocol is up Internet address is 209.165.201.12/27 Broadcast address is 255.255.255.255 Address determined by DHCP (output omitted)