[lxc-users] Bind public IP that is available on host's ens3:1 to a specific LXD container?

Thomas Ward teward at ubuntu.com
Sat May 20 03:31:52 UTC 2017


Thanks to some off-list replies and some help from other online
resources, I've been able to switch this to a bridged method, with the
host interfaces set to 'manual', an inet0 bridge created that is static
IP'd for the host system to have its primary IP, and can have manual IP
assignments to containers on that bridged network for the other
non-primary IPs.  I've also kept an `lxdbr0` device from the older
lxd-bridge setup that I still had for NAT'd containers, since I have
more containers than public IPs, and many of the containers don't need
to be on public IPs.

Thank you to the people who replied to me off-list, but also the people
in general who help people new to LXC/LXD networking get started working
through issues they've run into!


Thomas


On 05/19/2017 10:01 PM, Thomas Ward wrote:
> Hello.
>
> I've got a VDS from RamNode - which is essentially a KVM VPS with
> dedicated CPUs, and larger RAM capacity.  This VDS has three IPs.  I'm
> going to obfuscate them here, but essentially the host box is configured
> like this:
>
>
> # The primary network interface
> auto ens3
> iface ens3 inet static
>     address 1.2.3.107
>     netmask 255.255.255.0
>     gateway 1.2.3.1
>     dns-nameserver 8.8.8.8 8.8.4.4
>
> auto ens3:1
> iface ens3:2 inet static
>     address 1.2.4.17
>     netmask 255.255.255.0
>     gateway 1.2.4.1
>     dns-nameserver 8.8.8.8 8.8.4.4
>
> auto ens3:2
> iface ens3:2 inet static
>     address 1.2.4.34
>     netmask 255.255.255.0
>     gateway 1.2.4.1
>     dns-nameserver 8.8.8.8 8.8.4.4
>
>
> Now, I've got a container I'd like to route the 1.2.4.17 to a specific
> container once I've created it, but ens3 is the only actual physical NIC
> on the system, and I don't have the ability to add any more physical NICs.
>
> How would I go about routing 1.2.4.17 to the 'new' container I'm going
> to create?
>
> Note that by default, new containers are attached to an 'lxdbr0' which
> NATs container traffic, this new container would have to reside outside
> that obviously, but I'm not fluent in LXC/LXD networking so a guide
> and/or how-tos for this would be wonderful to have.
>
>
> ------
>
> Thomas
>



More information about the lxc-users mailing list