[LAB5] Dhcp
In a dynamic IP address scenario, each computer does not set a fixed IP address, but only when the computer is powered on
is assigned an IP address, which is referred to as a DHCP client. assigning IP to DHCP clients
is called a DHCP server. This means that DHCP is in client/server (client/server) mode,
Clear division of client and server roles.
The working process for DHCP is as follows:
1. When the DHCP client starts, the client broadcasts the DHCPDISCOVER message to DHCP in the current subnet
The server requests an IP address.
2. When the DHCP server receives the DHCPDISCOVER message, it will be from the address range for that host
It provides an IP address that has not been assigned and temporarily marks the provided IP address as unavailable. Server to
The DHCPOFFER message is sent back to the host. If the network contains more than one DHCP server, the client can
Can receive several Dhcpoffer messages, the client usually only admits the first dhcpoffer.
3. After the client receives the DHCPOFFER, it sends a message to the server containing the IP provided by the DHCP server
Address of the DHCPREQUEST message. If the client does not receive the DHCPOFFER message and remembers the previous network
Configuration, using the previous network configuration (if the configuration is still within the validity period).
4. The DHCP server sends back a reply to the client that contains the IP address that was originally issued and its allocation scheme
Message (DHCPACK).
5. The client receives the DHCPACK message containing the configuration parameters and uses ARP to check if there is a phase on the network
The same IP address. If the check passes, the client accepts the IP address and its parameters, and if a problem is found, the customer
The machine sends DHCPDecline information to the server and restarts the new configuration process. Server received
DHCPDecline the information, mark the address as unavailable.
6. The DHCP server can only assign that IP address to a DHCP client for a certain amount of time, and the DHCP client must
Update the lease before it expires. After the client's 50% lease time has elapsed, requests are initiated at every time
The DHCP server updates the current lease, and the lease is postponed if the DHCP server answers. If the DHCP server is always
No answer, at 87.5% of the valid lease period, the customer should communicate with any other DHCP server and request
Updates its configuration information. If the client cannot contact all DHCP servers, the lease time is
You must discard the current IP address and resend a DHCPDISCOVER message to start the above IP address obtained
Ride.
7. The client can proactively send a dhcprelease message to the server, releasing the current IP address.
1-DHCP Basic Configuration
R1 (config) #service DHCP//Turn on DHCP service
R1 (config) #no ip dhcp conflict logging//shutdown DHCP conflict log
R1 (config) #ip DHCP pool CCIE//define address pool
R1 (dhcp-config) #network 192.168.1.0/24//dhcp The network and mask to be assigned by the server
R1 (dhcp-config) #domain-name cisco.com//Domain name
R1 (dhcp-config) #default-router 192.168.1.1
Default gateway, this address is the same as the Ethernet port address of the router connected to the corresponding network
R1 (dhcp-config) #netbios-name-server 192.168.1.2//wins Server
R1 (dhcp-config) #dns-server 192.168.1.4//dns Server
R1 (dhcp-config) #option IP 192.168.1.3//tftp Server
R1 (dhcp-config) #lease infinite//definition tenancy (defined here is infinite)
R1 (config) #ip dhcp excluded-address 192.168.1.1 192.168.1.5//excluded address segments
650) this.width=650; "title=" clip_image002 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image002" src= "http://s3.51cto.com/wyfs02/M00/6F/81/wKiom1WeJEGS59SxAACggqlQ3Vs862.jpg" height= "/>"
2-DHCP Relay
650) this.width=650; "title=" clip_image004 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image004" src= "http://s3.51cto.com/wyfs02/M01/6F/81/wKiom1WeJESSogvRAADlhlAk31g119.jpg" height= "341"/>
R1: Configuring
R1#sh Run | SE ip dhcp pool
IP DHCP Pool CCNP
Network 192.168.0.0 255.255.255.0
Domain-name lab.com
Default-router 192.168.0.1
Dns-server 192.168.0.1
Lease 0 4
IP DHCP Pool CCIE
Network 192.168.1.0 255.255.255.0
Domain-name lab.com
Default-router 192.168.1.1
Dns-server 192.168.1.1
Lease 0 4
R2:
R2 (config) #int F0/1
R2 (config-if) #ip helper-address 12.1.1.1 \ \ Configure DHCP Relay
R1 run RIP announces 12.1.1.0 and 192.168.0.X
R2 run RIP announces 12.1.1.0 and 192.168.1.X
Client:
R4#sh Run int F0/1
Interface FASTETHERNET0/1
IP address DHCP
No shut
650) this.width=650; "title=" clip_image006 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;margin:0px;border-left:0px;padding-right:0px; "border=" 0 "alt = "clip_image006" src= "http://s3.51cto.com/wyfs02/M02/6F/81/wKiom1WeJEfgcQY5AADvNi28fRk229.jpg" height= "216"/>
650) this.width=650; "title=" clip_image008 "style=" border-top:0px;border-right:0px;background-image:none; border-bottom:0px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px, "border=" 0 "alt=" clip_ image008 "src=" http://s3.51cto.com/wyfs02/M01/6F/81/wKiom1WeJEnzAT3SAAEvpyImuRQ056.jpg "height=" 285 "/>
3-Command Summary
Show ip DHCP pool view information for DHCP address pool
show ip DHCP binding view DHCP address binding condition
show ip DHCP database view DHCP databases
show IP interface Viewing interface information
Debug IP DHCP server events dynamically viewing DHCP servers
Service DHCP to turn on DHCP services
No IP DHCP conflict logging shutdown DHCP conflict log
IP DHCP pool configuration DHCP-assigned address pool
Network and mask to be assigned by the networking DHCP Server
Default-router Default Gateway
Domain-name Domain Name
Netbios-name-server WINS Server
Dns-server Domain Name server
Option-IP FTP server
Lease Configure lease Period
IP DHCP excluded-address exclude address segments
IP helper-address Configuring the address of a DHCP relay
This article from the "Erick" blog, declined to reprint!
[LAB5] Dhcp