我有一台运行Ubuntu 11.04的服务器,部署在现场.当有人调试服务器时,他们插入eth1,但其余的时间,没有任何东西插入eth1.系统日志充满了来自dhclient尝试查找连接的DHCPDISCOVER请求.有没有什么方法可以配置dhclient只运行DHCPDISCOVER固定次数?
每个Syslog条目:
Nov 2 07:58:32 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 3 Nov 2 07:58:35 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 4 Nov 2 07:58:39 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 8 Nov 2 07:58:47 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 15 Nov 2 07:59:02 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 13 Nov 2 07:59:15 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 14 Nov 2 07:59:29 sensor-2bb8 dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 4 Nov 2 07:59:33 sensor-2bb8 dhclient: No DHCPOFFERS received. Nov 2 07:59:33 sensor-2bb8 dhclient: No working leases in persistent database - sleeping.
/ etc / network / interfaces的内容:
# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth1 iface eth1 inet dhcp
如果设备支持hotplug事件,为什么不使用allow-hotplug eth1而不是auto eth1.这应该意味着,如果实际存在可用链接,则默认值将仅尝试启用自身.自动设置意味着无论接口的状态如何,都将启动接口.
看一下解释这些参数的the Debian manual.