Professional Documents
Culture Documents
Configure DHCP and DNS Using Packet Tracer: Practical No.7
Configure DHCP and DNS Using Packet Tracer: Practical No.7
Configure DHCP and DNS Using Packet Tracer: Practical No.7
1. When client wants to get ip address via DHCP, it generates dhcp discover.
The client broadcasts a DHCPDISCOVER message on its local physical subnet.
The DHCPDISCOVER message may include options that suggest values for the network address
and lease duration.DHCPDISCOVER is a UDP broadcast message type.
2. One or more servers may answer on it with dhcp offer.
Each server may respond with a DHCPOFFER message that includes an available network
address in the "ipaddr" field (and other configuration parameters in DHCP options).
The server unicasts the DHCPOFFER message to the client (using the DHCP/BOOTP relay agent
if necessary) if possible, or may broadcast the message to a broadcast address (preferably
255.255.255.255) on the client's subnet.
3. The client chooses one ip address and responds to the server with aDHCPREQUEST.
DHCPREQUEST is a UDP broadcast message type.
4. The server acknowledges the request with a DHCPACK.
Features of DHCP:
1. DHCP messages from a client to a server are sent to the DHCP server port (UDP port 67), and
DHCP messages from a server to a client are sent to the DHCP client port (UDP port 68).
2. DHCP is used to provide IP information to hosts on your network. DHCP can provide a lot of
information, but the most common is IP address, subnet mask, default gateway, and DNS
information.
3. The DHCP Discover message uses UDP as it is the transport layer protocol. i.e. DHCP is
connectionless.
4. DHCP also called the Host-to-Host layer.
5. The DHCP Discover message uses FF-FF-FF-FF-FF as the Layer 2 destination address.
6. A client that sends out a DHCP Discover message in order to receive an IP address sends out a
broadcast at both layer 2 and layer 3. The layer 2 broadcast is all Fs in hex, or
FF:FF:FF:FF:FF:FF. The layer 3 broadcast is 255.255.255.255, which means all networks and all
hosts.
7. DHCP clients lease their IP addresses from DHCP servers. When this lease expires, that IP
address can no longer be utilized by the DHCP client. For that reason, DHCP client must
periodically renew their IP address leases, preferably before the lease has expired or is about to
expire.The default lease period is 30 days.The default ping timeout is 500 milliseconds.
8. DHCP allows for both private and public addressing.
9. A DHCP server uses a ping to detect address conflicts.
DHCP Commands:
________________________________________________________
PRINT-OUT
________________________________________________________
Configure router
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa 0/0
Router(config-if)#ip address 192.168.10.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Configure DHCP
Router(config)#ip dhcp ?
excluded-address Prevent DHCP from assigning certain addresses
pool Configure DHCP address pools
Router(config)#ip dhcp pool ?
WORD Pool name
Router(config)#ipdhcp pool mypool
Router(dhcp-config)# network 192.168.10.0 255.255.255.0
Router(dhcp-config)#default-router 192.168.10.1
Router(dhcp-config)#dns-server 4.2.2.2
Router(dhcp-config)#exit
Router(config)#ip dhcp ?
excluded-address Prevent DHCP from assigning certain addresses
pool Configure DHCP address pools
Router(config)#ipdhcp excluded-address 192.168.10.5 192.168.10.80
Router(config)#^Z
Router#
Click PC1/ IP Configuration /DHCP
PC>ipconfig /all
Physical Address................: 00E0.F9BE.AD2D
IP Address......................: 192.168.10.2
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.10.1
DNS Servers.....................: 4.2.2.2
PC>
PC>ipconfig /all
Physical Address................: 0090.2185.88DD
IP Address......................: 192.168.10.3
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.10.1
DNS Servers.....................: 4.2.2.2
PC>
PC>ipconfig /all
Physical Address................: 0001.6450.50D8
IP Address......................: 192.168.10.4
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.10.1
DNS Servers.....................: 4.2.2.2
PC>
DHCP and DNS on packet tracer:
Here in this tutorial, we are going to set a dns (domain name system) server and a dhcp server. And
then from our PC we will use dns service.
Go to Web Browser and enter Server 0 ip address. You can access the website of the server.
Now, let us set DNS on DNS server. Create the following record and click on add.
Now, again go to PC and in the web browser enter the name that you set in DNS