Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved]Bonding and init.d/networking not agreeing

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
ratdude747
Posts: 6
Joined: 2014-12-12 11:47

[Solved]Bonding and init.d/networking not agreeing

#1 Post by ratdude747 »

Question:

I'm trying to get bonding working on my new (to me) server. It uses a pair of broadcom netextreme gigabit ports (two different MAC adresses) for the bond (eth1 and eth2, eth0 is an intel 10/100 for 3 NICs on the mainboard).

What happens is, after ifdown'ing eth0/1/2 and stopping /etc/init.d/networking, I change /etc/network/interfaces to have bonding. ifup'ing bond0 results in good results... but then starting /etc/init.d/networking eth1 and eth2 shut down (eth1 goes to 10/100 WOL, eth2 goes dead).

Here's my /etc/network/interfaces:

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#allow-hotplug eth0

#iface eth0 inet dhcp

auto bond0

iface bond0 inet static
        address 192.168.1.3
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        bond-mode balance-rr
        bond-miimon 100
        bond-slaves eth1 eth2
        #dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.1.1

auto eth1
iface eth1 inet manual
        bond-master bond0

auto eth2
iface eth2 inet manual
        bond-master bond0
and my /etc/udev/rules.d/70-persistent-net.rules

Code: Select all

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.


# PCI device 0x8086:0x1229 (e100)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:81:48:9a:64", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x14e4:0x1648 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:81:48:9a:28", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x14e4:0x1648 (tg3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:81:48:9a:29", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

I do have ifenslave and non-free firmware installed. The bonded NICs shut down on startup.

Is there something with /etc/init.d/networking that needs configured in addition to interfaces?
Last edited by ratdude747 on 2017-08-17 00:48, edited 1 time in total.

ratdude747
Posts: 6
Joined: 2014-12-12 11:47

Re: Bonding and init.d/networking not agreeing

#2 Post by ratdude747 »

I think I fixed it. Read the official documentation from here:

https://www.kernel.org/doc/Documentatio ... onding.txt

Apparently Ubuntu changed things and the "correct" way to run bonding on debian based systems (in balance-rr mode) is a bit different:

Here's my revised /etc/network/interfaces:

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#allow-hotplug eth0

#iface eth0 inet dhcp

auto bond0

iface bond0 inet static
        address 192.168.1.3
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        bond-mode balance-rr
        bond-miimon 100
        bond-slaves none
        #dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.1.1


auto eth1
iface eth1 inet manual
        bond-master bond0
        bond-primary eth1 eth2

auto eth2
iface eth2 inet manual
        bond-master bond0
        bond-primary eth1 eth2
So far, so good. I know, RTFM!

ratdude747
Posts: 6
Joined: 2014-12-12 11:47

Re: [Solved]Bonding and init.d/networking not agreeing

#3 Post by ratdude747 »

^ Nix that. Decided to add a gigabit card and bond all 3, and discovered that I didn't have things fixed after all. Here's part of my post on another forum (where I am documenting the build of this server)

[quote= ratdude747's post on another forum]
[With 3 interfaces bonded at least], the bonding setup is actually different than above... seems all my troubleshooting for 2 ports quit working, as the old file layout actually works:

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#allow-hotplug eth0

#iface eth0 inet dhcp


auto bond0

iface bond0 inet static
        address 192.168.1.3
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        bond-mode balance-rr
        bond-miimon 100
        bond-slaves eth1 eth2 eth3
        #dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.1.1


auto eth1
iface eth1 inet manual

auto eth2
iface eth2 inet manual

auto eth3
iface eth3 inet manual
What was the real problem? Apparently ifup/ifsdown and the networking service do not agree and one shouldn't use use the former in debian. Either that, or the latter does the former when starting/stopping. The "new" file format was giving a bunch of "option primary not supported in balance-rr" errors when the service started, which hinted me towards reverting to the old format and skipping ifup (which did the trick).
[/quote]

Apparently it doesn't like the "upstart" format for the interfaces file after all... I didn't try this with just two bonded but if there is enough curiosity (to include my own in the future), I might try it and post back with results.

Post Reply