Training purpose
Project Background
DHCP service
DHCP server software
Start
Install dhcp
[root@localhost ~]# yum install -y dhcp
[root@localhost ~]# vim /etc/dhcp/dhcp.conf
Copy the things inside.
After the copy is entered again,
you can keep the parameters you need to use.
Comment out the following things here, and the following are all comments
ddns-update-style none:参数设置为none,不设置动态更新
sbunet:作用域的声明
rang:地址范围
option domain-name-servers :DNS服务器地址
option domain-name:域名,这里实验给删除了,
option routers:客户端分配的对应的网
option broadcast-address:广播地址,,删除掉,这里的项目没有要求,
default-lease-time 600:默认租约时间,DHCP将IP地址分配给客户端的时间,不是永久使用的,需要继续使用客户端需要申请
max-lease-time 7200:最大租约时间
After configuring as required
Change a Redhat to enter the configuration, select VMnet1 network card host only mode,
view the Mac address,
return to the first host for configuration
The host name of the host can be defined by yourself
service dhcpd start 启动服务
chkconfig dhcpd on
Confirm firewall
Linux configuration client
Enter the second child Redhat to
automatically obtain and enable the network card.
Restart the network (here both virtual machines are VMnet1 network cards) and send out dhcp requests.
Check the gateway
Check the dns server
The monitoring log can be viewed on the server
Windows configuration client
使用网卡VMnet1
cmd进入网络连接模式:ncpa.cpl
将IP和DNS设置为自动获取
将网落禁用重启一下
查看一下获取的IP信息
-
Super scope
Back to the server,
increase shared-network test {}
increase the scope and change the IP
Add virtual network card sub-interface,
delete UID and
Restart the network service and check the network card information
Restart the dhcp service
Enter the Linux client to restart the network service and check the fixed IP
Back to the server configuration file
Check that the fixedly assigned IP address is indeed 192.168.1.100, indicating no problem
Enter Windows to disable the network restart so that it can restart to obtain an IP address (the IP address is still 192.168.1.3, because the IP address of the first scope has not been used up and is still within the lease time)
DHCP relay agent (across the gateway host to assign an IP address to another host, which means cross-network allocation)
**服务器VMnet1网卡
网关主机配置VMnet1和VMnet2网卡
Windows xp配置VMnet2网卡(作为客户端使用)
中继:Windows客户端会发送IP地址分配请求给中继转给DHCP服务器来获取动态IP地址**
Enter DHCP server configuration
Modify the DHCP server
vim /etc/dhcp/dhcp.conf
Remove the super function (here, if you configure the relay separately in the future, you should pay attention to the configuration and declare two network segments, here because the above experiment has been declared. 192.168.1.1 is the DHCP network segment, and 192.168.0.0 is the gateway host and client network segment)
start
configure the relay server
to assign a static IP address
address to check out the DHCP server
continues configured on the relay server (this time can no longer use the address assigned by DHCP)
close networking tools
into the catalog
card configuration (DHCP is connected)
to increase card After adding the configuration file,
delete the UID and MAC address and configure the IP (the IP address here is the gateway in the dhcp.conf file in the DHCP server).
Restart the network service
test
DHCP server configuration gateway
Enter the DHCP server.
View the gateway.
First stop deleting the previously configured sub-interface.
View the route.
Add a static route (via refers to the next hop) and
return to the relay server.
Modify the kernel
Change to 1 to
enable
yum install dhcp -y 安装dhcp
View dhcp-related configuration files
Modify configuration files
Provide DHCP relay service for eth0 and eth1, DHCP server is 192.168.1.1
Start service dhcrelay
enters Windows client test,
restart the network card, it will automatically obtain an IP,
you can view the log on the DHCP server
Two experiments
complete configuration