4.0 CCNA - IP Services
4.3 Role of DHCP and DNS within an IP network
Configuring DHCP to an IOS router
To assign DHCP on an IOS router, you need to configure the router as a DHCP server and specify the range of IP addresses that will be assigned to devices on the network. Here is an example configuration:
Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# ip dhcp pool [pool_name] Router(dhcp-config)# network [network_address] [subnet_mask] Router(dhcp-config)# default-router [default_gateway_address] Router(dhcp-config)# dns-server [dns_server_address] Router(dhcp-config)# exit Router(config)# interface [interface_name] Router(config-if)# ip address [ip_address] [subnet_mask] Router(config-if)# ip helper-address [DHCP_server_address] Router(config-if)# end Router#
In this example:
[pool_name] is the name of the DHCP pool.
[network_address] [subnet_mask] is the network address and subnet mask that defines the range of IP addresses that will be assigned to devices on the network.
[default_gateway_address] is the IP address of the default gateway for the network.
[dns_server_address] is the IP address of the DNS server that devices on the network will use.
[interface_name] is the name of the interface that is connected to the network where devices will receive IP addresses from the DHCP server.
[ip_address] [subnet_mask] is the IP address and subnet mask that will be assigned to the interface.
[DHCP_server_address] is the IP address of the DHCP server.