NTPD如何删除所有网络接口-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
NTPD如何删除所有网络接口

这期内容当中小编将会给大家带来有关NTPD如何删除所有网络接口,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。

封丘网站建设公司成都创新互联公司,封丘网站设计制作,有大型网站制作公司丰富经验。已为封丘1000多家提供企业网站建设服务。企业网站搭建\外贸网站建设要多少钱,请找那个售后服务好的封丘做网站的公司定做!

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如何删除所有网络接口了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注创新互联行业资讯频道。


网站名称:NTPD如何删除所有网络接口
链接地址:http://scgulin.cn/article/jejeog.html