[lxc-users] Container doesn't connect to bridge

Benoit GEORGELIN - Association Web4all benoit.georgelin at web4all.fr
Mon Oct 26 16:51:20 UTC 2015


>From what I understand , there is two options : 

- lxc configuration file 
- network config file into the container 

I don't think you can mix both and you are better to stick with one solution . 



Cordialement, 

Benoît Georgelin - 
Afin de contribuer au respect de l'environnement, merci de n'imprimer ce mail qu'en cas de nécessité 


De: "Joshua Schaeffer" <jschaeffer0922 at gmail.com> 
À: "lxc-users" <lxc-users at lists.linuxcontainers.org> 
Envoyé: Lundi 26 Octobre 2015 12:26:18 
Objet: Re: [lxc-users] Container doesn't connect to bridge 

I already have networking setup in the container: 
root at thinkweb:/# cat /etc/network/interfaces 
auto lo 
iface lo inet loopback 

auto eth0 
iface eth0 inet static 
address 192.168.54.110 
netmask 255.255.255.128 
gateway 192.168.54.1 

When I add lxc.network.ipv4.gateway to the config it now works. Why would adding the gateway to the config work, but not in interfaces. I've never needed to add the gateway to the config before. 


On Sat, Oct 24, 2015 at 12:50 AM, Fajar A. Nugraha < list at fajar.net > wrote: 



On Sat, Oct 24, 2015 at 5:34 AM, Joshua Schaeffer < jschaeffer0922 at gmail.com > wrote: 

BQ_BEGIN

I set the virtual switch that the host uses to promiscuous mode and I can ping the gateway and other machines on my subnet from the container, however I still cannot get to the outside world: 





BQ_BEGIN

Is this because of my routing table on the container? 


BQ_END

BQ_BEGIN


BQ_BEGIN


BQ_BEGIN


BQ_BEGIN

Container: 
root at thinkweb:~# route -n 
Kernel IP routing table 
Destination Gateway Genmask Flags Metric Ref Use Iface 
192.168.54.0 0.0.0.0 255.255.255.128 U 0 0 0 eth0 


BQ_END


BQ_END


BQ_END


BQ_END


BQ_BEGIN


BQ_BEGIN


BQ_BEGIN


BQ_BEGIN


BQ_BEGIN

lxc.network.ipv4 = 192.168.54.110/25 

BQ_END


BQ_END


BQ_END


BQ_END


BQ_END


Obviously. 

You either need "lxc.network.ipv4.gateway" (see "man lxc.container.conf"), or setup networking inside the container (e.g on /etc/network/interfaces) 

-- 
Fajar 

_______________________________________________ 
lxc-users mailing list 
lxc-users at lists.linuxcontainers.org 
http://lists.linuxcontainers.org/listinfo/lxc-users 

BQ_END



_______________________________________________ 
lxc-users mailing list 
lxc-users at lists.linuxcontainers.org 
http://lists.linuxcontainers.org/listinfo/lxc-users 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20151026/2142ca33/attachment.html>


More information about the lxc-users mailing list