[Lxc-users] adding a default gateway inside a container as a non root user

Arun M arun_mah at yahoo.com
Thu Mar 1 19:32:28 UTC 2012


Hi,

I am trying to add a default gateway inside a lxc container so that the application can talk to outside network. 

I used lxc-setcap to set capabilities and started the container as a non-root user.

lxc-execute -n alpha -f a.conf -- /bin/start.sh

in start.sh :-
#!/bin/sh
route add default gw 169.254.100.1
exec sh

I get the following error :- 
route: SIOCADDRT: Operation not permitted

Tried adding cap_net_admin to lxc-init, making 'route' a suid program etc but did not help.

The networking config is as follows:-
lxc.network.type = veth

lxc.network.flags = up
lxc.network.link = br0
lxc.network.name = eth1
lxc.network.ipv4 = 169.254.100.6/24

Any pointers ?

Thanks,
Arun




More information about the lxc-users mailing list