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 4941) 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{ networking.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 19{ boot.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 26{ 27 networking.interfaces.eth0.ipv6.addresses = [ 28 { 29 address = "fe00:aa:bb:cc::2"; 30 prefixLength = 64; 31 } 32 ]; 33} 34``` 35 36For configuring a gateway, optionally with explicitly specified 37interface: 38 39```nix 40{ 41 networking.defaultGateway6 = { 42 address = "fe00::1"; 43 interface = "enp0s3"; 44 }; 45} 46``` 47 48See [](#sec-ipv4) for similar examples and additional information.