LXD & LXC

From NixNet
Revision as of 05:11, 23 March 2021 by Manton (talk | contribs)
This article is part of a series of guides that describe NixNet's setup in excruciating detail. If you would like to follow them, please start at the Infrastructure page.
Caution: this guide is not finished yet; following it may leave you with an unuseable machine. To be notified of updates, please create an account and add it to your watchlist.

LXD Networking

To bind a container to a host port with NAT, you first need a static IP on the container:

lxc attach lxdbr0 <instance> eth0 eth0
lxc config device set <instance> eth0 ipv4.address=<container-ip>

Then the proxy device needs to be added:

lxc config device add <instance> port-forward proxy connect=tcp:<container-ip>:<port> listen=tcp:<host-ip>:<port> nat=true