#####dhcp服务器搭建###
dhcp作用:可以给别的主机纷发动态IP
(desktop) 要有ip 主机下载与系统匹配的安装包dhcp
scp root@172.25.254.100:/mnt/* ##先把172.25.254.100里的软件包下载
ls查看
自己桌面存放的/home/kiosk/Downloads下的dhcp-4.2.5-47.el7.x86_64.rpm
rpm -ivh dhcp-4.2.5-27.el7.x86_64.rpm ##安装dhcp软件包
检查软件是否安装好
rpm -q dhcp (dhcp-4.2.5-27.el7.x86_64.rpm ##表示已经安装好)
cd /etc/dhcp/
ls
vim dhcpd.conf (一定要在/etc/dhcp下建立)
cp /usr/share/doc/dhcp*/dhcpd.conf.example dhcpd.conf
(提示覆盖文件表示输入正确)
route -n ##查询网关(Gateway 172.25.254.250)
vim dhcpd.conf(修改文件内容,Destinationa (IP)172.25.6.0
Gateway网关 172.25.6.250)
vim /etc/vimrc
systemctl restart dhcpd(重启)
systemctl status dhcpd(查看文件状态)activing 成功
(server)主机
ip addr show eth0(显示IP)
nm-connection-editor(删除网络,拔掉网线)
ip addr show eth0(无IP)
cd /etc/sysconfig/network-scripts/
ls
nmcli connection add con-name westos infame eth0 type ethernet autoconnect yes ##设置一个动态网卡
ip addr show eth0(显示IP)