我有一台 Ubuntu 16.04.2 服务器,有 5 个网络接口(eth0-eth4)。
服务器以 4 个静态接口开始。ETH0,2
= WAN(具有静态公共 IP)
ETH3 = WAN(具有静态私有 IP)
ETH1 = LAN(具有静态私有 IP)
一切正常,直到我添加了第五张卡(eth4),它有一个通过 DHCP 获得的动态公共 IP(租用时间为 7200 秒)。DHCP 服务器在 ISP 提供的路由器上运行,并将 IP 分配给 eth4(我无法访问此路由器)。
我的问题是,/var/log/syslog 文件很快就被 DHCPDISCOVER 消息填满。例如:
Apr 25 07:36:49 proxy01 dhclient[36246]: DHCPDISCOVER on eth3 to 255.255.255.255 port 67 interval 12 (xid=0x71437738)
Apr 25 07:36:50 proxy01 dhclient[36814]: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 19 (xid=0x52470774)
Apr 25 07:36:52 proxy01 dhclient[36002]: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 10 (xid=0x3003c736)
Apr 25 07:36:53 proxy01 dhclient[36814]: DHCPDISCOVER on eth3 to 255.255.255.255 port 67 interval 14 (xid=0x72c16a08)
Apr 25 07:36:53 proxy01 dhclient[45842]: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 3 (xid=0x6880636b)
Apr 25 07:36:56 proxy01 dhclient[45842]: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 4 (xid=0x6880636b)
Apr 25 07:36:57 proxy01 dhclient[45842]: DHCPDISCOVER on eth3 to 255.255.255.255 port 67 interval 7 (xid=0xbcb17169)
Apr 25 07:36:58 proxy01 dhclient[36814]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9 (xid=0x31b2863a)
Apr 25 07:36:59 proxy01 dhclient[45842]: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 3 (xid=0x37d8972a)
Apr 25 07:37:00 proxy01 dhclient[45842]: DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 11 (xid=0x6880636b)
Apr 25 07:37:00 proxy01 dhclient[35175]: DHCPDISCOVER on eth3 to 255.255.255.255 port 67 interval 10 (xid=0xc75a4136)
Apr 25 07:37:01 proxy01 dhclient[36246]: DHCPDISCOVER on eth3 to 255.255.255.255 port 67 interval 13 (xid=0x71437738)
Apr 25 07:37:02 proxy01 dhclient[36002]: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 17 (xid=0x3003c736)
Apr 25 07:37:02 proxy01 dhclient[45842]: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 4 (xid=0x37d8972a)
Apr 25 07:37:04 proxy01 dhclient[45842]: DHCPDISCOVER on eth3 to 255.255.255.255 port 67 interval 8 (xid=0xbcb17169)
Apr 25 07:37:05 proxy01 dhclient[36246]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12 (xid=0x7b70d96a)
Apr 25 07:37:06 proxy01 dhclient[45842]: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 8 (xid=0x37d8972a)
Apr 25 07:37:07 proxy01 dhclient[36814]: DHCPDISCOVER on eth3 to 255.255.255.255 port 67 interval 15 (xid=0x72c16a08)
Apr 25 07:37:07 proxy01 dhclient[36814]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14 (xid=0x31b2863a)
Apr 25 07:37:09 proxy01 dhclient[36814]: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 14 (xid=0x52470774)
Apr 25 07:37:10 proxy01 dhclient[35175]: DHCPDISCOVER on eth3 to 255.255.255.255 port 67 interval 10 (xid=0xc75a4136)
我当前的 /etc/network/interfaces 看起来像这样(这些 IP 不是真实的):
auto lo eth1 eth0 eth2 eth3 eth4
source /etc/network/interfaces.d/*
iface lo inet loopback
iface eth0 inet static
address 103.25.92.3
netmask 255.255.255.0
broadcast 103.25.92.255
network 103.25.92.0
post-up iptables-restore < /etc/iptables.up.rules
post-up ip6tables-restore < /etc/ip6tables.up.rules
iface eth1 inet static
address 10.1.2.3
netmask 255.255.0.0
broadcast 10.1.255.255
network 10.1.0.0
dns-nameservers 10.1.3.253 10.1.3.254 8.8.8.8
dns-domain domain.local
iface eth2 inet static
address 105.99.22.34
netmask 255.255.255.248
broadcast 105.99.22.39
network 105.99.22.32
up ip route add 195.199.255.195/32 via 105.99.22.38
iface eth3 inet static
address 10.10.1.2
netmask 255.255.255.252
broadcast 10.10.1.3
network 10.10.1.0
gateway 10.10.1.1
iface eth4 inet dhcp
ps 辅助 | grep dhclient显示正在运行的 6 个 dhclient 实例:
root 35175 0.0 0.0 16128 2860 ? Ss ápr24 0:03 dhclient -v
root 36002 0.0 0.0 16128 2844 ? Ss ápr24 0:03 dhclient -v
root 36246 0.0 0.0 16128 2960 ? Ss ápr24 0:03 dhclient -v
root 36814 0.0 0.0 16128 2896 ? Ss ápr24 0:03 dhclient -v
root 45842 0.0 0.0 16128 2904 ? Ss ápr24 0:03 dhclient -v
root 50187 0.0 0.0 16128 2964 ? Ss ápr24 0:00 /sbin/dhclient -1 -v -pf /run/dhclient.eth4.pid -lf /var/lib/dhcp/dhclient.eth4.leases -I -df /var/lib/dhcp/dhclient6.eth4.leases eth4
网络管理器也在运行,并且每个网卡都有一个配置的配置文件,但是nmcli c show--active显示没有活动连接。
我需要一些帮助来摆脱 syslog 文件中过多的 DHCPDISCOVER 条目并停止在静态接口上完全运行 dhclient。