Debian Jessie:dhclient一直很活跃

Debian Jessie的全新安装中,我设置了一个静态IP地址后,DHCP客户端仍处于活动状态。 甚至当续租时,它甚至还原到dhcp ip地址。

第一步:我修改/ etc / network / interfaces:

source /etc/network/interfaces.d/* auto lo iface lo inet loopback auto eth0 allow-hotplug eth0 iface eth0 inet static address 192.168.0.8 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.0.5 

第2步:我重新启动networkingsystemctl restart networking.service (没有错误信息)

第3步:检查dhclient是否正在运行: ps x | grep [d]hclient ps x | grep [d]hclient
– > dhclient -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0

如果我重新启动,dhclient仍然启动。
我在每个Debian Jessie上都有这种行为,我使用静态ip地址来安装。

我不觉得启动了dhclient: findgrep没有在/etc/usr/libfind任何东西
我不习惯systemd,我不明白dhclient是由systemd启动还是不启动。

正在运行的进程是(我删除了我的Bash会话):

 /sbin/init /lib/systemd/systemd-udevd /lib/systemd/systemd-journald /usr/sbin/cron -f /usr/sbin/atd -f /lib/systemd/systemd-logind /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation /usr/sbin/rsyslogd -n /usr/sbin/acpid /bin/login -- /usr/sbin/exim4 -bd -q30m dhclient -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0 /usr/sbin/sshd -D /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 108:113 

问题1:如何启动dhclient?
问题2:什么是“官方”的方式来防止它运行? (除了apt-get remove/purge

简单的解释:

  • 您将eth0重新configuration为手动
  • 联网重启会做:
    • 禁用eth0(向下)
    • 启用eth0(上)
    • 设置你的静态IP地址

由于在停止时没有将接口设置为“dhcp”,dhclient没有停止。

正确的方法是:

  • 停止/ ifdown你
  • 重新configuration
  • 启动/ ifup的

或者手动关心dhclient。 而且它肯定不会在重启后启动。

DHCP客户端只是无法检测到configuration另一个IP地址的人。 所以当你设置一个静态地址时,你必须把它杀掉。

唯一的秘密是:为什么当我重新启动testing服务器,DHCP客户端仍然在那里?
我只是在另一台服务器上做了testing,没有问题。 所以我想这只是我。 我错过了或忘记了什么。