<div dir="ltr"><div>Hi, I figured it out, I used ebtables to rewrite the mac address on postrouting and everything works. <br><br>Now I have another problem with LXC containers running Ubuntu 14.04, the DNS server does not persist on reboot, it seems like my /etc/network/interfaces is not being read and when I do sudo ifdown -a && sudo ifup -a from the container I get the error:<br>
<br>RTNETLINK answers: File exists<br>Failed to bring up eth0.<br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jun 9, 2014 at 7:32 PM, Serge Hallyn <span dir="ltr"><<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Are you using veth or macvlan?  Please show the container configuration<br>
as well as /etc/network/interfaces on the host and 'brctl show' and<br>
'ifconfig -a' output.<br>
<div class="HOEnZb"><div class="h5"><br>
Quoting Shidan (<a href="mailto:shidan@gmail.com">shidan@gmail.com</a>):<br>
> Thanks for the help Stéphane and Serge.<br>
><br>
> I've set it up so that the host device is a bridge br0, I then assigned<br>
> those IP addresses which were previously aliases on eth0 to the containers<br>
> (configured with same gateway as the host) and connected them to the br0<br>
> bridge.<br>
><br>
> The network works fine internally, I can SSH into the host from the<br>
> containers and vice versa.<br>
><br>
> However, I can't access from or to anything external, I think this is<br>
> because the mac addresses of the containers are different than the mac<br>
> address of the host and the gateway won't allow this. How can I make it so<br>
> that it will use the hosts mac address with the outside world.<br>
><br>
><br>
><br>
><br>
> On Thu, Jun 5, 2014 at 2:32 PM, Stéphane Graber <<a href="mailto:stgraber@ubuntu.com">stgraber@ubuntu.com</a>> wrote:<br>
><br>
> > On Thu, Jun 05, 2014 at 05:35:10PM +0000, Serge Hallyn wrote:<br>
> > > Quoting Shidan (<a href="mailto:shidan@gmail.com">shidan@gmail.com</a>):<br>
> > > > Hello, on my host I have 4 VLAN interfaces on eth0<br>
> > > > (eth0:1, eth0:2, eth0:3, eth0:4) and each one has its own assigned<br>
> > public<br>
> > > > IP address.<br>
> ><br>
> > Also note that eth0:1 isn't a vlan interface, it's simply an extra<br>
> > address added to eth0 with an alias value of "eth0:1". So even if we did<br>
> > have the phys or vlan interface types working with unprivileged<br>
> > containers, they still wouldn't work with interface aliases.<br>
> ><br>
> > In your case, I think you either want to put eth0 itself into a bridge<br>
> > accessible to your containers or maybe do something with the macvlan<br>
> > driver instead (though that latter won't work with unprivileged<br>
> > containers).<br>
> ><br>
> > > ><br>
> > > > I want to create 4 unprivileged containers and assign a unique VLAN<br>
> > > > interface to each, similar (I think) to a PHYS network type. How<br>
> > should I<br>
> > > > go about doing this?<br>
> > ><br>
> > > Currently that's not possible, only veth is supported in unprivileged<br>
> > > containers.  What you can do is bridge each link and connect the<br>
> > > unpriv container veths to those bridges<br>
> > > _______________________________________________<br>
> > > lxc-users mailing list<br>
> > > <a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
> > > <a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
> ><br>
> > --<br>
> > Stéphane Graber<br>
> > Ubuntu developer<br>
> > <a href="http://www.ubuntu.com" target="_blank">http://www.ubuntu.com</a><br>
> ><br>
> > _______________________________________________<br>
> > lxc-users mailing list<br>
> > <a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
> > <a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
> ><br>
<br>
> _______________________________________________<br>
> lxc-users mailing list<br>
> <a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
> <a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
<br>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a></div></div></blockquote></div><br></div>