Thursday 9 March 2017

Cisco DHCP Router configuration

Dynamic Host Configuration Protocol (DHCP) is a client/server protocol that automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway. Cisco Router is used to configure as DHCP Server. Basic Steps are given below. ( Note : Commands and Output is from physical devices - Router 1841 & Switch 3550. Topology image is given only for reference)
R1
Router#conf t
Router(config)#int fa0/0
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#service dhcp
Router(config)#ip dhcp pool MYPOOL
Router(dhcp-config)#network 192.168.1.0 /24
Router(dhcp-config)#end
Router#show ip dhcp pool

Pool MYPOOL :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0
 Total addresses                : 254
 Leased addresses               : 0
 Pending event                  : none
 1 subnet is currently in the pool :
 Current index        IP address range                    Leased addresses
 192.168.1.1          192.168.1.1      - 192.168.1.254     0


Remember to assign the ip address to the interface in the same network. Run show ip dhcp pool to check the configuration.

R2
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#ip address dhcp
Router(config-if)#no shut
Router(config-if)#end
Router#show ip interface brief
*Mar  9 06:22:59.627: %SYS-5-CONFIG_I: Configured from console by console
*Mar  9 06:23:01.607: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state p
*Mar  9 06:23:02.607: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEtherp
Interface                  IP-Address      OK? Method Status                Prol
FastEthernet0/0            unassigned      YES DHCP   up                    up
FastEthernet0/1            unassigned      YES unset  administratively down dow
Serial0/0/0                unassigned      YES unset  administratively down dow
Serial0/1/0                unassigned      YES unset  administratively down dow


R3
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#ip address dhcp
Router(config-if)#no shut
Router(config-if)#end
Router#show ip interface brief
Interface                  IP-Address      OK? Method Status                Prol
FastEthernet0/0            unassigned      YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down dow
Serial0/0/0                unassigned      YES unset  administratively down dow
Serial0/0/1                unassigned      YES unset  administratively down dow
Serial0/1/0                unassigned      YES unset  administratively down dow
Serial0/1/1                unassigned      YES unset  administratively down dow


The Switch will forward the broadcast to all the port by default, don't need additional Setting. Make sure all the ports on switch in UP state. 

*Mar  9 07:39:46.983: %DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigner

You can see the automatic IP Address allocation on R2 & R3 fa0/0 interface. If you did not? restart the interface with shut and no shut command. 

Show command for help
Show IP interface brief ( to check the status of the interface )
Show IP DHCP Pool ( Configured pool information )
Show IP DHCP binding ( Check the mac address of the DHCP Client )

Please comment if any suggestions, questions.

No comments:

Post a Comment