Cisco Packet Tracer — How to Configure DHCP on Cisco Router

In this project, we will configure DHCP on each router to assign the proper IP address for each subnet.

Each router will require the following IP Address configuration accordingly to its own network or subnet requirement:
Router1>enable
Router1#configure terminal
Router1(config)#interface gi0/0
Router1(config-if)#ip address 192.168.1.1 255.255.255.0
Router1(config-if)#no shutdown
Router1(config-if)#exit
Router1(config)#ip default-gateway 192.168.1.1
Each router will require the following DHCP configuration accordingly to its own network or subnet requirement:
Router1>enable
Router1#configure terminal
Router1(config)#ip dhcp pool network1
Router1(dhcp-config)#default-router 192.168.1.1
Router1(dhcp-config)#network 192.168.1.0 255.255.255.0
After the configurations above, each PC under a router will receive an IP address from the DHCP.

Now that all PCs on the network can receive an IP address from the DHCP. They cannot communicate outside of their own network. For instance, PC1 can reach Router1 “192.168.1.1” but cannot reach Router2 “192.168.2.1”. In short words, no packages can be submitted outside of the network.
Thus, to solve this communication issue, we need to configure OSPF Routing Protocol on each router:
Router1>enable
Router1#configure terminal
Router1(config)#router ospf 100
Router1(config)#network 192.168.1.0 0.0.0.255 area 0
Router1(config)#network 192.168.2.0 0.0.0.255 area 0
Router1(config)#network 192.168.3.0 0.0.0.255 area 0
Router1(config)#network 192.168.4.0 0.0.0.3 area 0
Router1(config)#network 192.168.4.4 0.0.0.3 area 0
Router1(config)#network 192.168.4.8 0.0.0.3 area 0
After OSPF routing is configured, all networks can be reachable:
