[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nix-dev
Subject:    [nix-devel] NixOS Container Bridge Networking
From:       Mark Gardner <mkg () vt ! edu>
Date:       2018-02-24 23:04:04
Message-ID: CAG=_CgBPh9JeaW18YNk7CtCtOEaqc9h36Mfb++obCZK0nRBoDQ () mail ! gmail ! com
[Download RAW message or body]

I am trying to use a nixos container to contain the unifi controller. I was
able to create the container imperatively via:

nixos-container create unifi --config "
  nixpkgs.config.allowUnfree = true;
  services.unifi = {
    enable = true;
  };
"

But the networking is private. Ports have to be made available so the Unifi
AP can talk to the controller. I used NAT as outlined in section 28.3 of
the NixOS manual and it works for this case. But this isn't completely
satisfactory as I may wish to have multiple containers that listen on the
same port (:80 for instance). So what I would rather have is the containers
use a bridge for networking so they have their own IP addresses and hence
can listen on the same port.

How would I do that?

Note: I saw several PRs related to the issue (#5857 and #14018 for
instance) but I can't see how to bridging work.

Mark
-- 
Mark Gardner
--

-- 
You received this message because you are subscribed to the Google Groups "nix-devel" \
group. To unsubscribe from this group and stop receiving emails from it, send an \
email to nix-devel+unsubscribe@googlegroups.com. To post to this group, send email to \
nix-devel@googlegroups.com. To view this discussion on the web visit \
https://groups.google.com/d/msgid/nix-devel/CAG%3D_CgBPh9JeaW18YNk7CtCtOEaqc9h36Mfb%2B%2BobCZK0nRBoDQ%40mail.gmail.com.
 For more options, visit https://groups.google.com/d/optout.


[Attachment #3 (text/html)]

<div dir="ltr"><div class="gmail_default" style="font-size:small">I am trying to use \
a nixos container to contain the unifi controller. I was able to create the container \
imperatively via:<br><br>nixos-container create unifi --config &quot;<br>   \
nixpkgs.config.allowUnfree = true;<br>   services.unifi = {<br>       enable = \
true;<br>   };<br>&quot;<br></div><div class="gmail_default" \
style="font-size:small"><br>But the networking is private. Ports have to be made \
available so the Unifi AP can talk to the controller. I used NAT as outlined in \
section 28.3 of the NixOS manual and it works for this case. But this isn&#39;t \
completely satisfactory as I may wish to have multiple containers that listen on the \
same port (:80 for instance). So what I would rather have is the containers use a \
bridge for networking so they have their own IP addresses and hence can listen on the \
same port.<br><br></div><div class="gmail_default" style="font-size:small">How would \
I do that?<br><br></div><div class="gmail_default" style="font-size:small">Note: I \
saw several PRs related to the issue (#5857 and #14018 for instance) but I can&#39;t \
see how to bridging work.<br></div><div class="gmail_default" \
style="font-size:small"><br></div><div class="gmail_default" \
style="font-size:small">Mark<br></div>-- <br><div \
class="gmail-m_-9003119403175808668gmail_signature">Mark Gardner<br>--</div> </div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups \
&quot;nix-devel&quot; group.<br /> To unsubscribe from this group and stop receiving \
emails from it, send an email to <a \
href="mailto:nix-devel+unsubscribe@googlegroups.com">nix-devel+unsubscribe@googlegroups.com</a>.<br \
/> To post to this group, send email to <a \
href="mailto:nix-devel@googlegroups.com">nix-devel@googlegroups.com</a>.<br /> To \
view this discussion on the web visit <a \
href="https://groups.google.com/d/msgid/nix-devel/CAG%3D_CgBPh9JeaW18YNk7CtCtOEaqc9h36 \
Mfb%2B%2BobCZK0nRBoDQ%40mail.gmail.com?utm_medium=email&utm_source=footer">https://gro \
ups.google.com/d/msgid/nix-devel/CAG%3D_CgBPh9JeaW18YNk7CtCtOEaqc9h36Mfb%2B%2BobCZK0nRBoDQ%40mail.gmail.com</a>.<br \
/> For more options, visit <a \
href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<br \
/>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic