In this tutorial I’ll discuss about how to configuration dhcp server on router cisco packet tracer. That is the router will be serve ip automatically to client.
The following is the topologi are used :
Based on the above topology, we will configure two network with dhcp server. Network for 192.168.1.0/24 and 192.168.2.0/24.
Configure IP Address router :
MyRouter(config)#int g0/0/0 MyRouter(config-if)#ip add 192.168.1.1 255.255.255.0 MyRouter(config-if)#no shutdown MyRouter(config-if)#exit MyRouter(config)#int g0/0/1 MyRouter(config-if)#ip add 192.168.2.1 255.255.255.0 MyRouter(config-if)#no shutdown MyRouter(config-if)#exit MyRouter(config)#
When you confiure dhcp, it has several configuration :
- excluded-address : it’s for specify the ip address that not will used at leases dhcp. Usually static ip like ip router/printer/server.
- pool. : for specify dhcp pool name.
- network : for specify ip network to client.
- default-router : for specify ip default gateway to client.
- lease : for specify leases dhcp duration to client.
- dns-server : for specify ip dns to client.
- domain-name : for specify domain name.
Configure dhcp server for network 192.168.1.0/24 :
MyRouter(config)#ip dhcp pool POOL-1.1 MyRouter(dhcp-config)#network 192.168.1.0 255.255.255.0 MyRouter(dhcp-config)#default-route MyRouter(dhcp-config)#default-router 192.168.1.1 MyRouter(dhcp-config)#dns-server 8.8.8.8 MyRouter(dhcp-config)#domain-name taufiknurhuda.web.id MyRouter(dhcp-config)#exit MyRouter(config)#
Configure dhcp server for network 192.168.2.0/24 :
MyRouter(config)#ip dhcp pool POOL-2.1 MyRouter(dhcp-config)#network 192.168.2.0 255.255.255.0 MyRouter(dhcp-config)#default-router 192.168.2.1 MyRouter(dhcp-config)#dns-server 8.8.8.8 MyRouter(dhcp-config)#domain-name taufiknurhuda.web.id MyRouter(dhcp-config)#exit MyRouter(config)#
Configure dhcp excluded address. These is ip address that already used or static ip.
MyRouter(config)#ip dhcp excluded-address 192.168.1.1 MyRouter(config)#ip dhcp excluded-address 192.168.2.1
*NOTE : if you have several ip address that will be excluded for example 192.168.1.1 until 192.168.1.10, The configuration format is like that :
MyRouter(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.10
Now test the configuration from client.
Configuration is successfull.