In our previous article we already have seen how to configure Cisco Router as a DHCP Server,But today in this article we will learn how to configure a Cisco Router as a DHCP Client.When we configure a Router as a DHCP Client then the Router will be able to obtain it’s interface ip address automatically from DHCP Server.
In above Topology Diagram you can clearly see Two Routers R1 and R2.
Now in this lab i will configure Router “r1” as a DHCP SERVER and Router “r2” as a DHCP Client.
DHCP POOL Creation and Configuration on r1:
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname r1
r1(config)#ip dhcp pool satish
r1(dhcp-config)#network 1.0.0.0 255.0.0.0
r1(dhcp-config)#default-router 1.0.0.1
r1(dhcp-config)#exit
r1(config)#int fa0/0
r1(config-if)#ip address 1.0.0.1 255.0.0.0
r1(config-if)#no shut
DHCP Client Configuration on r2:
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname r2
r2(config)#int fa0/0
r2(config-if)#no shut
r2(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
r2(config-if)#ip address dhcp
Explanation:Here in above command ” ip address dhcp” command will automatically assign an ip address on router r2 fa0/0 interface.
Note:ip address dhcp will assign ip on interface on which you will run this command and it will ask for ip from DHCP SERVER.Here in our this LAB DHCP SERVER is Router r1.But you can also configure a dedicated Machine as a DHCP Server.
Test router r2 interface whether its got ip address or not:
r2#show int fa0/0
FastEthernet0/0 is up, line protocol is up (connected)
Hardware is Lance, address is 00e0.f77b.be01 (bia 00e0.f77b.be01)
Internet address is 1.0.0.2/8
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
ARP type: ARPA, ARP Timeout 04:00:00,
Last input 00:00:08, output 00:00:05, output hang never
Last clearing of “show interface” counters never
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: fifo
Output queue :0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
2 packets input, 124 bytes, 0 no buffer
Received 2 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 input packets with dribble condition detected
2 packets output, 124 bytes, 0 underruns
0 output errors, 0 collisions, 1 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
Note:If you feel any doubt or any problem in configuring or understanding this lab feel free to ask through comment section.If you have some ideas you can share.
You can also Read: