溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

redhat7.3-dhcp和dhcp中繼服務器配置

發(fā)布時間:2020-07-01 13:28:48 來源:網(wǎng)絡 閱讀:1896 作者:fxl風 欄目:建站服務器

1.設置host、firewald、selinux 

hostnamectl set-hostname fengxiaoli41.com

systemctl stop firewalld.service

systemctl disable firewalld.service 

setenforce 0

2.配置基本dhcp服務

yum install -y dhcp

vim /etc/dhcp/dhcpd.conf

#全局參數(shù)

option domain-name "fengxiaoli41.com";

option domain-name-servers dns.fengxiaoli41.com;

default-lease-time 600;

max-lease-time 7200;

authoritative;

log-facility local7;

#配置192.168.1.0網(wǎng)段動態(tài)獲取

subnet 192.168.1.0 netmask 255.255.255.0 {

range dynamic-bootp 192.168.1.20 192.168.1.254;

option broadcast-address 192.168.1.255;

option routers 192.168.1.1;

}

#配置192.168.1.0網(wǎng)絡給該mac分配固定ip

host feng {

#hardware ethernet MAC

fixed-address 192.168.1.5;

}

systemctl restart dhcpd

systemctl status dhcpd

-------------至此客戶端可以獲取動態(tài)和固定ip

3.中繼服務器

vim /etc/dhcp/dhcpd.conf

#配置192.168.2.0dhcp中繼網(wǎng)段(若沒有中)

subnet 192.168.2.0 netmask 255.255.255.0 {

range dynamic-bootp 192.168.2.20 192.168.2.254;

option broadcast-address 192.168.2.255;

option routers 192.168.2.254;

}

cp /lib/systemd/system/dhcrelay.service /etc/systemd/system/

cd /etc/systemd/system/

vim dhcrelay.service

[Service]

ExecStart=/usr/sbin/dhcrelay -d --no-pid 192.168.1.10

4.重啟服務

systemctl --system daemon-reload

systemctl restart dhcrelay.service

 注:配置之前先要保證dhcp服務器和中繼服務器網(wǎng)絡互通,dhcp服務器為192.168.1.0網(wǎng)段,中繼服務器192.168.2.0網(wǎng)段。另外也可在dhcp服務器上添加兩塊網(wǎng)卡,將中繼服務器與dhcp服務器配置在同一服務器上。

向AI問一下細節(jié)
推薦閱讀:
  1. DHCP中繼原理
  2. DHCP中繼

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI