Difference between revisions of "LXD & LXC"

From NixNet
m (add custom image header)
Line 3: Line 3:
 
{{unfinished}}
 
{{unfinished}}
  
 +
== Custom Images ==
  
 +
<pre>
 +
lxc publish <container>
 +
</pre>
  
[[Category:Admin guides]]
+
== LXD Networking ==
 
 
<h1> LXD Networking </h1>
 
  
 
To bind a container to a host port with NAT, you first need a static IP on the container:
 
To bind a container to a host port with NAT, you first need a static IP on the container:
Line 19: Line 21:
 
lxc config device add <instance> port-forward proxy connect=tcp:<container-ip>:<port> listen=tcp:<host-ip>:<port> nat=true
 
lxc config device add <instance> port-forward proxy connect=tcp:<container-ip>:<port> listen=tcp:<host-ip>:<port> nat=true
 
</pre>
 
</pre>
 +
 +
[[Category:Admin guides]]

Revision as of 03:49, 29 March 2021

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.

Custom Images

lxc publish <container>

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