<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><blockquote type="cite"><div><pre style="white-space: pre-wrap;">On Thu, Jan 30, 2014 at 5:21 PM, Thomas Huber <<a href="http://lists.linuxcontainers.org/listinfo/lxc-users">miraculli at gmail.com</a>> wrote:

><i> Hi out there,
</i>><i>
</i>><i> is it a good idea to setup a kind of virtual router inside a LXC?
</i>><i> I got a server with dual 1Gbit Nic and the server should run several
</i>><i> services.
</i>><i> I also would like to use it as a router and a thought it would be quite
</i>><i> nice to set it up inside a LXC by mapping the WAN-port with
</i>><i> "lxc.network.type = phys" to the Container.
</i>><i>
</i>><i> first of all: is this a good idea?
</i>><i>
</i>><i>
</i>I suggest you try it, and see if it works for your case.

</pre></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><pre style="white-space: pre-wrap;">In my case, I tested using phys for a while on a container for a somewhat</pre></div></blockquote><div><pre style="white-space: pre-wrap;">busy webserver. It worked fine initially, but the problem came when I
shutdown the container. The container is gone, but the interface was not
visible on the host again. Which makes it impossible to restart container.

I ended up reverting to veth instead. Using that same container, the veth
(on the host side) was not deleted when the container was destroyed, but I
can force-destroy it using "ip link del" and "lxc.network.script.down".



><i> second: is it possible
</i>

possible, yes. As long as the needed iptables modules are already loaded on
the host side.


><i> to do all the firewalling inside the LXC or is it better (more secure) to
</i>><i> do this at the host?
</i>><i>
</i>><i>
</i>That is what I usually do.

-- 
FAN</pre></div></blockquote><br><div>Thanks for your reply… </div><div>so you think, it´s no problem to map the WAN-port as „veth"</div><div>just to avoid misunderstanding, you usually do what? Run the firewall inside LXC or on the host.</div><div><br></div><div>—</div><div>mirac</div><div><br></div><div><br></div><div><br></div><div><br></div></body></html>