大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全家桶1年46,售后保障稳定
文章目录
实验环境说明
主机系统 | 系统版本 | 获取IP地址方式 | IP地址 | |
---|---|---|---|---|
服务端 | Linux | RHEL 7.0 | 静态IP | 192.168.43.128/24 |
客户端 | Linux | RHEL 7.4 | DHCP分配固定IP | 192.168.43.15/24 |
客户端 | Windows | Windows 11 | DHCP自动随机分配 | x.x.x.x |
注意事项
- 在使用两台Linux主机时,一定要保证两台设备之间可以互相连通,可以先配置静态IP,测试两台主机之间是否是连通的
- 虚拟网络编辑器中,不要使用
使用本地DHCP服务将IP地址分配给虚拟机
- 两台设备都是使用
仅主机模式
,或者使用相同的VMnet接口
服务器配置
配置服务器的IP地址
- 为服务器配置IP地址,并重启网卡,使配置生效
[root@Server ~]# vim /etc/sysconfig/network-scripts/ifcfg-eno16777736
[root@Server ~]# cat /etc/sysconfig/network-scripts/ifcfg-eno16777736
TYPE=Ethernet
BOOTPROTO=static
NAME=eno16777736
DEVICE=eno16777736
ONBOOT=yes
IPADDR=192.168.43.128
NETMASK=255.255.255.0
GATEWAY=192.168.43.1
DNS1=8.8.8.8
[root@Server ~]# systemctl restart network
- 分配的IP地址必须和配置的静态IP地址在同一个网段
- 这里的
ifcfg-ens33
为我的网卡名,不同版本的系统,网卡名会存在差异,具体的根据自己的网卡名进行配置,NAME
、DEVICE
与网卡名都要保持一致
配置本地YUM仓库
- 首先需要使用RHEL的ISO镜像,并连接到连接虚拟机
- 将镜像文件进行挂载
[root@Server ~]# mount /dev/cdrom /mnt/
mount: /dev/sr0 写保护,将以只读方式挂载
[root@Server ~]#
- 配置YUM仓库,使用本地的ISO镜像文件进行安装。如果虚拟机已经连接网络,也可以使用网络源进行软件包的安装
[root@Server ~]# cd /etc/yum.repos.d/
[root@Server yum.repos.d]# rm -rf * //删除此目录下的所有其他源配置
[root@Server yum.repos.d]# vim rhel.repo //配置新的源文件
[root@Server yum.repos.d]# ls
rhel.repo
[root@Server yum.repos.d]# cat rhel.repo
[Base]
name=RHEL //仓库名
baseurl=file:///mnt //使用的仓库源,file://为固定格式,/mnt表示本地软件包所在的目录
gpgcheck=0 //是否进行检查验证
enabled=1 //是否启用本仓库
- 如果/etc/yum.repos.d/目录下还有其他的
.repo
文件,则使用rm -rf *
全部删除。避免使用了其他的源文件。
- 清除软件包缓存
[root@Server yum.repos.d]# yum clean all
已加载插件:langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
正在清理软件源: Base
Cleaning up everything
[root@Server yum.repos.d]#
- 重新加载软件包
[root@Server yum.repos.d]# yum repolist all
已加载插件:langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Base | 4.1 kB 00:00
(1/2): Base/group_gz | 137 kB 00:00
(2/2): Base/primary_db | 4.0 MB 00:00
源标识 源名称 状态
Base RHEL 启用: 4,986
repolist: 4,986
[root@Server yum.repos.d]#
repolist:4,986
:表示有可用的软件包数量,如果没有,则检查本地源文件的配置。
安装DHCP软件包
- 使用YUM工具安装DHCP软件包
[root@Server ~]# yum -y install dhcp
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package dhcp.x86_64 12:4.2.5-58.el7 will be installed
...
Installed:
dhcp.x86_64 12:4.2.5-58.el7
Dependency Updated:
dhclient.x86_64 12:4.2.5-58.el7 dhcp-common.x86_64 12:4.2.5-58.el7
dhcp-libs.x86_64 12:4.2.5-58.el7
Complete!
[root@Server ~]#
- 复制DHCP的默认配置文件到DHCP的配置目录中
[root@Server ~]# cd /etc/dhcp/
[root@Server dhcp]# ls
dhclient.d dhclient-exit-hooks.d dhcpd6.conf dhcpd.conf scripts
[root@Server dhcp]# cat dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
[root@Server dhcp]# cat /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example | grep -v "#" >> dhcpd.conf
[root@Server dhcp]# ls
dhclient.d dhclient-exit-hooks.d dhcpd6.conf dhcpd.conf scripts
[root@Server dhcp]#
/usr/share/doc/dhcp-4.2.5/dhcpd.conf.example
:为DHCP的默认配置文件,根据不同的DHCP软件包的版本不同,需要修改/usr/share/doc/
下的DHCP版本grep -v "#" >> dhcpd.conf
:表示将默认配置文件中的注释行删除,然后重新追加到dhcpd.conf文件中
- 修改DHCP的配置文件,根据需求进行相关的配置
[root@Server dhcp]# vim dhcpd.conf
[root@Server dhcp]# cat dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
subnet 192.168.43.0 netmask 255.255.255.0 {
//配置DHCP服务器可以分配的地址网段以及子网掩码
range 192.168.43.20 192.168.43.40; //配置DHCP服务器可以分配的地址范围
option domain-name-servers 192.168.43.128; //配置DNS服务器的IP地址
option routers 192.168.43.1; //配置默认网关
default-lease-time 600; //配置默认租期,单位是秒
max-lease-time 7200; //配置最大租期,单位是秒
}
host RHEL_Client_7.4 {
//为特殊的主机单独配置
hardware ethernet 00:0c:29:9e:9b:29; //需要绑定固定IP的主机MAC地址
fixed-address 192.168.43.15; //为主机绑定固定IP地址
}
- 对于配置文件的修改,尽量不在源文件上进行修改,先进行复制,将源内容进行注释,做好备份,以免配置错误无法回滚。
- 如果不需要对特殊的主机分配固定的IP地址,则不需要配置host
配置防火墙和SELinux
- 防火墙放行DHCP服务
[root@Server ~]# systemctl status firewalld.service
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
Active: active (running) since 四 2021-12-09 10:10:32 CST; 6min ago
Main PID: 4060 (firewalld)
CGroup: /system.slice/firewalld.service
└─4060 /usr/bin/python -Es /usr/sbin/firewalld --nofork...
12月 09 10:10:32 Server systemd[1]: Started firewalld - dynamic ....
Hint: Some lines were ellipsized, use -l to show in full.
[root@Server ~]# firewall-cmd --permanent --add-service="dhcp" //防火墙放行DHCP服务
success
[root@Server ~]# firewall-cmd --reload //重新加载防火墙放行规则
success
[root@Server ~]# firewall-cmd --list-all //列出防火墙放行的所有服务
public (default, active)
interfaces: eno16777736
sources:
services: dhcp dhcpv6-client ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
[root@Server ~]#
Active: inactive (dead)
:表示防火墙已经关闭Active: active (running)
:表示防火墙已经开启
- 关闭SELinux
[root@Server ~]# vim /etc/selinux/config
[root@Server ~]# cat !$ | grep -v "#" | grep -v "^$"
SELINUX=disabled
SELINUXTYPE=targeted
[root@Server ~]#
!$
:表示上一条命令的最后一个参数grep -v "#" | grep -v "^$"
:表示过滤注释行和空行
启动DHCP服务
- 启动DHCP服务
[root@Server ~]# systemctl restart dhcpd.service //重新启动DHCP服务
[root@Server ~]# systemctl enable dhcpd.service //设置开机自启动
[root@Server ~]# systemctl status dhcpd.service //查看DHCP的运行状态
dhcpd.service - DHCPv4 Server Daemon
Loaded: loaded (/usr/lib/systemd/system/dhcpd.service; disabled)
Active: active (running) since 四 2021-12-09 11:09:00 CST; 8s ago
Docs: man:dhcpd(8)
man:dhcpd.conf(5)
Main PID: 8274 (dhcpd)
Status: "Dispatching packets..."
CGroup: /system.slice/dhcpd.service
└─8274 /usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -gr...
客户端配置
- 将客户端的IP地址获取方式修改为通过DHCP动态获取,并重新启动网卡
[root@Client ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
[root@Client ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
BOOTPROTO=dhcp //配置为通过DHCP获取IP地址
NAME=ens33
DEVICE=ens33
ONBOOT=yes //配置开机自启动
# 配置静态IP地址
#IPADDR=192.168.43.131
#NETMASK=255.255.255.0
#GATEWAY=192.168.43.254
#DNS1=8.8.8.8
[root@Client ~]# systemctl restart network
查看客户端的IP地址
- 使用
ifconfig
或者ip a
查看本机的IP地址
[root@Client ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.43.15 netmask 255.255.255.0 broadcast 192.168.43.255
inet6 fe80::20c:29ff:fe9e:9b29 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:9e:9b:29 txqueuelen 1000 (Ethernet)
RX packets 2961 bytes 275996 (269.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1347 bytes 169005 (165.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 420 bytes 34416 (33.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 420 bytes 34416 (33.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@Client ~]#
ether 00:0c:29:9e:9b:29
:表示本机网卡的MAC地址,在服务器配置主机与IP绑定时,则需要查看本机网卡的MAC地址- 可以看到本机的IP地址为
192.168.43.15
,即为DHCP服务器分配的IP地址
查看Windows客户端IP地址
-
配置Windows客户端的VMnet 1网卡的IP地址获取方式为DHCP
-
查看IP地址信息
服务端查看DHCP的日志文件
- 在服务端查看DHCP的日志文件,查看具体的地址分配信息
[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
1">[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
1[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
0">[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
0PV0[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
0">[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
0[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
1">[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
1";
client-hostname "Hasee-Bad";
}
server-duid "[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
0">[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
0[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
1">[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
1[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
0">[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
0[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
1">[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
1)D45[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
0">[root@Server ~]# cat /var/lib/dhcpd/dhcpd.leases
# The format of this file is documented in the dhcpd.leases(5) manual page.
# This lease file was written by isc-dhcp-4.2.5
lease 192.168.43.20 {
starts 4 2021/12/09 02:46:58;
ends 4 2021/12/09 02:56:58;
tstp 4 2021/12/09 02:56:58;
cltt 4 2021/12/09 02:46:58;
binding state free;
hardware ethernet 00:0c:29:9e:9b:29;
}
lease 192.168.43.21 {
starts 5 2021/12/10 06:57:31;
ends 5 2021/12/10 07:07:31;
cltt 5 2021/12/10 06:57:31;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 00:50:56:c0:00:01;
uid "\001\000PV\300\000\001";
client-hostname "Hasee-Bad";
}
server-duid "\000\001\000\001)D\034\305\000\014)I\346\331";
[root@Server ~]#
04)I61";
[root@Server ~]#
/var/lib/dhcpd/dhcpd.leases
:为DHCP的日志文件
以上内容均属原创,如有不详或错误,敬请指出。
CC BY-NC-SA 4.0 许可协议。转载请联系作者注明出处并附带本文链接!
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/210134.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...