Dual NIC Bonding DHCP Failure
-
Hi all, I’m in the process of getting my server set up and I’m using a PC with a dual port PCI-E network card that I plan on having handle all of the imaging. The internet traffic is coming through the onboard NIC while the two ports on the card will be going to a switch which will then connect to all of the target PC’s. After some searching I believe that bonding the two ports is the ideal situation for this since this is for load balancing purposes.
I was able to set everything up beautifully using one of the two ports only, however in following the guide for bonding multiple NICs I’m now getting an error when trying to start the DHCP service after re-running the installer with the newly bonded interface selected as the one to be used. I’m attaching any relevant log/config file info below but if more info is needed let me know. Any help would be appreciated as this is the last thing standing in my way to finally being able to get this working 100%!
Configured interfaces: eno1 is for internet, enp2s0f0/enp2s0f1 are the two meant to be bonded for imaging. MAC address used here is that of enp2s0f0
auto lo iface lo inet loopback auto eno1 iface eno1 inet dhcp auto bond0 iface bond0 inet static bond-slaves none bond-mode 2 bond-miimon 100 address 192.168.214.10 netmask 255.255.255.0 network 192.168.214.0 broadcast 192.168.214.255 gateway 192.168.214.1 hwaddress ether 90:e2:ba:f5:58:ba auto enp2s0f0 iface enp2s0f0 inet manual bond-master bond0 bond-primary enp2s0f0 enp2s0f1 auto enp2s0f1 iface enp2s0f1 inet manual bond-master bond0 bond-primary enp2s0f0 enp2s0f1
ifconfig -a
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500 inet 192.168.214.10 netmask 255.255.255.0 broadcast 192.168.214.255 inet6 fe80::92e2:baff:fef5:58ba prefixlen 64 scopeid 0x20<link> ether 90:e2:ba:f5:58:ba txqueuelen 1000 (Ethernet) RX packets 9 bytes 3078 (3.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 75 bytes 7914 (7.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.16.50.91 netmask 255.255.255.0 broadcast 172.16.50.255 inet6 fe80::9a90:96ff:feb7:52f8 prefixlen 64 scopeid 0x20<link> ether 98:90:96:b7:52:f8 txqueuelen 1000 (Ethernet) RX packets 4316 bytes 730105 (712.9 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 6089 bytes 3784813 (3.6 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device interrupt 20 memory 0xf7d00000-f7d20000 enp2s0f0: flags=6147<UP,BROADCAST,SLAVE,MULTICAST> mtu 1500 ether 90:e2:ba:f5:58:ba txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device memory 0xf7c20000-f7c3ffff enp2s0f1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500 ether 90:e2:ba:f5:58:ba txqueuelen 1000 (Ethernet) RX packets 9 bytes 3078 (3.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 75 bytes 7914 (7.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device memory 0xf7c00000-f7c1ffff lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1 (Local Loopback) RX packets 9326 bytes 9860513 (9.4 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 9326 bytes 9860513 (9.4 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
fogsettings
ipaddress='192.168.214.10' copybackold='0' interface='bond0' submask='255.255.255.0' hostname='ig.ig' routeraddress='' plainrouter='' dnsaddress='8.8.8.8' username='fogproject' password='iHa0\]Go@7F9' osid='2' osname='Debian' dodhcp='y' bldhcp='1' dhcpd='isc-dhcp-server' blexports='1' installtype='N' snmysqluser='root' snmysqlpass='' snmysqlhost='localhost' installlang='0' storageLocation='/images' fogupdateloaded=1 docroot='/var/www/' webroot='/fog/' caCreated='yes' httpproto='http' startrange='192.168.214.10' endrange='192.168.214.254' bootfilename='undionly.kpxe' packages='apache2 bc build-essential cpp curl g++ gawk gcc genisoimage gzip htmldoc isc-dhcp-server isolinux lftp libapache2-mod-php7.0 libc6 libcurl3 liblzma-dev m4 mysql-client mysql-server net-tools nfs-kernel-server openssh-server php7.0 php7.0-bcmath php7.0-cli php7.0-curl php7.0-fpm php7.0-gd php7.0-json php7.0-mbstring php7.0-mysql php-gettext sysv-rc-conf tar tftpd-hpa tftp-hpa unzip vsftpd wget xinetd zlib1g' noTftpBuild='' notpxedefaultfile='' sslpath='/opt/fog/snapins/ssl/' backupPath='' php_ver='7.0' php_verAdds='-7.0' sslprivkey='/opt/fog/snapins/ssl//.srvprivate.key' ## End of FOG Settings
DHCP Service error
● isc-dhcp-server.service - LSB: DHCP server Loaded: loaded (/etc/init.d/isc-dhcp-server; generated; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2019-06-26 12:57:14 EDT; 1min 24s ago Docs: man:systemd-sysv-generator(8) Process: 805 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE) Jun 26 12:57:12 ig systemd[1]: Starting LSB: DHCP server... Jun 26 12:57:12 ig isc-dhcp-server[805]: Launching IPv4 server only. Jun 26 12:57:12 ig dhcpd[865]: Wrote 0 class decls to leases file. Jun 26 12:57:12 ig dhcpd[865]: Wrote 3 leases to leases file. Jun 26 12:57:14 ig isc-dhcp-server[805]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed! Jun 26 12:57:14 ig isc-dhcp-server[805]: failed! Jun 26 12:57:14 ig systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1 Jun 26 12:57:14 ig systemd[1]: Failed to start LSB: DHCP server. Jun 26 12:57:14 ig systemd[1]: isc-dhcp-server.service: Unit entered failed state. Jun 26 12:57:14 ig systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'. ~
-
@explosivo98 The error you get from probably
systemctl status isc-dhcp-server
is not telling much. You might get more information from runningjournalctl -x
(to jump to the end use shift+d).What jumps at me is this in your
.fogsettings
file:ipaddress='192.168.214.10' ... startrange='192.168.214.10'
By default the installer sets the DHCP range to start at x.x.x.10 and this might cause trouble with the server having the very same IP as well. Just edit the DHCP server config file and change the start range IP to 192.168.214.20 is a good idea I suppose. Probably good to clean out the DHCP lease file as well as you move the start IP. Looks like you have a Debian or Ubuntu system there. Lease file should be in
/var/lib/dhcp/dhcpd.leases
. -
@Sebastian-Roth ah, good catch. I updated the config and cleared the lease file but still getting an error when starting the service. Here’s the output from journalctl:
Jun 26 13:41:36 ig dhcpd[3685]: Jun 26 13:41:36 ig dhcpd[3685]: Not configured to listen on any interfaces! Jun 26 13:41:36 ig dhcpd[3685]: Jun 26 13:41:36 ig dhcpd[3685]: If you think you have received this message due to a bug rather Jun 26 13:41:36 ig dhcpd[3685]: than a configuration issue please read the section on submitting Jun 26 13:41:36 ig dhcpd[3685]: bugs on either our web page at www.isc.org or in the README file Jun 26 13:41:36 ig dhcpd[3685]: before submitting a bug. These pages explain the proper Jun 26 13:41:36 ig dhcpd[3685]: process and the information we find helpful for debugging.. Jun 26 13:41:36 ig dhcpd[3685]: Jun 26 13:41:36 ig dhcpd[3685]: exiting. Jun 26 13:41:38 ig isc-dhcp-server[3674]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed! Jun 26 13:41:38 ig isc-dhcp-server[3674]: failed! Jun 26 13:41:38 ig systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1 Jun 26 13:41:38 ig systemd[1]: Failed to start LSB: DHCP server.
Seems like it’s having a problem with the interface?
-
@explosivo98 Take a look at
/etc/default/isc-dhcp-server
. Possibly there is an interface definition in that one which you’d need to change tobond0
… -
@Sebastian-Roth I need to do testing tomorrow but I was able to get this working at the very end of my day today. I’ll post the details tomorrow if it works but I did a fresh reinstall of Debian, set up the bonded interface first, and then did the Fog install, pointing it to bond0 during setup. I also had to remove a couple lines from the interface config. I was able to get an IP from each port so it’s looking real good but need to verify/test tomorrow to be sure.
-
@explosivo98 said in Dual NIC Bonding DHCP Failure:
MAC address used here is that of enp2s0f0
My intuition is telling me to let the bonding driver pick the logical mac address. I can say I’ve ever seen one defined on a bonding interface.
I’m also with Sebastian, you need to tell the isc-dhcp server which interface to bind to.
netstat -an|grep :67
might tell you the interfaces its currently bound to. It may be all interfaces (0.0.0.0:67), in that case its not a good thing since you only want it to be bound to and responding to the 192.168… interface.A couple of things on bonding, I would go with bond mode 4 over bond mode 2. In bond mode 2 the server has to do all of the work with IP address hashing since the switch is ignorant of the bonding link. In mode 4 both the bonding driver and the switch share the ip hashing load. But that also requires a switch that understands LACP/802.1ad mode.
Also I would list the slaves in the bond0 configuration so linux doesn’t try to bring up the bond0 interface before the slaves come up.
This also confuses me
bond-primary enp2s0f0 enp2s0f1
you want distributed load balancing not fail over balancing. There is no need to define a primary interface since IP hashing will decide the interface to use.The rest looks good in your interfaces file.
-
Okay, so after some testing this morning I’m happy to report that I was able to get this working. I was going off the guide on the wiki which had it configured almost exactly like I pasted in the OP, but after some googling I saw people recommending NOT including the bond-primary lines for each of the bonded interfaces. I commented out those lines to test and sure enough it worked. Below is my current network interfaces config:
auto lo iface lo inet loopback auto eno1 iface eno1 inet dhcp auto bond0 iface bond0 inet static bond-slaves none bond-mode 2 bond-miimon 100 address 192.168.214.10 netmask 255.255.255.0 network 192.168.214.0 broadcast 192.168.214.255 gateway 192.168.214.1 hwaddress ether 90:e2:ba:f5:58:ba auto enp2s0f0 iface enp2s0f0 inet manual bond-master bond0 # bond-primary enp2s0f0 enp2s0f1 auto enp2s0f1 iface enp2s0f1 inet manual bond-master bond0 # bond-primary enp2s0f0 enp2s0f1
I think what also helped was a clean reinstall of Debian; when I posted this thread I was attempting to change existing settings from a pretty setup using only one of the network ports. I did a full reinstall and configured the interface bonding FIRST, then once I was confident that was working I ran the Fog installer and used bond0 as the interface. Installation completed without a hitch and I was online. I appreciate the assistance, I definitely learned a lot along the way, but the solution to this problem of mine with multiple network ports ended up being much easier than anticipated once I knew what to do. Now it’s time to image!