[Nix-dev] IPv6 (was: static networking and dns)

Peter Simons simons at cryp.to
Mon Aug 13 22:37:31 CEST 2012


Hi Mathijs,

 > I could not find options to set ipv6 addresses

it is possible to configure interfaces with IPv6 addresses, but setting
the default route requires localCommands trickery:

  networking = {
    enableIPv6 = true;
    useDHCP = false;
    defaultGateway = "134.0.24.129";
    nameservers = [ "95.129.51.51" "8.8.8.8" ];
    interfaces = [
      { name = "eth0"; ipAddress = "134.0.24.155"; subnetMask = "255.255.255.128"; }
      { name = "eth0"; ipAddress = "2a03:2900:2:1::5f"; subnetMask = "64"; }
    ];
    localCommands = "ip route add default via 2a03:2900:2:1::1";
  };

I guess, it would be possible to extend networking.defaultGateway to
configure IPv6 default routes, too. Unfortunately, it's currently
expected to be a string (rather than a list of strings).

Take care,
Peter



More information about the nix-dev mailing list