Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After upgrade from squeezy to wheezy my network configuration lost gateway.

(i have lxc containers, and all of wheezy losts, one, which i want to stay squeezy - still have, so i'm sure, that the problem is of wheezy upgrade)

I have to add manually route add default gw x.x.x.x eth0 to bring back - but reboot remove it of course.

What is the correct way to set gateway on wheezy?

my /etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static

====================================== added ========================

#netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface   U         0 0          0 eth0

I'm definetely sure that wheezy breaks sth. I found, that i have one more squeeze container (not important) which has gateway working - i upgraded it and gateway is lost..

I don't use any NetworkManager (intentionaly) - no gui at all

share|improve this question
Could you add the result of "netstat -rn" run in a faulty container ? – Dom Jun 11 '13 at 16:28
I wonder if lxc config isn't changed in wheezy – SledgehammerPL Jun 11 '13 at 16:58

I found it!

The problem is in lxc conf file.

In squeezy the network section looks:

lxc.utsname = container1 = veth = up = br0 = eth0 =

in wheezy - you have to add this line: = auto
share|improve this answer
not really - if you set .gateway to auto, it's set to your ip of your main host running containers. You may possibly have to turn on forwarding to make it work, but I didn't check this. If you have br0 interface, I'd rather say you need to set up your actual gateway ip, like = But thanks to your post I found what was wrong with my config. – apagr Jun 14 '13 at 9:23

The gateway directive in your interfaces file is still the preferred way to configure these settings. You should make sure that an autoconfiguration tool such NetworkManager did not accidentally get installed during your upgrade process or that you are not using init scripts to add or remove extra static routes.

share|improve this answer
as i wrote up: no intentionaly autoconfiguration tools and manual scripts - lxc containers are as simple as it is possible... – SledgehammerPL Jun 11 '13 at 16:57

Your Answer


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.