Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have /etc/network/interfaces as follow. Every time the system boots up, the route is wrong so the gateway is not reachable. I'd have to ifdown br0 && ifup br0 to fix the route table and make everything work. How to fix this forever?

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual
bond-master bond0

auto eth1
iface eth1 inet manual
bond-master bond0

auto bond0
iface bond0 inet dhcp
 bond-mode balance-tlb
 bond-slaves none

auto br0
iface br0 inet dhcp
 bridge_ports bond0

Edit

This is the route table from ip r s after I reboot the host. There is an extra routing path.

Before restart br0:

default via 10.69.208.129 dev bond0  metric 100 
10.69.208.128/26 dev bond0  proto kernel  scope link  src 10.69.208.172 
10.69.208.128/26 dev br0  proto kernel  scope link  src 10.69.208.172 
169.254.0.0/16 dev br0  scope link  metric 1000 
192.168.1.0/24 dev lxcbr0  proto kernel  scope link  src 192.168.1.1

After restart br0:

default via 10.69.208.129 dev br0  metric 100 
10.69.208.128/26 dev br0  proto kernel  scope link  src 10.69.208.172 
169.254.0.0/16 dev br0  scope link  metric 1000 
192.168.1.0/24 dev lxcbr0  proto kernel  scope link  src 192.168.1.1
share|improve this question
    
If your /etc/network/interfaces file is correct according to the documentation for ifenslave as well as the documentation for bridge-utils then I think it's a "race condition" bug if the interfaces do not come up in the correct order. If there is a mistake in your interfaces file then hopefully someone will be able to provide details in an answer here. –  Robie Basak Jul 1 '13 at 8:23
    
So I don't think "how do I adjust the order?" is really the right way to phrase your question. It's more "why is there a race condition here?" –  Robie Basak Jul 1 '13 at 8:24
    
Should I set bond0 as manual instead of dhcp? I will try next time. –  Magicloud Jul 2 '13 at 2:16

2 Answers 2

you need to put script to up/down interface to your /etc/network/interface file

ubuntu is debian and this should helps you

Click here for Debian Networking Configuration

Bringing up an interface without an IP address

To create a network interface without an IP address at all use the manual method and use pre-up and post-down commands to bring the interface up and down.

   iface eth0 inet manual
      pre-up ifconfig $IFACE up
      post-down ifconfig $IFACE down
share|improve this answer
up vote 0 down vote accepted

Changing bond0 to manual instead of dhcp, now it works.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.