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 12networking.enableIPv6 = false; 13``` 14 15You can disable IPv6 on a single interface using a normal sysctl (in 16this example, we use interface `eth0`): 17 18```nix 19boot.kernel.sysctl."net.ipv6.conf.eth0.disable_ipv6" = true; 20``` 21 22As with IPv4 networking interfaces are automatically configured via 23DHCPv6. You can configure an interface manually: 24 25```nix 26networking.interfaces.eth0.ipv6.addresses = [ { 27 address = "fe00:aa:bb:cc::2"; 28 prefixLength = 64; 29} ]; 30``` 31 32For configuring a gateway, optionally with explicitly specified 33interface: 34 35```nix 36networking.defaultGateway6 = { 37 address = "fe00::1"; 38 interface = "enp0s3"; 39}; 40``` 41 42See [](#sec-ipv4) for similar examples and additional information.