<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_default" style="color:rgb(0,0,102);display:inline">​</div>><br>> ---------- Forwarded message ----------<br>> From: Saurabh Deshpande <<a href="mailto:saurabh.n.deshpande@gmail.com">saurabh.n.deshpande@gmail.com</a>><br>> To: <a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>> Cc: <br>> Date: Tue, 3 Jan 2017 08:21:35 -0500<br>> Subject: [lxc-users] LXC Containers and Bridge Networking in Arch Linux<br>><br>> Hello Guys,<br>><br>><br>> I am trying to set up LXC on Arch Linux with systemd-networkd for networking.<br>> I see that the bridge can be set up to either use DHCP or a static IP but we lose a static IP set on actual connected nic (eth0).<br>> Can someone please tell me if it is possible to achieve below.<br>> eth0 / ens192 : This should have its own static IP address for connecting and managing the host.<br>> br0 / lxcbr0 : This should have it's own subnet so that all subsequent guests will have a IP from the alloted range. <br>><br>> Regards,<br>><br>> Saurabh<br>><br>><br>><br>> ---------- Forwarded message ----------<br>> From: "Fajar A. Nugraha" <<a href="mailto:list@fajar.net">list@fajar.net</a>><br>> To: LXC users mailing-list <<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>><br>> Cc: <br>> Date: Wed, 4 Jan 2017 14:32:23 +0700<br>> Subject: Re: [lxc-users] LXC Containers and Bridge Networking in Arch Linux<br>> On Tue, Jan 3, 2017 at 8:21 PM, Saurabh Deshpande <<a href="mailto:saurabh.n.deshpande@gmail.com">saurabh.n.deshpande@gmail.com</a>> wrote:<br>>><br>>> Hello Guys,<br>>><br>>><br>>> I am trying to set up LXC on Arch Linux with systemd-networkd for networking.<br>>> I see that the bridge can be set up to either use DHCP or a static IP but we lose a static IP set on actual connected nic (eth0).<br>>> Can someone please tell me if it is possible to achieve below.<br>>> eth0 / ens192 : This should have its own static IP address for connecting and managing the host.<br>>> br0 / lxcbr0 : This should have it's own subnet so that all subsequent guests will have a IP from the alloted range. <br>><br>><br>> Do you mean "eth0 and br0 should be in the same network (which has an external DHCP server, managed by someone else), but eth0 has static ip address, and br0 manage dynamic ip range for lxc guest"? <br>><br>> If yes -> short answer: not possible. Not really lxc-specific, but generic TCP/IP networking.<br>><br>> If no -> describe what you want in more detail. Using ASCII art and dummy IP addresses (e.g. 10.0.0.1, etc) often helps.<br>><br>> The usual scenarios are:<br>> (1) let lxc manage its own bridge, using a private network that exists only on that host (the default setup). Create NAT for each service in the container that you need to access from outside the host<br>><br>> (2) create a bridge with host's eth0 as slave, put containers there as well. The containers will then behave (frm networking perspective) just like any other host on that network (e.g. it can get dynamic IP address from whatever-dhcp-server on that network)<br>><br>> -- <br>> Fajar<br><br><br>First of all apologies if I am not replying to this message correctly. <br>Second of all apologies for not explaining my question correctly.<br>I will try to elaborate on the problem I am facing.<br><br>I am looking to run lxc containers on Arch Linux.<br>Hypothetically this Arch Linux server has a local IP of 10.10.10.120 with Gateway of 10.10.10.250 and DNS Address as 10.10.10.249<br>I would like to have the containers on this servers running on Subnet of <a href="http://10.20.20.1/24">10.20.20.1/24</a>. They should have access to Internet but no one on the Local Lan (<a href="http://10.10.10.1/24">10.10.10.1/24</a>) should have direct connectivity to it. The only way these containers can be accessed is via IPTables or via Proxy.<br><br>--<br>Saurabh N. Deshpande</blockquote></div>
</div></div>