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

The IP does no longer respond to a remote ping

With restart I mean:

lxc-stop -n vm3
lxc-start -n vm3 -f /etc/lxc/vm3.conf -d 



auto lo
iface lo inet loopback
up route add -net netmask dev lo
down route add -net netmask dev lo

# device: eth0
auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
       bridge_ports eth0
       bridge_fd 0
       bridge_hello 2
       bridge_maxage 12
       bridge_stp off
    post-up ip route add dev br0
    post-up ip route add dev br0
    post-up ip route add dev br0
    post-up ip route add dev br0



lxc.utsname = vm3
lxc.rootfs = /var/lib/lxc/vm3/rootfs

lxc.tty = 4
#lxc.pts = 1024  # pseudo  tty  instance for strict isolation = veth = up = br0 = eth0 = 1500

#lxc.cgroup.cpuset.cpus = 0
# security parameter
lxc.cgroup.devices.deny = a # Deny all access to devices
lxc.cgroup.devices.allow = c 1:3 rwm   # dev/null
lxc.cgroup.devices.allow = c 1:5 rwm   # dev/zero
lxc.cgroup.devices.allow = c 5:1 rwm   # dev/console
lxc.cgroup.devices.allow = c 5:0 rwm   # dev/tty
lxc.cgroup.devices.allow = c 4:0 rwm   # dev/tty0
lxc.cgroup.devices.allow = c 4:1 rwm   # dev/tty1
lxc.cgroup.devices.allow = c 4:2 rwm   # dev/tty2
lxc.cgroup.devices.allow = c 1:9 rwm   # dev/urandon
lxc.cgroup.devices.allow = c 1:8 rwm   # dev/random
lxc.cgroup.devices.allow = c 136:* rwm # dev/pts/*
lxc.cgroup.devices.allow = c 5:2 rwm   # dev/pts/ptmx
lxc.cgroup.devices.allow = c 254:0 rwm # rtc

# mounts point
lxc.mount.entry=proc   /var/lib/lxc/vm3/rootfs/proc proc nodev,noexec,nosuid 0 0
lxc.mount.entry=devpts /var/lib/lxc/vm3/rootfs/dev/pts devpts defaults 0 0
lxc.mount.entry=sysfs  /var/lib/lxc/vm3/rootfs/sys sysfs defaults  0 0
share|improve this question
up vote 6 down vote accepted

You're writing about Linux containers (LXC). You have the ability to assign a static IP address in the container's configuration file. Here's an example from my environment:

lxc.utsname = MPG_Web
lxc.tty = 4 = veth = up = br0 = eth0 = 1500 = = 00:30:6E:08:EC:80
lxc.rootfs = /srv/lxc/MPG_Web
lxc.mount = /etc/lxc/MPG_Web.fstab

You seem to be missing the directive in your setup.

Unfortunately, you will need to use a script to inject your default and static routes. This isn't controllable from the LXC configuration file (yet).

share|improve this answer

As you've not specified a mac address in your lxc config file, one will be assigned at random on each reboot of the container.

Therefore, if your container is relying on DHCP, it will be assigned a different IP address each time it boots up - which is probably causing your problem.

Solution - specify a mac address (see other answers).

share|improve this answer

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.