[lxc-users] services in container doesn't start automatically

Fajar A. Nugraha list at fajar.net
Thu Apr 30 15:30:57 UTC 2015


On Thu, Apr 30, 2015 at 9:10 PM, Fırat KÜÇÜK <firatkucuk at gmail.com> wrote:

> lxc.network.ipv4 = 213.X.X.31/32
> lxc.network.ipv4.gateway = 193.X.X.1

I didn't know you can do that. Thanks.

> container inerfaces file:
>
> auto eth0
> iface eth0 inet static
>    address   213.X.X.31
>    netmask   255.255.255.255
>    broadcast 0.0.0.0
>    gateway   193.X.X.1
>
>    dns-nameservers 8.8.8.8
>    dns-nameservers 8.8.4.4


Depending on where 193.X.X.1 is located, you might need something like this

iface eth0 inet static
        address 213.X.X.31/32
        pointopoint 193.X.X.1
        gateway 193.X.X.1

works for me since I put the gateway IP on the veth interface on the host side.

if pointopoint and gateway doesn't work, you might be able to use these instead

up /sbin/ip route add 193.X.X.1 dev eth0  scope link
up /sbin/ip route add default via 193.X.X.1 dev eth0

Of course when you set it this way on interfaces, you won't need
lxc.network.ipv4* on container's config file

-- 
Fajar


More information about the lxc-users mailing list