Linux基礎學習-使用DHCP動態管理主機地址

動態主機配置協議

部署dhcpd服務程序

參數 做用
ddns-update-style none; 設置DNS服務不自動進行動態更新
ignore client-updates; 忽略客戶端更新DNS記錄
subnet 192.168.56.0 netmask 255.255.255.0 做用域爲192.168.56.0/24網段
range 192.168.56.50 192.168.56.200 IP地址池
option subnet-mask 255.255.255.0 子網掩碼
option routers 192.168.56.2 客戶端網關地址
option domain-name "linux.com" 默認搜索域
option domain-name-servers 192.168.56.2 客戶端DNS地址
default-lease-time 21600 默認租約時間
max-lease-time 43200 最大預定時間
hardware ethernet 該主機mac地址
fixed-address 欲指定的ip地址
[root@qdlinux ~]# yum install dhcp -y
//編輯dhcpd服務程序配置文件
vim /etc/dhcp/dhcpd.conf
ddns-update-style none;
ignore client-updates;
subnet 192.168.65.0 netmask 255.255.255.0 {
    range 192.168.65.50 192.168.65.200;
    option subnet-mask 255.255.255.0;
    option routers 192.168.65.1;
    option domain-name-servers 192.168.65.1;
    default-lease-time 21600;
    max-lease-time 43200;
}
//重啓服務並加入開機自啓動
//分配固定IP地址
//tail -f /var/log/messages

host linuxprobe {
    hardware ethernet 00:0c:29:27:c6:12;
    fixed-address 192.168.65.88;
}
相關文章
相關標籤/搜索