您好,登錄后才能下訂單哦!
這期內容當中小編將會給大家帶來有關NTPD如何刪除所有網絡接口,文章內容豐富且以專業的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
NTPD服務刪除并啟用網絡
我們在CentOS上的eth0上配置了兩個虛擬接口,它們時不時地出現故障。現在,在查看日志文件之后,我發現ntpd顯然刪除了所有eth0接口,并且dhclient自動將eth0恢復。然而,這會導致我們的幾個虛擬網站無法訪問。
有人能給我解釋一下ntpd刪除接口的原因嗎?是否可以/應該關閉該功能,或者是否可以/應該配置dhclient以自動恢復虛擬接口?
編輯//我應該發布的日志文件:
Nov 12 13:10:28 raptor dhclient[20048]: DHCPREQUEST on eth0 to 255.255.255.255 port 67 (xid=0x6a825e97) Nov 12 13:10:42 raptor dhclient[20048]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8 (xid=0x24554092) Nov 12 13:10:42 raptor dhclient[20048]: DHCPOFFER from 96.126.108.78 Nov 12 13:10:42 raptor dhclient[20048]: DHCPREQUEST on eth0 to 255.255.255.255 port 67 (xid=0x24554092) Nov 12 13:10:42 raptor dhclient[20048]: DHCPACK from 96.126.108.78 (xid=0x24554092) Nov 12 13:10:42 raptor ntpd[2109]: Deleting interface #31 eth0, 50.116.50.97#123, interface stats: received=3255, sent=3256, dropped=0, active_time=1559394 secs Nov 12 13:10:42 raptor ntpd[2109]: Deleting interface #32 eth0:0, 50.116.53.56#123, interface stats: received=3, sent=0, dropped=0, active_time=1559391 secs Nov 12 13:10:42 raptor ntpd[2109]: Deleting interface #33 eth0:1, 66.175.211.192#123, interface stats: received=2, sent=0, dropped=0, active_time=1559389 secs Nov 12 13:10:42 raptor ntpd[2109]: Deleting interface #34 eth0:2, 50.116.53.95#123, interface stats: received=3, sent=0, dropped=0, active_time=1559387 secs Nov 12 13:10:42 raptor ntpd[2109]: Deleting interface #35 eth0:3, 97.107.132.32#123, interface stats: received=2, sent=0, dropped=0, active_time=1559385 secs Nov 12 13:10:42 raptor ntpd[2109]: Deleting interface #36 eth0:4, 50.116.56.201#123, interface stats: received=2, sent=0, dropped=0, active_time=1559383 secs Nov 12 13:10:42 raptor ntpd[2109]: Deleting interface #37 eth0:5, 66.175.212.121#123, interface stats: received=2, sent=0, dropped=0, active_time=1559381 secs Nov 12 13:10:42 raptor ntpd[2109]: Deleting interface #38 eth0:6, 66.175.215.137#123, interface stats: received=2, sent=0, dropped=0, active_time=1559379 secs Nov 12 13:10:44 raptor NET[1573]: /sbin/dhclient-script : updated /etc/resolv.conf Nov 12 13:10:44 raptor dhclient[20048]: bound to 50.116.50.97 -- renewal in 32692 seconds. Nov 12 13:10:45 raptor ntpd[2109]: Listening on interface #39 eth0, 50.116.50.97#123 Enabled
eth0配置:
DEVICE="eth0" ONBOOT="yes" BOOTPROTO="dhcp" IPV6INIT="no" IPADDR=50.116.50.97 NETMASK=255.255.255.0 GATEWAY=50.116.50.1
虛擬界面(我只發布了第一個,它們大部分看起來都一樣):
# Configuration for eth0:0 DEVICE=eth0:0 BOOTPROTO=none # This line ensures that the interface will be brought up during boot. ONBOOT=yes # eth0:0 IPADDR=50.116.53.56 NETMASK=255.255.255.0 Answers答復: The BOOTPROTO="dhcp" means you have DHCP. If you look, the DHCP client is running immediately before ntp changes anything. I think your DHCP client is removing all the static addresses on eth0. When NTP notices this it knows that it needs to stop listening on all the sockets it was listening on for the static addresses.
決議
使用-L選項告訴ntpd不要監聽虛擬接口。您可以在/etc/sysconfig/ntpd中設置-L。
當接口關閉或刪除時,ntpd根據當前接口狀態更新偵聽接口。
--- /etc/sysconfig/ntpd.bak 2016-09-26 08:35:05.408966980 -0400 +++ /etc/sysconfig/ntpd 2016-09-26 08:35:14.461086105 -0400 @@ -1,2 +1,2 @@ # Command line options for ntpd -OPTIONS="-g" +OPTIONS="-g -L"
上述就是小編為大家分享的NTPD如何刪除所有網絡接口了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。