Windows Dhcp Server Command Line

What is DHCP?(Dynamic Host Configuration Protocol)

DEFINITION

Dynamic Host Configuration Protocol (DHCP) is a network management protocol used to automate the process of configuring devices on IP networks, thus allowing them to use network services such as DNS, NTP, and any communication protocol based on UDP or TCP. A DHCP server dynamically assigns an IP address and other network configuration parameters to each device on a network so they can communicate with other IP networks. DHCP is an enhancement of an older protocol called BOOTP. DHCP is an important part of the DDI Solution (DNS-DHCP-IPAM).

Components of DHCP

  1. DHCP Server: It is typically a server or a router that holds the network configuration information.
  2. DHCP Client: It is the endpoint that gets the configuration information from the server like any computer or mobile.
  3. DHCP Relay Agent: If you have only one DHCP Server for multiple LAN’s then the DHCP relay agent present in every network will forward the DHCP request to the servers. This because the DHCP packets cannot travel across the router. Hence, the relay agent is required so that DHCP servers can handle the request from all the networks.
  4. IP address pool: It contains the list of IP address which are available for assignment to the client.
  5. Subnet Mask: It tells the host that in which network it is currently present.
  6. Lease Time: It is the amount of time for which the IP address is available to the client. After this time the client must renew the IP address.
  7. Gateway Address: The gateway address lets the host know where the gateway is to connect to the internet.

How do DHCP works?

DHCP works at the application layer to dynamically assign the IP address to the client and this happens through the exchange of a series of messages called DHCP transactions or DHCP conversation.

  • DHCP Discovery: The DHCP client broadcast messages to discover the DHCP servers. The client computer sends a packet with the default broadcast destination of 255.255.255.255 or the specific subnet broadcast address if any configured. 255.255.255.255 is a special broadcast address, which means “this network”: it lets you send a broadcast packet to the network you’re connected to.
what is dhcp and how does it works dhcp discover 251392057ebe6e46
  • DHCP Offer: When the DHCP server receives the DHCP Discover message then it suggests or offers an IP address(form IP address pool) to the client by sending a DHCP offer message to the client. This DHCP offer message contains the proposed IP address for DHCP client, IP address of the server, MAC address of the client, subnet mask, default gateway, DNS address, and lease information.
what is dhcp and how does it works dhcp offer 32b4795994360ab7
  1. the proposed IP address for DHCP client (here 192.168.1.11)
  2. Subnet mask to identify the network (here 255.255.255.0)
  3. IP of the default gateway for the subnet (here 192.168.1.1)
  4. IP of DNS server for name translations (here 8.8.8.8)
  • DHCP Request: In most cases, the client can receive multiple DHCP offer because in a network there are many DHCP servers(as they provide fault tolerance). If the IP addressing of one server fails then other servers can provide backup. But, the client will accept only one DHCP offer. In response to the offer, the client sends a DHCP Request requesting the offered address from one of the DHCP servers. All the other offered IP addresses from remaining DHCP servers are withdrawn and returned to the pool of IP available addresses.
what is dhcp and how does it works dhcp request e64c006809486afc
  • DHCP Acknowledgment: The server then sends Acknowledgment to the client confirming the DHCP lease to the client. The server might send any other configuration that the client may have asked. At this step, the IP configuration is completed and the client can use the new IP settings.
what is dhcp and how does it works dhcp ack 4dbed73f562d85a1

What is DHCP principle

what is the relevance of DHCP commands in computer networking

DHCP runs at the application layer of the Transmission Control Protocol/IP (TCP/IP) stack to dynamically assign IP addresses to DHCP clients and to allocate TCP/IP configuration information to DHCP clients.

What are the four types of messages used in DHCP?The DHCP server uses the following messages to communicate with a DHCP client:

  • DHCPDISCOVER. Sent by the client as the first step of the DHCP client/server interaction. …
  • DHCPOFFER. Sent by the server to the client in response to a DHCPDISCOVER. …
  • DHCPREQUEST. …
  • DHCPACK. …
  • DHCPNAK. …
  • DHCPRELEASE. …
  • DHCPDECLINE.

Advantages of DHCP

  1. It is easy to implement and automatic assignment of an IP address means an accurate IP address.
  2. The manual configuration of the IP address is not required. Hence, it saves time and workload for the network administrators.
  3. Duplicate or invalid IP assignments are not there which means there is no IP address conflict.
  4. It is a great benefit for mobile users as the new valid configurations are automatically obtained when they change their network.

Disadvantages of DHCP

  1. As the DHCP servers have no secure mechanism for the authentication of the client so any new client can join the network. This posses security risks like unauthorized clients being given IP address and IP address depletion from unauthorized clients.
  2. The DHCP server can be a single point of failure if the network has only one DHCP server.

DHCP server CLI commands

Command optionsDescription
domain-nameSpecifies the domain name for the DHCP clients.
domain-name-serversSpecifies the Domain Name System (DNS) IP servers that are available to the DHCP clients.
merit-dumpSpecifies the path name of a file into which the client’s core image should be placed in the event that the client crashes (the DHCP application issues an exception in case of errors such as division by zero).
root-pathSpecifies the name of the path that contains the client’s root filesystem in NFS notation.
routerAdds the default router and gateway for the DHCP clients.
subnet-maskDefines the subnet mask for the network.
broadcast-addressDefines a broadcast address for the network.
wins-serverDefines the NetBIOS Windows Internet Naming Service (WINS) name servers that are available to Microsoft DHCP clients.
log-serversDefines a list of log servers available to the client.
bootstrap-serverSpecifies the IP address of the bootstrap server (the command fills the “siaddr” field in the DHCP packet).
CommandDescription
dbexpire commandSpecifies how long, in seconds, the DHCP server should wait before aborting a database transfer.
ip dhcp-server arp-ping-timeoutSpecifies the time (in seconds) the server will wait for a response to an arp-ping packet before deleting the client from the binding database. The minimum setting is 5 seconds and the maximum time is 30 seconds.NOTEDo not alter the default value unless it is necessary. Increasing the value of this timer may increase the time to get console access after a reboot.
clear ip dhcp-server bindingDeletes a specific, or all leases from the binding database.
ip dhcp-server enableEnables the DHCP server feature.
no ip dhcp-server mgmtDisables DHCP server on the management port.
ip dhcp-server poolSwitches to pool configuration mode (config-dhcp-name# prompt) and creates an address pool.
ip dhcp-server relay-agent-echo enableEnables relay agent echo (Option 82).
ip dhcp-serverSpecifies the IP address of the selected DHCP server.
show ip dhcp-server bindingDisplays a specific lease entry, or all lease entries.
show ip dhcp-serverDisplays a specific address pool or all address pools.
show ip dhcp-server flashDisplays the lease binding database that is stored in flash memory.
show ip dhcp-server summaryDisplays a summary of active leases, deployed address pools, undeployed address pools, and server uptime.
bootfileSpecifies a boot image to be used by the client.
deployDeploys an address pool configuration to the server.
dhcp-default-routerSpecifies the IP address of the default router or routers for a client.
dns-serverSpecifies the IP addresses of a DNS server or servers available to the client.
domain-nameConfigures the domain name for the client.
leaseSpecifies the lease duration for an address pool. The default is a one-day lease.
excluded-addressSpecifies an address or range of addresses to be excluded from the address pool.
netbios-name-serverSpecifies the IP address of a NetBIOS WINS server or servers that are available to Microsoft DHCP clients.
networkConfigures the subnet network and mask of the DHCP address pool.
next-bootstrap-serverConfigures the IP address of the next server to be used for startup by the client.
tftp-serverConfigures the address or name of the TFTP server available to the client.
vendor-classSpecifies the vendor type and configuration value for the DHCP client.

Drop your comment

0Shares

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *