How do I use additional addresses within a VPC?
I have an Ubuntu 20.04 droplet running LXC. By default, LXC containers uses a network local to the host/droplet. However, I want to “bridge” the container’s network and assign each container an IP address from the VPC. This way, other droplets on the VPC can access the container directly, without having to port forward through the LXC host droplet.
On my home network, this works fine – when I bridge the container’s network, the container effectively acts as another physical host on my LAN and uses network’s DHCP server to assign itself an IP address.
How does this work in a Digital Ocean VPC? If I tell LXC to bridge on eth1 (the private network adapter), will it use DHCP and get its own address? Will it avoid addressing conflicts with other droplets and containers on the same network? Or do I have to run my own DHCP server or something?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×