第 4 和第 5 个接口上的 DHCP 失败,未收到 DHCPOFFERS

第 4 和第 5 个接口上的 DHCP 失败,未收到 DHCPOFFERS

我刚刚在 Ubuntu 16.04 服务器机箱中安装了一个 4 端口 NIC。内部网卡仍能正常工作,新卡上的前 2 个端口(任意两个)也能正常工作。但无论我以何种顺序初始化接口,第 4 个和第 5 个接口都拒绝获取 IP 地址并进行初始化。

我猜测存在某些限制,导致 DHCP 进程在前三个网络接口上正常工作,但在接下来的两个网络接口上失败。

我已经通过关闭除内部接口之外的所有接口进行了测试(因为我通过 ssh 进行访问,并且我需要该接口进行连接)。然后手动在每个接口上使用 ifup。无论我以何种顺序打开接口,在新卡上的 4 个接口中,我都会得到两个正常工作的接口和两个失败的接口。

ifconfig(注意 enp3s0 和 enp6s0)

enp3s0    Link encap:Ethernet  HWaddr 00:e0:4c:68:0a:5a  
          inet6 addr: fe80::2e0:4cff:fe68:a5a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6857 errors:0 dropped:0 overruns:0 frame:0
          TX packets:111 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:420291 (420.2 KB)  TX bytes:27522 (27.5 KB)

enp4s0    Link encap:Ethernet  HWaddr 00:e0:4c:68:0a:5b  
          inet addr:192.168.1.203  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:4cff:fe68:a5b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3600 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:235024 (235.0 KB)  TX bytes:3006 (3.0 KB)

enp5s0    Link encap:Ethernet  HWaddr 00:e0:4c:68:0a:5c  
          inet addr:192.168.1.115  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:4cff:fe68:a5c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:751 errors:0 dropped:0 overruns:0 frame:0
          TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:85444 (85.4 KB)  TX bytes:14184 (14.1 KB)

enp6s0    Link encap:Ethernet  HWaddr 00:e0:4c:68:0a:5d  
          inet6 addr: fe80::2e0:4cff:fe68:a5d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3554 errors:0 dropped:0 overruns:0 frame:0
          TX packets:115 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:213789 (213.7 KB)  TX bytes:28890 (28.8 KB)

enp7s0    Link encap:Ethernet  HWaddr 90:2b:34:97:d8:53  
          inet addr:192.168.1.112  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::922b:34ff:fe97:d853/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2888736 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3313452 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:683422371 (683.4 MB)  TX bytes:1293115042 (1.2 GB)

我的内部接口是 enp7s0,因此如果不丢失 ssh 连接,我就无法关闭它。

但是如果我将 3-6 放下,然后以不同的顺序放回去,我会得到不同的结果。

ifconfig(注意 enp5s0 和 enp6s0)

enp3s0    Link encap:Ethernet  HWaddr 00:e0:4c:68:0a:5a  
          inet addr:192.168.1.110  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:4cff:fe68:a5a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7689 errors:0 dropped:0 overruns:0 frame:0
          TX packets:121 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:470779 (470.7 KB)  TX bytes:28854 (28.8 KB)

enp4s0    Link encap:Ethernet  HWaddr 00:e0:4c:68:0a:5b  
          inet addr:192.168.1.203  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:4cff:fe68:a5b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3724 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:246046 (246.0 KB)  TX bytes:4338 (4.3 KB)

enp5s0    Link encap:Ethernet  HWaddr 00:e0:4c:68:0a:5c  
          inet6 addr: fe80::2e0:4cff:fe68:a5c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:805 errors:0 dropped:0 overruns:0 frame:0
          TX packets:85 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:90464 (90.4 KB)  TX bytes:16542 (16.5 KB)

enp6s0    Link encap:Ethernet  HWaddr 00:e0:4c:68:0a:5d  
          inet6 addr: fe80::2e0:4cff:fe68:a5d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4385 errors:0 dropped:0 overruns:0 frame:0
          TX packets:133 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:263649 (263.6 KB)  TX bytes:32958 (32.9 KB)

enp7s0    Link encap:Ethernet  HWaddr 90:2b:34:97:d8:53  
          inet addr:192.168.1.112  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::922b:34ff:fe97:d853/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2931383 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3358859 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:695890607 (695.8 MB)  TX bytes:1306715847 (1.3 GB)

这是最后的结果伊夫普尝试,我先用 ifdown 执行了同样的任务,然后使用 ifup 执行,每次接口的顺序都不同。最后两个总是失败。但那些能正常工作的接口会获得良好的 IP 地址。这似乎有些不对劲。

sudo ifup enp6s0 enp5s0 enp4s0 enp3s0

Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/enp6s0/00:e0:4c:68:0a:5d
Sending on   LPF/enp6s0/00:e0:4c:68:0a:5d
Sending on   Socket/fallback
DHCPDISCOVER on enp6s0 to 255.255.255.255 port 67 interval 3 (xid=0xd8b27778)
DHCPDISCOVER on enp6s0 to 255.255.255.255 port 67 interval 7 (xid=0xd8b27778)
DHCPREQUEST of 192.168.1.205 on enp6s0 to 255.255.255.255 port 67 (xid=0x7877b2d8)
DHCPOFFER of 192.168.1.205 from 192.168.1.1
DHCPACK of 192.168.1.205 from 192.168.1.1
bound to 192.168.1.205 -- renewal in 32722 seconds.
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/enp5s0/00:e0:4c:68:0a:5c
Sending on   LPF/enp5s0/00:e0:4c:68:0a:5c
Sending on   Socket/fallback
DHCPDISCOVER on enp5s0 to 255.255.255.255 port 67 interval 3 (xid=0x9001ca46)
DHCPDISCOVER on enp5s0 to 255.255.255.255 port 67 interval 3 (xid=0x9001ca46)
DHCPDISCOVER on enp5s0 to 255.255.255.255 port 67 interval 4 (xid=0x9001ca46)
DHCPREQUEST of 192.168.1.115 on enp5s0 to 255.255.255.255 port 67 (xid=0x46ca0190)
DHCPOFFER of 192.168.1.115 from 192.168.1.1
DHCPACK of 192.168.1.115 from 192.168.1.1
bound to 192.168.1.115 -- renewal in 39657 seconds.
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/enp4s0/00:e0:4c:68:0a:5b
Sending on   LPF/enp4s0/00:e0:4c:68:0a:5b
Sending on   Socket/fallback
DHCPDISCOVER on enp4s0 to 255.255.255.255 port 67 interval 3 (xid=0x88fe0427)
DHCPDISCOVER on enp4s0 to 255.255.255.255 port 67 interval 6 (xid=0x88fe0427)
DHCPDISCOVER on enp4s0 to 255.255.255.255 port 67 interval 14 (xid=0x88fe0427)
DHCPDISCOVER on enp4s0 to 255.255.255.255 port 67 interval 21 (xid=0x88fe0427)
DHCPDISCOVER on enp4s0 to 255.255.255.255 port 67 interval 17 (xid=0x88fe0427)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
Internet Systems Consortium DHCP Client 4.3.3
Copyright 2004-2015 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/enp3s0/00:e0:4c:68:0a:5a
Sending on   LPF/enp3s0/00:e0:4c:68:0a:5a
Sending on   Socket/fallback
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 3 (xid=0xffe5cb17)
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 5 (xid=0xffe5cb17)
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 12 (xid=0xffe5cb17)
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 21 (xid=0xffe5cb17)
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 17 (xid=0xffe5cb17)
DHCPDISCOVER on enp3s0 to 255.255.255.255 port 67 interval 3 (xid=0xffe5cb17)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

/etc/网络/接口

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp7s0
iface enp7s0 inet dhcp

auto enp3s0
iface enp3s0 inet dhcp
auto enp4s0
iface enp4s0 inet dhcp
auto enp5s0
iface enp5s0 inet dhcp
auto enp6s0
iface enp6s0 inet dhcp

/etc/dhcp/dhclient.conf

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
    domain-name, domain-name-servers, domain-search, host-name,
    dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
    netbios-name-servers, netbios-scope, interface-mtu,
    rfc3442-classless-static-routes, ntp-servers;

timeout 60;

如有任何建议,我们将不胜感激。

相关内容