[Nix-dev] nixos-container networking

Arnold Krille arnold at arnoldarts.de
Tue Mar 14 21:43:02 CET 2017


Hi,

I think one of the best resources showing how networking and containers
works, is the tests for containers and networking ;-)
From them I also based my setup which you can see a slightly old
version of at https://github.com/kampfschlaefer/nixconfig.

Also you already found the 13-char limit on container names, which is a
result of the 16-char limit of network interface names in linux and the
devices are vb-<name> or ve-<name> for the containers… I was planning
to add an assertion there but got sidetracked by life and a 3D printer.

Have fun,

Arnold

On Mon, 13 Mar 2017 02:12:12 +0000 Tomasz Czyż <tomasz.czyz at gmail.com>
wrote:
> Hey,
> 
> could anyone using nixos-container (declarative style) share how you
> setup networking?
> 
> I'm trying to setup few containers with private network and http
> proxy at the front. Each container potentially could run application
> on port 80 and I would like to expose them through proxy.
> 
> I tried to set this up with
> 
> privateNetwork=true;
> hostAddress
> localAddress
> 
> and I tried to also run nat on the host with (just to enable outbound
> traffic)
> internalInterfaces = ["ve-+"];
> externalInterfaces = "eth0";
> 
> but no luck.
> My next try will be creating bridge on the host and add containers to
> that bridge. Is that how you do stuff or are better ways of doing
> container networking?
> 
> Tom

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: not available
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20170314/2f7946d6/attachment-0001.sig>


More information about the nix-dev mailing list