Networking: Difference between revisions

Axka (talk | contribs)
mNo edit summary
Yuannan (talk | contribs)
 
(4 intermediate revisions by 2 users not shown)
Line 2: Line 2:


== Configuration ==
== Configuration ==
=== Wireless networks ===
See [[wpa_supplicant]] / [[Iwd]].


=== Static IP for network adapter ===
=== Static IP for network adapter ===
Line 114: Line 118:
};
};
</syntaxhighlight>
</syntaxhighlight>
=== Virtualization ===
Sometimes complex network configurations with VPNs or firewall rules you may need extra configurations in order for your VMs to have network access. It is recommended to use more granular control over the ports instead of simply allowing the entire interface.<syntaxhighlight lang="nix">networking = {
  firewall = {
    enable = true;
   
    # Allows the entire interface through the firewall.
    # trustedInterfaces = [
    #  "virbr0"
    # ];
    # Allows individual ports through the firewall.
    interfaces = {
      virbr0 = {
        allowedUDPPorts = [
          # DNS
          53
          # DHCP
          67
          # You may want to allow more ports such as ipv6 and other services here.
        ];
      };
    };
  };
  nat = {
    enable = true;
    internalInterfaces = [
      "virbr0"
    ];
  };
};</syntaxhighlight>


== IPv6 ==
== IPv6 ==