【推荐】ubuntu18.04 搭建DHCP服务器
参考:ubuntu18.04 搭建DHCP(isc-dhcp-server)_
================================
安装服务
sudo apt install isc-dhcp-server
--------------------------
查看IP
ifconfig
--------------------------
编辑isc-dhcp-server
sudo vim /etc/default/isc-dhcp-server
--------------------------
sudo vim /etc/dhcp/dhcpd.conf
dhcpd.conf部分内容
subnet 192.168.188.0 netmask 255.255.255.0 {
range 192.168.188.150 192.168.188.150;
option routers 192.168.188.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.188.255;
option domain-name-servers 192.168.188.1;
option ntp-servers 192.168.188.1;
option netbios-name-servers 192.168.188.1;
option netbios-node-type 8;
}
==============
配置静态地址
--------------------------------
启动服务
sudo service isc-dhcp-server restart
sudo service isc-dhcp-server status
=======================
注意点:
1、先克隆一台ubuntu;
2、dhcp server安装之前,仍为NAT模式;
3、启动服务之前,改为vmnet1模式;
4、dhcp client客户机设为vmnet1,dhcp client可用ip a查看获取的ip;
5、通过sudo dhclient -r ens33释放ip,但要重启一下才有效果;
电脑技术 2024-04-06 14:06:10 通过 网页 浏览(351)
共有0条评论!