Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
  address 172.16.0.5
  netmask 255.255.255.0
  gateway 172.16.0.1
  broadcast 172.16.0.255

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

#netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
172.16.0.0      0.0.0.0         255.255.255.0   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

2 Answers 2

I found it!

The problem is in lxc conf file.

In squeezy the network section looks:

lxc.utsname = container1
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth0
lxc.network.ipv4 = 172.16.0.5/24

in wheezy - you have to add this line:

lxc.network.ipv4.gateway = 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 lxc.network.ipv4.gateway = 1.2.3.4. 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

 
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.