我有一台 ubuntu 服务器 18.04,配置了两个绑定的千兆位以太网网卡。重新启动 DHCP 服务器后,我注意到以下错误/警告。服务器启动正常并且绑定链接已启动,但我认为仍然可能配置错误。
正如我所说,一切正常,但错误和警告仍然不应该被忽视。
这个设置有什么问题吗?
# systemctl status isc-dhcp-server.service
● isc-dhcp-server.service - ISC DHCP IPv4 server
Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-11-17 20:08:13 GMT; 1min 15s ago
Docs: man:dhcpd(8)
Main PID: 220139 (dhcpd)
Tasks: 4 (limit: 9332)
Memory: 6.1M
CGroup: /system.slice/isc-dhcp-server.service
└─220139 dhcpd -user dhcpd -group dhcpd -f -4 -pf /run/dhcp-server/dhcpd.pid -cf /etc/dhcp/dhcpd.conf
Nov 17 20:08:13 hostname.com dhcpd[220139]:
Nov 17 20:08:13 hostname.com dhcpd[220139]:
Nov 17 20:08:13 hostname.com dhcpd[220139]: No subnet declaration for enp2s0f0 (no IPv4 addresses).
Nov 17 20:08:13 hostname.com dhcpd[220139]: ** Ignoring requests on enp2s0f0. If this is not what
Nov 17 20:08:13 hostname.com dhcpd[220139]: you want, please write a subnet declaration
Nov 17 20:08:13 hostname.com dhcpd[220139]: in your dhcpd.conf file for the network segment
Nov 17 20:08:13 hostname.com dhcpd[220139]: to which interface enp2s0f0 is attached. **
Nov 17 20:08:13 hostname.com dhcpd[220139]:
Nov 17 20:08:13 hostname.com dhcpd[220139]: Sending on Socket/fallback/fallback-net
Nov 17 20:08:13 hostname.com dhcpd[220139]: Server starting service.
我的 dhcp 配置如下;
$ cat /etc/dhcp/dhcp.conf
# DHCP declaration including PXE boot filename and option for tftp server ip.
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.10 192.168.0.254;
default-lease-time 86400;
max-lease-time 604800;
next-server 192.168.0.2;
filename "/lpxelinux.0";
option routers 192.168.0.1;
option domain-name-servers 192.168.0.2;
#static address reservations (192.168.0.1 > 192.168.0.10)
host NETGEAR_VDSL_DM200_GATEWAY {
hardware ethernet 8c:3b:ad:c8:20:fe;
fixed-address 192.168.0.1;
}
host UBUNTU_SERVER {
hardware ethernet c8:cb:b8:c7:c7:50;
fixed-address 192.168.0.2;
}
host NETGEAR_EX7000_ACCESS_POINT {
hardware ethernet a0:63:91:e9:c8:f0;
fixed-address 192.168.0.3;
}
}
请参阅下面的我的 netplan 配置文件;
$ cat /etc/netplan/netplan.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp2s0f0:
dhcp4: no
dhcp6: no
enp2s0f1:
dhcp4: no
dhcp6: no
bonds:
bond0:
interfaces: [enp2s0f0, enp2s0f1]
addresses: [192.168.0.2/24]
gateway4: 192.168.0.1
nameservers:
addresses: [1.1.1.1,1.0.0.1,79.79.79.79,79.79.79.80]
parameters:
mode: 802.3ad
lacp-rate: slow
mii-monitor-interval: 1000
如果我查看绑定链接的状态,一切看起来都很好;
$ cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 1000
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0
802.3ad info
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
Slave Interface: enp2s0f1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:26:55:e3:bb:e3
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
Slave Interface: enp2s0f0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:26:55:e3:bb:e2
Slave queue ID: 0
Aggregator ID: 1
Actor Churn State: none
Partner Churn State: none
Actor Churned Count: 0
Partner Churned Count: 0
$ ethtool bond0
Settings for bond0:
Supported ports: [ ]
Supported link modes: Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 2000Mb/s
Duplex: Full
Port: Other
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Link detected: yes