Networking: Difference between revisions

imported>Onny
Add section on port forwarding
imported>Onny
Add section on static ip configuration
Line 2: Line 2:


== Configuration ==
== Configuration ==
=== Static IP for network adapter ===
The following example configures a static IPv6 address and a default gateway for the interface <code>ens3</code>
<syntaxhighlight lang="nix">
networking = {
  interfaces = {
    ens3.ipv6.addresses = [{
      address = "2a01:4f8:1c1b:16d0::";
      prefixLength = 64;
    }];
  };
  defaultGateway6 = {
    address = "fe80::1";
    interface = "ens3";
  };
};
</syntaxhighlight>


=== Hosts file ===
=== Hosts file ===