您好,登錄后才能下訂單哦!
1.服務端
(1) 配置服務器為ip靜態
1.通過圖形修改 :nm-connection-editor
2.配置Yum源
cd /etc/yum.repos.d
ls
vim rhel_dvd.repo 配置yum源
yum inatll dhcp 安裝dhcp
yum clean all 清空yum緩存
3.vim /etc/dhcp/dhcpd.conf 查看配置文件
cp /usr/share/doc/dhcp/dhcpd.conf.example(配置文件模板) 復制配置文件模板到/etc/dhcp/dhcpd.conf
5.vim /etc/dhcp/dhcpd.conf 修改配置文件
**編輯內容**
6 # option definitions common to all supported networks...
? 7 option domain-name "westos.com";???????????????????????? 域名
? 8 option domain-name-servers 172.25.254.250;?????????? dns地址
?9
10 default-lease-time 600;??????????????????????????????? 默認租約期限
11 max-lease-time 7200;????????????????????????????????? 最長租約期限
12?
13 # Use this to enble / disable dynamic dns updates globally.
14 #ddns-update-style none;
15?
16 # If this DHCP server is the official DHCP server for the local
17 # network, the authoritative directive should be uncommented.
18 #authoritative;
19?
20 # Use this to send dhcp log messages to a different log file (you also
21 # have to hack syslog.conf to complete the redirection).
22 log-facility local7;?????????????????????????????????????? 日志級別
23?
24 # No service will be given on this subnet, but declaring it helps the
25 # DHCP server to understand the network topology.
26?
27?
28?
29 # This is a very basic subnet declaration.
30?
31 subnet 172.25.254.0 netmask 255.255.255.0 {???????????? 設定分配ip的網絡位
32?? range 172.25.254.200 172.25.254.220;?????????????????? ip地址池
33?? option routers 172.25.254.250;???????????????????????? 客戶主機獲得的網關
客戶端
1.編輯配置文件修改dhcp:vim /etc/sysconfig/network-scripts/ifcfg-eth0
將BOOTPROTO=dhcp
2.systemctl restart network 重啟服務獲得ip
3.3.ifconfig **查看ip
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。