LXD & LXC
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.
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