Darth Android
2016-12-17, 11:49 AM
You can do what you want, but you'll need 3 IP addresses - one for the host, and one for each container. First, go into your OVH control panel, and create a Virtual MAC for each container IP (type = OVH). Note the MAC and which IP it goes to, you'll need that later.
You've already created a bridge device and configured that with your host IP (71.X.X.X).
Now, we need to tell LXD to not use a NAT configuration and instead bridge the container directly to the internet. I'm not familiar with LXD, only the old-style LXC configs, but you should be able to convert the following to work with LXD:
Apply that to both containers, each with a different ip and virtual MAC that correspond to the IPs you set up in your control panel.
You've already created a bridge device and configured that with your host IP (71.X.X.X).
Now, we need to tell LXD to not use a NAT configuration and instead bridge the container directly to the internet. I'm not familiar with LXD, only the old-style LXC configs, but you should be able to convert the following to work with LXD:
Code:
# Network configuration lxc.network.type = veth lxc.network.veth.pair = conainer0 #name of the container's interface on the host, not important, just better than vethXXXXX. Must be unique lxc.network.link = br0 lxc.network.flags = up lxc.network.hwaddr = 02:00:00:XX:XX:XX # This must match the virtual MAC you set for the IP in your OVH control panel. lxc.network.ipv4 = 213.Y.Y.Y/32 213.Y.Y.Y # 213.X.X.X is the container IP lxc.network.ipv4.gateway = 71.X.X.254 # Gateway of the host IP