Bonded interfaces donlt seem to work with DHCP

Bug #63988 reported by Nate Sanders on 2006-10-04
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ifupdown (Ubuntu)

Bug Description

Machine: Dapper 6.06.1

There appears to be a problem with Dapper that prevents it from bringing up a bonded interface with DHCP. It works just fine if you define a static IP, but I wish to hand out static address from a DHCP server.

The problem is that the following does not work:

> iface bond0 inet dhcp
> slaves eth0 eth1

When you restart networking, the dhcp portion will hang and then timeout.

But, if you define an IP manually it works fine:

> iface bond0 inet static
> address
> netmask
> gateway
> slaves eth0 eth1

What seems to be happening is this. If you manually configure the bonded interface from the command line you will notice you can ONLY get a dhcp IP address once the slaves have been enslaved.

# ifconfig bond0 up
# dhclient bond0
........this will time out

If you do this, it will work

# ifconfig bond0 up
# ifenslave bond0 eth0 eth1
# dhclient bond0

So, it appears that the ifupdown scripts are trying to request an IP address via DHCP before the slaves have been enslaved. I tried to resolve this using a pre-up script and had no success. I have only been able to get this to work using a static IP.

Jerome Haltom (wasabi) wrote :

I also ran into this. Your assessment seems correct.

As a temporary stop gap, you can configure the following in network/interfaces:

iface bond0 inet dhcp
  pre-up modprobe bonding
  pre-up ifconfig bond0 down || exit 0
  pre-up ifenslave -d bond0 eth0 || exit 0
  pre-up ifenslave -d bond0 eth1 || exit 0
  pre-up ifconfig bond0 up
  pre-up ifenslave bond0 eth0 eth1
  post-down ifconfig bond0 down

This is basically just doing the work that enslave's ifup/down plugins should do, on your own.

Changed in ifupdown:
status: Unconfirmed → Confirmed
Steve Langasek (vorlon) wrote :

Thank you for taking the time to report this issue and help to improve Ubuntu.

Because network device initialization is fully event-driven in Ubuntu 10.04 LTS and beyond, you must declare separate stanzas for each of your physical devices and set 'bond-slaves none' in the bonded interface stanza. /usr/share/doc/ifenslave-2.6/examples/two_hotplug_ethernet provides an example of this.

This is documented in the release notes for Ubuntu 10.04 LTS at <>.

Changed in ifupdown (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers