当前位置:网站首页>dhcp、tftp基础
dhcp、tftp基础
2022-06-24 06:56:00 【BusyOps】
一、DHCP相关
早期硬盘曾经是一种非常稀缺的资源,那个时候无盘工作站非常流行,每台工作站没有操作系统,开机时都要到服务器上去加载服务器提供的操作系统到内存中,为了能让其到服务器上获取到必要的文件,诞生了一种协议叫做bootp(boot protocol),其可以借助带有自我唤醒功能的网卡发送广播报文去服务器上申请IP地址,而后服务器再将工作站需要的操作系统文件发送之,但是其分配IP地址为永久分配。所以后来就出现了DHCP(Dynamic Host Configuration Protocol),其引入了租期的概念
1. 工作流程
- 第一步(dhcp discover):客户端开机后,因自身并没有IP地址,所以通过RARP进行广播寻找DHCP服务器
- 第二步(dhcp offer):服务器端收到广播后,会分配给客户端IP、MASH、GW、DNS等等
- 第三步(dhcp request):客户端可能会收到多个dhcp服务器的回应,它会在多个服务端选择一个并发送dhcp请求使用报文,这个报文也是广播的,意思我选定某台dhcp服务器,而后未被选中的dhcp服务器将刚分配的地址回收
- 第四步(dhcp ack):dhcp发送确认报文,也是广播
2. 续租
- 50%:当ip地址的租期剩余百分之50的时候,客户端就会联系dhcp服务器申请续租,如未响应则进行下步
- 75%:当ip地址的租期剩余百分之75的时候,客户端就会联系dhcp服务器申请续租,如未响应则进行下步
- 87.5%:当ip地址的租期剩余百分之87.5的时候,客户端就会联系dhcp服务器申请续租,如未响应则会重新发起dhcp discover
3、安装及相关文件
软件包名称为dhcp,可直接使用yum install dhcp -y安装
/etc/dhcp/dhcpd.conf:配置文件/etc/dhcp/dhcpd6.conf:ipv6的配置文件/usr/sbin/dhcpd:/usr/sbin/dhcrelay:中继器程序文件/var/lib/dhcpd/dhcpd.leases:dhcp的分配情况记录/usr/lib/systemd/system/dhcpd.service:Uint文件/usr/lib/systemd/system/dhcpd6.service:Unit文件/usr/lib/systemd/system/dhcrealy.service:Unit文件
4、配置相关指令
option domain-name "string"; :指明除了IP和掩码以外,需要分配的其他属性
option domain-name-servers "string"; :DNS服务器地址
default-liease-time #; :默认租约期限,单位秒钟
max-lease-time #; :最大租约期限
log-facility:定义日志
subnet <IP> netmask <MASK> {
:指明需要负责哪个网段
range <START_IP> <STOP_IP>; :指明可分配的起止地址
option routers IP :指明分配的网关地址
}
5、示例配置
option domain-name "busyops.org";
option domain-name-servers 8.8.8.8;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.70.0 netmask 255.255.255.0 {
range 192.168.70.100 192.168.70.250;
option routers 192.168.70.254;
}
二、TFTP相关
全称为简单文件传输协议(Trivial File Transfer Protocol),主要负责无盘工作站的引导。可以直接使用yum install tftp tftp-server安装
1. 相关文件
/usr/sbin/in.tftpd:程序文件/etc/xinetd.d/tftp:配置文件/usr/lib/systemd/system/tftp.service:Unit文件/usr/lib/systemd/system/tftp.socket/var/lib/tftpboot:文件根目录
边栏推荐
- Atguigu---16-custom instruction
- 51单片机_外部中断 与 定时/计数器中断
- Dart development server, do I have a fever?
- 搜索与推荐那些事儿
- Swift extension networkutil (network monitoring) (source code)
- The applet reads more than 20 data, and the cloud function reads more than 100 restrictions
- Use of swift basic closure /block (source code)
- Methods of vector operation and coordinate transformation
- [test development] first knowledge of software testing
- 5g industrial router Gigabit high speed low delay
猜你喜欢
![[data update] Xunwei comprehensively upgraded NPU development data based on 3568 development board](/img/10/6725b51120a6ae8b16d60f5b1ae904.jpg)
[data update] Xunwei comprehensively upgraded NPU development data based on 3568 development board

Pagoda panel installation php7.2 installation phalcon3.3.2

Model effect optimization, try a variety of cross validation methods (system operation)
![[008] filter the table data row by row, jump out of the for cycle and skip this cycle VBA](/img/a0/f03b8d9c8f5e53078c38cce11f8ad3.png)
[008] filter the table data row by row, jump out of the for cycle and skip this cycle VBA

OC Extension 检测手机是否安装某个App(源码)

Graphmae - - lecture rapide des documents

有关iframe锚点,锚点出现上下偏移,锚点出现页面显示问题.iframe的srcdoc问题

Swift 基础 闭包/Block的使用(源码)

Practice of opengauss database on CentOS, configuration

Leetcode 207: course schedule (topological sorting determines whether the loop is formed)
随机推荐
Introduction to software engineering - Chapter 2 - feasibility study
How to cancel the display of the return button at the uniapp uni app H5 end the autobackbutton does not take effect
You get in Anaconda
Easyplayerpro win configuration full screen mode can not be full screen why
Online education fades
Swift Extension NetworkUtil(网络监听)(源码)
Vulnhub靶机:BOREDHACKERBLOG_ CLOUD AV
SCM stm32f103rb, BLDC DC motor controller design, schematic diagram, source code and circuit scheme
Echart 心得 (一): 有关Y轴yAxis属性
On the H5 page, the Apple phone blocks the content when using fixed to locate the bottom of the tabbar
Atguigu---16-custom instruction
工控机防破解
How does dating software cut your leeks
Getting started with crawler to giving up 06: crawler play Fund (with code)
Qopengl display point cloud file
基金的募集,交易与登记
Model effect optimization, try a variety of cross validation methods (system operation)
[ACNOI2022]做过也不会
Standing at the center of the storm: how to change the engine of Tencent
对于flex:1的详细解释,flex:1