当前位置:网站首页>Hcia-r & s self use notes (23) DHCP
Hcia-r & s self use notes (23) DHCP
2022-07-26 23:02:00 【Master basket ladle Xiao Lu】
DHCP(7/26,64min)
DHCP:Dynamic Host Configure Protocol, Dynamic Host Configuration Protocol
UDP encapsulation , The server is 67, The client is 68
dynamic analysis TCP/IP Information (IP Address 、 Subnet mask 、 The default gateway 、DNS The server etc. )
The information to be removed from the allocation is lease ( Default one day ,86400s)
ipconfig /all You can see the beginning and end of the lease
In general ,DHCP The server is on the gateway ( not always )
DHCP System composition :
| DHCP Client( client ) | Need to get... Dynamically IP Address of the host |
| DHCP Server( The server ) | Can provide DHCP Function of the server or network device |
| DHCP Relay( relay ) | Generally, it is network equipment such as router or layer 3 switch |
The topology is as follows :

SW1:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int gi0/0/1
[Huawei-GigabitEthernet0/0/1]p l t
[Huawei-GigabitEthernet0/0/1]p t a vlan all
[Huawei-GigabitEthernet0/0/1]qu
[Huawei]int gi0/0/2
[Huawei-GigabitEthernet0/0/2]p l a
[Huawei-GigabitEthernet0/0/2]p d v 10
[Huawei-GigabitEthernet0/0/2]qu
[Huawei]int gi0/0/3
[Huawei-GigabitEthernet0/0/3]p l a
[Huawei-GigabitEthernet0/0/3]p d v 20SW2:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys SW2
[SW2]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]int vlan 10
[SW2-Vlanif10]ip add 192.168.10.254 24
[SW2-Vlanif10]qu
[SW2]int vlanif 20
[SW2-Vlanif20]ip add 192.168.20.254 24
[SW2-Vlanif20]qu
[SW2]int gi0/0/1
[SW2-GigabitEthernet0/0/1]p l t
[SW2-GigabitEthernet0/0/1]p t a vlan all
[SW2-GigabitEthernet0/0/1]qustay PC1 Capture packets at the interface , Be careful ,PC1、PC2 No address is configured , At this time will be PC1 The address acquisition method of is changed to “DHCP”
as follows , Grab the PC Of DHCP Discovery message (Discover)

DHCP Simple configuration
SW2:
[SW2]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[SW2]int vlanif 10
[SW2-Vlanif10]dhcp select interface
[SW2-Vlanif10]qu
[SW2]int vlanif 20
[SW2-Vlanif20]dhcp select interface here PC1、2 Can get the address , Gateway is Vlanif Address
DHCP Data packets

Common for the first four , The address has been rented out , But there are other hosts that want this address to pass ipconfig /release You can grab DHCP RELEASE package
Discover

I want something ( Mask 、 gateway ……)
Offer

What can I give you
There are two kinds left

why Request It's also a radio ?
Because there may be multiple DHCP The server , You may receive more than one after the broadcast DHCP Server's Offer, The host gets the first Offer
Request Radio represents me only from multiple Offer Choose one of them
DHCP Lease term

Be careful , The Request For unicast ( Ask the landlord to renew the lease );
The access switch port corresponding to the host is not set with a fast port (Portfast) Or edge port (Edged-Port) Words , The host at the bottom needs to wait stp convergence 30s(discarding To forwarding)

if 50% when , The server did not respond , be 87.5% Then broadcast ( In a hurry )
Didn't rent a house ( Sleeping Street )169.254.x.x
Automatic retention IP
APIPA(Automatic Private IP Addressing)
Window The client cannot access the DHCP Server When renting an address , Automatically use the network number as 169.254.0.0/16 Private address of , Only for those in the same situation PC Temporary communications
DHCP I'm sorry : Manually configure the address and ping DHCP The server , Check connectivity
Win Medium DHCP Client It also needs to be turned on ( If it does not start , Won't grab Discover package )
Lease term setting suggestions
Set short : Increase the network burden , It is suitable for many clients ( Mobile places , Such as airport 、 Station 、 The mall )
The setting is longer : Lighten the burden of the Internet ( Fixed place , Such as family 、 Enterprises )
The server only takes back the address after the lease expires , No matter whether the other party turns on ,
Windows The last rented address will be recorded , After the lease term discover There will be requested ip( That is, the last address ), If the environment is changed at this time ( From the company to home ), Then the other party ( The other dhcp The server ) Will refuse the request , At this point DHCP NAK Data packets
IP Address release
Or the customer takes the initiative to release ,ipconfig /release(Windows), At this time DHCP Server send out Release message
Or passively release , The server didn't respond before the lease expired , Or the shutdown time exceeds the lease term
DHCP Address pool

DHCP To configure
| dhcp enable | Global on DHCP function |
| dhcp select interface | Associate interfaces with interface address pools ( The gateway is the interface address ) |
| dhcp server dns-list x.x.x.x | Configure the interface address pool DNS The server ( You can configure multiple ) |
| dhcp server lease Numbers | Configure interface address pool lease , default 1 God |
| dhcp server excluded-ip-address x.x.x.x | Configure the excluded address range of the interface address pool |
| dhcp select global | Associate interfaces and global address pools ( The interface address is not a gateway , Such as VRRP、DHCP-Relay scene ) |
| ip pool name | Create a global address pool and name |
| network x.x.x.x | Configure the assignable network segment address of the global address pool |
| gateway-list x.x.x.x | Configure the gateway of the global address pool |
| dns-list x.x.x.x | Configure the configuration of the global address pool DNS Address ( You can configure multiple ) |
| lease Numbers | Configure the lease term under the global address pool , default 1 God |
| excluded-ip-address x.x.x.x | Configure the discharge address range under the global address pool |
| display ip pool [interface gi0/0/x all] | View the properties of the address pool |
Wireless router's DNS You can be yourself (192.168.1.1) Help forward domain name resolution to operators
The spanning tree has a small chapter to fill , I feel dizzy , Your mother
边栏推荐
- 工作一年后,我有些感悟(写于2017年)
- Introduction to MySQL database
- Day07 MySql知识点再总结与多表查询
- 2022-07-26:以下go语言代码输出什么?A:5;B:hello;C:编译错误;D:运行错误。 package main import ( “fmt“ )
- The secret weapon of apple iphone11 series: U1 chip may usher in the era of ultra wideband
- 【HCIP】OSPF 外部路由引入
- A13 processor has become the biggest highlight of iphone11 series: its performance is twice that of Kirin 980!
- Introduction to Nacos as a registry and configuration center - realize remote call, dynamically obtain configuration files and database configuration information
- MySQL summarizes common scenarios of MySQL index failure
- Why am I still writing articles on CSDN? A journey of accompanying learning.
猜你喜欢
随机推荐
CSRC: agree to the IPO registration of Chuanyin holding science and Technology Innovation Board
比海豹便宜,造型炸裂空间大,20万左右真没对手?长安全新“王炸”这样选才划算
2022-07-26:以下go语言代码输出什么?A:5;B:hello;C:编译错误;D:运行错误。 package main import ( “fmt“ )
Let the program do one thing in one or more seconds
华为密谋收购巴西运营商?
继关闭苏州厂之后,欧姆龙东莞厂宣布解散,2000多人面临失业!
杭州银行面试题【杭州多测师】【杭州多测师_王sir】
Summary of shell related commands
推动ARM服务器芯片替代X86,华为、飞腾扛起国产化大旗!
Huawei atlas900 reveals the secret: it integrates thousands of shengteng 910 chips, and its computing power is comparable to 500000 PCs!
Day07 MySql知识点再总结与多表查询
Embedded sig | distributed soft bus
New employees of black maredge takeout
HCIA-R&S自用笔记(19)VLAN配置及实验、VLAN间路由
Implementation principle of semaphore in golang
【无标题】
Ribbon load balancing
苹果iPhone11系列的秘密武器:U1芯片或将开启超宽带时代
Mate30系列发布:华为的重构影像之路还能走多远?
HCIA-R&S自用笔记(18)园区网架构基础、交换机工作原理、VLAN原理








![[postgresql]postgresqlg使用enerate_series() 函数补全统计](/img/62/893986eb97a61f4e9ef32abc8d2a90.png)
