1# IPv6 Configuration {#sec-ipv6} 2 3IPv6 is enabled by default. Stateless address autoconfiguration is used 4to automatically assign IPv6 addresses to all interfaces, and Privacy 5Extensions (RFC 4946) are enabled by default. You can adjust the default 6for this by setting [](#opt-networking.tempAddresses). This option 7may be overridden on a per-interface basis by 8[](#opt-networking.interfaces._name_.tempAddress). You can disable 9IPv6 support globally by setting: 10 11```nix 12{ 13 networking.enableIPv6 = false; 14} 15``` 16 17You can disable IPv6 on a single interface using a normal sysctl (in 18this example, we use interface `eth0`): 19 20```nix 21{ 22 boot.kernel.sysctl."net.ipv6.conf.eth0.disable_ipv6" = true; 23} 24``` 25 26As with IPv4 networking interfaces are automatically configured via 27DHCPv6. You can configure an interface manually: 28 29```nix 30{ 31 networking.interfaces.eth0.ipv6.addresses = [ { 32 address = "fe00:aa:bb:cc::2"; 33 prefixLength = 64; 34 } ]; 35} 36``` 37 38For configuring a gateway, optionally with explicitly specified 39interface: 40 41```nix 42{ 43 networking.defaultGateway6 = { 44 address = "fe00::1"; 45 interface = "enp0s3"; 46 }; 47} 48``` 49 50See [](#sec-ipv4) for similar examples and additional information.