当前位置:网站首页>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:文件根目录
边栏推荐
- All you know is the test pyramid?
- Echart's experience (I): about y axis yaxis attribute
- 解决笔记本键盘禁用失败问题
- Model effect optimization, try a variety of cross validation methods (system operation)
- 首次曝光 唯一全域最高等级背后的阿里云云原生安全全景图
- 4-操作列表(循环结构)
- [测试开发]初识软件测试
- [C language] system date & time
- 2022 PMP project management examination agile knowledge points (1)
- 51 single chip microcomputer_ External interrupt and timer / Counter interrupt
猜你喜欢

1-4metaploitable2 introduction

SCM stm32f103rb, BLDC DC motor controller design, schematic diagram, source code and circuit scheme

快速读论文----AD-GCL:Adversarial Graph Augmentation to Improve Graph Contrastive Learning
![[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

Swift 基礎 閉包/Block的使用(源碼)

不止于观测|阿里云可观测套件正式发布

GraphMAE----論文快速閱讀

For a detailed explanation of flex:1, flex:1

Simple summary of lighting usage

模型效果优化,试一下多种交叉验证的方法(系统实操)
随机推荐
Keep one decimal place and two decimal places
Vscode topic recommendation
Installation and use of selenium IDE
Gossip: what happened to 3aC?
GraphMAE----論文快速閱讀
3D数学基础[十七] 平方反比定理
OC extension detects whether an app is installed on the mobile phone (source code)
Practice of opengauss database on CentOS, configuration
Four models of iPhone 13 series have been exposed, and indeed, they are 13 fragrant!
研究生英语期末考试复习
4-operation list (loop structure)
[测试开发]初识软件测试
Swift 基础 Swift才有的特性
auto使用示例
Simple refraction effect
Saccadenet: use corner features to fine tune the two stage prediction frame | CVPR 2020
你还只知道测试金字塔?
Learning event binding of 3D visualization from scratch
Search and recommend those things
Swift Extension ChainLayout(UI的链式布局)(源码)