Router as DHCP Server

Posted: 30th May 2020 by ccna7guru in ITN

Step I: Create the dhcp pool by Name
Router(config)#ip dhcp pool pool1

Step II: Assign network of IP address
Router(dhcp-config)#network 192.168.1.0 255.255.255.0

Step III: Assign a default gateway to that above mentioned pool
Router(dhcp-config)#default-router 192.168.1.1

Step IV: Assign a dns to that above mentioned pool
Router(dhcp-config)#dns-server 192.168.1.5

Router(dhcp-config)#?
default-router Default routers
dns-server Set name server
exit Exit from DHCP pool configuration mode
network Network number and mask
no Negate a command or set its defaults
Router(dhcp-config)#exit

Step V: Exclude any IP from above Assign network of IP address
Router(config)#ip dhcp excluded-address 192.168.1.1

Router>
Router>en
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip dhcp pool pool1
Router(dhcp-config)#network 192.168.1.0 255.255.255.0
Router(dhcp-config)#default-router 192.168.1.1
Router(dhcp-config)#dns-server 192.168.1.5
Router(dhcp-config)#exit
Router(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.20
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#
%SYS-5-CONFIG_I: Configured from console by console
Router#show ip dhcp binding
IP address Client-ID/ Lease expiration Type
Hardware address
192.168.1.21 00D0.BCE1.6370 — Automatic