nixos/tests: rename IP addresses/routes options

rnhmjoj e239c1e5 c1bed05e

+74 -67
+1 -1
nixos/modules/virtualisation/virtualbox-host.nix
··· 124 ''; 125 }; 126 127 - networking.interfaces.vboxnet0.ip4 = [ { address = "192.168.56.1"; prefixLength = 24; } ]; 128 # Make sure NetworkManager won't assume this interface being up 129 # means we have internet access. 130 networking.networkmanager.unmanaged = ["vboxnet0"];
··· 124 ''; 125 }; 126 127 + networking.interfaces.vboxnet0.ipv4.addresses = { address = "192.168.56.1"; prefixLength = 24; }; 128 # Make sure NetworkManager won't assume this interface being up 129 # means we have internet access. 130 networking.networkmanager.unmanaged = ["vboxnet0"];
+3 -3
nixos/tests/bittorrent.nix
··· 16 miniupnpdConf = nodes: pkgs.writeText "miniupnpd.conf" 17 '' 18 ext_ifname=eth1 19 - listening_ip=${(pkgs.lib.head nodes.router.config.networking.interfaces.eth2.ip4).address}/24 20 allow 1024-65535 192.168.2.0/24 1024-65535 21 ''; 22 ··· 56 { environment.systemPackages = [ pkgs.transmission ]; 57 virtualisation.vlans = [ 2 ]; 58 networking.defaultGateway = 59 - (pkgs.lib.head nodes.router.config.networking.interfaces.eth2.ip4).address; 60 networking.firewall.enable = false; 61 }; 62 ··· 84 # Create the torrent. 85 $tracker->succeed("mkdir /tmp/data"); 86 $tracker->succeed("cp ${file} /tmp/data/test.tar.bz2"); 87 - $tracker->succeed("transmission-create /tmp/data/test.tar.bz2 -p -t http://${(pkgs.lib.head nodes.tracker.config.networking.interfaces.eth1.ip4).address}:6969/announce -o /tmp/test.torrent"); 88 $tracker->succeed("chmod 644 /tmp/test.torrent"); 89 90 # Start the tracker. !!! use a less crappy tracker
··· 16 miniupnpdConf = nodes: pkgs.writeText "miniupnpd.conf" 17 '' 18 ext_ifname=eth1 19 + listening_ip=${(pkgs.lib.head nodes.router.config.networking.interfaces.eth2.ipv4.addresses).address}/24 20 allow 1024-65535 192.168.2.0/24 1024-65535 21 ''; 22 ··· 56 { environment.systemPackages = [ pkgs.transmission ]; 57 virtualisation.vlans = [ 2 ]; 58 networking.defaultGateway = 59 + (pkgs.lib.head nodes.router.config.networking.interfaces.eth2.ipv4.addresses).address; 60 networking.firewall.enable = false; 61 }; 62 ··· 84 # Create the torrent. 85 $tracker->succeed("mkdir /tmp/data"); 86 $tracker->succeed("cp ${file} /tmp/data/test.tar.bz2"); 87 + $tracker->succeed("transmission-create /tmp/data/test.tar.bz2 -p -t http://${(pkgs.lib.head nodes.tracker.config.networking.interfaces.eth1.ipv4.addresses).address}:6969/announce -o /tmp/test.torrent"); 88 $tracker->succeed("chmod 644 /tmp/test.torrent"); 89 90 # Start the tracker. !!! use a less crappy tracker
+6 -3
nixos/tests/cjdns.nix
··· 12 # the sequence of address assignment less stochastic. 13 networking.useDHCP = false; 14 15 - networking.interfaces.eth1.prefixLength = 24; 16 # CJDNS output is incompatible with the XML log. 17 systemd.services.cjdns.serviceConfig.StandardOutput = "null"; 18 #networking.firewall.enable = true; ··· 49 50 { imports = [ basicConfig ]; 51 52 - networking.interfaces.eth1.ipAddress = "192.168.0.2"; 53 54 services.cjdns = 55 { UDPInterface = ··· 76 CJDNS_ADMIN_PASSWORD=FOOBAR 77 ''; 78 79 - networking.interfaces.eth1.ipAddress = "192.168.0.1"; 80 81 services.cjdns = 82 { authorizedPasswords = [ carolPassword ];
··· 12 # the sequence of address assignment less stochastic. 13 networking.useDHCP = false; 14 15 # CJDNS output is incompatible with the XML log. 16 systemd.services.cjdns.serviceConfig.StandardOutput = "null"; 17 #networking.firewall.enable = true; ··· 48 49 { imports = [ basicConfig ]; 50 51 + networking.interfaces.eth1.ipv4.addresses = [ 52 + { address = "192.168.0.2"; prefixLength = 24; } 53 + ]; 54 55 services.cjdns = 56 { UDPInterface = ··· 77 CJDNS_ADMIN_PASSWORD=FOOBAR 78 ''; 79 80 + networking.interfaces.eth1.ipv4.addresses = [ 81 + { address = "192.168.0.1"; prefixLength = 24; } 82 + ]; 83 84 services.cjdns = 85 { authorizedPasswords = [ carolPassword ];
+2 -2
nixos/tests/containers-bridge.nix
··· 26 }; 27 networking.interfaces = { 28 br0 = { 29 - ip4 = [{ address = hostIp; prefixLength = 24; }]; 30 - ip6 = [{ address = hostIp6; prefixLength = 7; }]; 31 }; 32 }; 33
··· 26 }; 27 networking.interfaces = { 28 br0 = { 29 + ipv4.addresses = [{ address = hostIp; prefixLength = 24; }]; 30 + ipv6.addresses = [{ address = hostIp6; prefixLength = 7; }]; 31 }; 32 }; 33
+3 -3
nixos/tests/containers-extra_veth.nix
··· 21 }; 22 networking.interfaces = { 23 br0 = { 24 - ip4 = [{ address = "192.168.0.1"; prefixLength = 24; }]; 25 - ip6 = [{ address = "fc00::1"; prefixLength = 7; }]; 26 }; 27 br1 = { 28 - ip4 = [{ address = "192.168.1.1"; prefixLength = 24; }]; 29 }; 30 }; 31
··· 21 }; 22 networking.interfaces = { 23 br0 = { 24 + ipv4.addresses = [{ address = "192.168.0.1"; prefixLength = 24; }]; 25 + ipv6.addresses = [{ address = "fc00::1"; prefixLength = 7; }]; 26 }; 27 br1 = { 28 + ipv4.addresses = [{ address = "192.168.1.1"; prefixLength = 24; }]; 29 }; 30 }; 31
+3 -3
nixos/tests/containers-hosts.nix
··· 13 virtualisation.vlans = []; 14 15 networking.bridges.br0.interfaces = []; 16 - networking.interfaces.br0 = { 17 - ip4 = [ { address = "10.11.0.254"; prefixLength = 24; } ]; 18 - }; 19 20 # Force /etc/hosts to be the only source for host name resolution 21 environment.etc."nsswitch.conf".text = lib.mkForce ''
··· 13 virtualisation.vlans = []; 14 15 networking.bridges.br0.interfaces = []; 16 + networking.interfaces.br0.ipv4.addresses = [ 17 + { address = "10.11.0.254"; prefixLength = 24; } 18 + ]; 19 20 # Force /etc/hosts to be the only source for host name resolution 21 environment.etc."nsswitch.conf".text = lib.mkForce ''
+4 -4
nixos/tests/containers-macvlans.nix
··· 26 interface = "eth1"; 27 mode = "bridge"; 28 }; 29 - networking.interfaces.eth1.ip4 = lib.mkForce []; 30 networking.interfaces.mv-eth1-host = { 31 - ip4 = [ { address = "192.168.1.1"; prefixLength = 24; } ]; 32 }; 33 34 containers.test1 = { ··· 37 38 config = { 39 networking.interfaces.mv-eth1 = { 40 - ip4 = [ { address = containerIp1; prefixLength = 24; } ]; 41 }; 42 }; 43 }; ··· 48 49 config = { 50 networking.interfaces.mv-eth1 = { 51 - ip4 = [ { address = containerIp2; prefixLength = 24; } ]; 52 }; 53 }; 54 };
··· 26 interface = "eth1"; 27 mode = "bridge"; 28 }; 29 + networking.interfaces.eth1.ipv4.addresses = lib.mkForce []; 30 networking.interfaces.mv-eth1-host = { 31 + ipv4.addresses = [ { address = "192.168.1.1"; prefixLength = 24; } ]; 32 }; 33 34 containers.test1 = { ··· 37 38 config = { 39 networking.interfaces.mv-eth1 = { 40 + ipv4.addresses = [ { address = containerIp1; prefixLength = 24; } ]; 41 }; 42 }; 43 }; ··· 48 49 config = { 50 networking.interfaces.mv-eth1 = { 51 + ipv4.addresses = [ { address = containerIp2; prefixLength = 24; } ]; 52 }; 53 }; 54 };
+12 -12
nixos/tests/containers-physical_interfaces.nix
··· 16 interfaces = [ "eth1" ]; 17 18 config = { 19 - networking.interfaces.eth1 = { 20 - ip4 = [ { address = "10.10.0.1"; prefixLength = 24; } ]; 21 - }; 22 networking.firewall.enable = false; 23 }; 24 }; ··· 33 34 config = { 35 networking.bridges.br0.interfaces = [ "eth1" ]; 36 - networking.interfaces.br0 = { 37 - ip4 = [ { address = "10.10.0.2"; prefixLength = 24; } ]; 38 - }; 39 networking.firewall.enable = false; 40 }; 41 }; ··· 54 interfaces = [ "eth1" ]; 55 mode = "active-backup"; 56 }; 57 - networking.interfaces.bond0 = { 58 - ip4 = [ { address = "10.10.0.3"; prefixLength = 24; } ]; 59 - }; 60 networking.firewall.enable = false; 61 }; 62 }; ··· 76 mode = "active-backup"; 77 }; 78 networking.bridges.br0.interfaces = [ "bond0" ]; 79 - networking.interfaces.br0 = { 80 - ip4 = [ { address = "10.10.0.4"; prefixLength = 24; } ]; 81 - }; 82 networking.firewall.enable = false; 83 }; 84 };
··· 16 interfaces = [ "eth1" ]; 17 18 config = { 19 + networking.interfaces.eth1.ipv4.addresses = [ 20 + { address = "10.10.0.1"; prefixLength = 24; } 21 + ]; 22 networking.firewall.enable = false; 23 }; 24 }; ··· 33 34 config = { 35 networking.bridges.br0.interfaces = [ "eth1" ]; 36 + networking.interfaces.br0.ipv4.addresses = [ 37 + { address = "10.10.0.2"; prefixLength = 24; } 38 + ]; 39 networking.firewall.enable = false; 40 }; 41 }; ··· 54 interfaces = [ "eth1" ]; 55 mode = "active-backup"; 56 }; 57 + networking.interfaces.bond0.ipv4.addresses = [ 58 + { address = "10.10.0.3"; prefixLength = 24; } 59 + ]; 60 networking.firewall.enable = false; 61 }; 62 }; ··· 76 mode = "active-backup"; 77 }; 78 networking.bridges.br0.interfaces = [ "bond0" ]; 79 + networking.interfaces.br0.ipv4.addresses = [ 80 + { address = "10.10.0.4"; prefixLength = 24; } 81 + ]; 82 networking.firewall.enable = false; 83 }; 84 };
+1 -1
nixos/tests/containers-reloadable.nix
··· 11 12 # prevent make-test.nix to change IP 13 networking.interfaces = { 14 - eth1.ip4 = lib.mkOverride 0 [ ]; 15 }; 16 }; 17 in {
··· 11 12 # prevent make-test.nix to change IP 13 networking.interfaces = { 14 + eth1.ipv4.addresses = lib.mkOverride 0 [ ]; 15 }; 16 }; 17 in {
+7 -7
nixos/tests/containers-restart_networking.nix
··· 11 config = { 12 networking.firewall.enable = false; 13 networking.firewall.allowPing = true; 14 - networking.interfaces.eth0.ip4 = [ 15 { address = "192.168.1.122"; prefixLength = 24; } 16 ]; 17 }; ··· 33 rstp = false; 34 }; 35 networking.interfaces = { 36 - eth1.ip4 = lib.mkOverride 0 [ ]; 37 - br0.ip4 = [{ address = "192.168.1.1"; prefixLength = 24; }]; 38 }; 39 40 }; ··· 44 rstp = false; 45 }; 46 networking.interfaces = { 47 - eth1.ip4 = lib.mkOverride 0 [ ]; 48 - br0.ip4 = [{ address = "192.168.1.2"; prefixLength = 24; }]; 49 }; 50 }; 51 client_eth1_rstp = { lib, pkgs, ... }: client_base // { ··· 54 rstp = true; 55 }; 56 networking.interfaces = { 57 - eth1.ip4 = lib.mkOverride 0 [ ]; 58 - br0.ip4 = [{ address = "192.168.1.2"; prefixLength = 24; }]; 59 }; 60 }; 61 };
··· 11 config = { 12 networking.firewall.enable = false; 13 networking.firewall.allowPing = true; 14 + networking.interfaces.eth0.ipv4.addresses = [ 15 { address = "192.168.1.122"; prefixLength = 24; } 16 ]; 17 }; ··· 33 rstp = false; 34 }; 35 networking.interfaces = { 36 + eth1.ipv4.addresses = lib.mkOverride 0 [ ]; 37 + br0.ipv4.addresses = [ { address = "192.168.1.1"; prefixLength = 24; } ]; 38 }; 39 40 }; ··· 44 rstp = false; 45 }; 46 networking.interfaces = { 47 + eth1.ipv4.addresses = lib.mkOverride 0 [ ]; 48 + br0.ipv4.addresses = [ { address = "192.168.1.2"; prefixLength = 24; } ]; 49 }; 50 }; 51 client_eth1_rstp = { lib, pkgs, ... }: client_base // { ··· 54 rstp = true; 55 }; 56 networking.interfaces = { 57 + eth1.ipv4.addresses = lib.mkOverride 0 [ ]; 58 + br0.ipv4.addresses = [ { address = "192.168.1.2"; prefixLength = 24; } ]; 59 }; 60 }; 61 };
+4 -4
nixos/tests/ferm.nix
··· 11 with pkgs.lib; 12 { 13 networking = { 14 - interfaces.eth1.ip6 = mkOverride 0 [ { address = "fd00::2"; prefixLength = 64; } ]; 15 - interfaces.eth1.ip4 = mkOverride 0 [ { address = "192.168.1.2"; prefixLength = 24; } ]; 16 }; 17 }; 18 server = ··· 20 with pkgs.lib; 21 { 22 networking = { 23 - interfaces.eth1.ip6 = mkOverride 0 [ { address = "fd00::1"; prefixLength = 64; } ]; 24 - interfaces.eth1.ip4 = mkOverride 0 [ { address = "192.168.1.1"; prefixLength = 24; } ]; 25 }; 26 27 services = {
··· 11 with pkgs.lib; 12 { 13 networking = { 14 + interfaces.eth1.ipv6.addresses = mkOverride 0 [ { address = "fd00::2"; prefixLength = 64; } ]; 15 + interfaces.eth1.ipv4.addresses = mkOverride 0 [ { address = "192.168.1.2"; prefixLength = 24; } ]; 16 }; 17 }; 18 server = ··· 20 with pkgs.lib; 21 { 22 networking = { 23 + interfaces.eth1.ipv6.addresses = mkOverride 0 [ { address = "fd00::1"; prefixLength = 64; } ]; 24 + interfaces.eth1.ipv4.addresses = mkOverride 0 [ { address = "192.168.1.1"; prefixLength = 24; } ]; 25 }; 26 27 services = {
+1 -3
nixos/tests/initrd-network-ssh/default.nix
··· 11 { config, pkgs, ... }: 12 { 13 boot.kernelParams = [ 14 - "ip=${ 15 - (head config.networking.interfaces.eth1.ip4).address 16 - }:::255.255.255.0::eth1:none" 17 ]; 18 boot.initrd.network = { 19 enable = true;
··· 11 { config, pkgs, ... }: 12 { 13 boot.kernelParams = [ 14 + "ip=${config.networking.primaryIPAddress}:::255.255.255.0::eth1:none" 15 ]; 16 boot.initrd.network = { 17 enable = true;
+1 -1
nixos/tests/nat.nix
··· 35 { virtualisation.vlans = [ 1 ]; 36 networking.firewall.allowPing = true; 37 networking.defaultGateway = 38 - (pkgs.lib.head nodes.router.config.networking.interfaces.eth2.ip4).address; 39 } 40 (lib.optionalAttrs withConntrackHelpers { 41 networking.firewall.connectionTrackingModules = [ "ftp" ];
··· 35 { virtualisation.vlans = [ 1 ]; 36 networking.firewall.allowPing = true; 37 networking.defaultGateway = 38 + (pkgs.lib.head nodes.router.config.networking.interfaces.eth2.ipv4.addresses).address; 39 } 40 (lib.optionalAttrs withConntrackHelpers { 41 networking.firewall.connectionTrackingModules = [ "ftp" ];
+11 -11
nixos/tests/networking.nix
··· 21 firewall.allowedUDPPorts = [ 547 ]; 22 interfaces = mkOverride 0 (listToAttrs (flip map vlanIfs (n: 23 nameValuePair "eth${toString n}" { 24 - ipv4.addresses = [ { address = "192.168.${toString n}.1"; prefixLength = 24;} ]; 25 - ipv6.addresses = [ { address = "fd00:1234:5678:${toString n}::1"; prefixLength = 64;} ]; 26 }))); 27 }; 28 services.dhcpd4 = { ··· 435 name = "Virtual"; 436 machine = { 437 networking.interfaces."tap0" = { 438 - ip4 = [ { address = "192.168.1.1"; prefixLength = 24; } ]; 439 - ip6 = [ { address = "2001:1470:fffd:2096::"; prefixLength = 64; } ]; 440 virtual = true; 441 }; 442 networking.interfaces."tun0" = { 443 - ip4 = [ { address = "192.168.1.2"; prefixLength = 24; } ]; 444 - ip6 = [ { address = "2001:1470:fffd:2097::"; prefixLength = 64; } ]; 445 virtual = true; 446 }; 447 }; ··· 481 boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = true; 482 networking = { 483 useNetworkd = networkd; 484 - interfaces.eth1 = { 485 - ipv6Address = "fd00:1234:5678:1::1"; 486 - ipv6PrefixLength = 64; 487 }; 488 }; 489 services.radvd = { ··· 509 useDHCP = true; 510 interfaces.eth1 = { 511 preferTempAddress = true; 512 - ip4 = mkOverride 0 [ ]; 513 - ip6 = mkOverride 0 [ ]; 514 }; 515 }; 516 };
··· 21 firewall.allowedUDPPorts = [ 547 ]; 22 interfaces = mkOverride 0 (listToAttrs (flip map vlanIfs (n: 23 nameValuePair "eth${toString n}" { 24 + ipv4.addresses = [ { address = "192.168.${toString n}.1"; prefixLength = 24; } ]; 25 + ipv6.addresses = [ { address = "fd00:1234:5678:${toString n}::1"; prefixLength = 64; } ]; 26 }))); 27 }; 28 services.dhcpd4 = { ··· 435 name = "Virtual"; 436 machine = { 437 networking.interfaces."tap0" = { 438 + ipv4.addresses = [ { address = "192.168.1.1"; prefixLength = 24; } ]; 439 + ipv6.addresses = [ { address = "2001:1470:fffd:2096::"; prefixLength = 64; } ]; 440 virtual = true; 441 }; 442 networking.interfaces."tun0" = { 443 + ipv4.addresses = [ { address = "192.168.1.2"; prefixLength = 24; } ]; 444 + ipv6.addresses = [ { address = "2001:1470:fffd:2097::"; prefixLength = 64; } ]; 445 virtual = true; 446 }; 447 }; ··· 481 boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = true; 482 networking = { 483 useNetworkd = networkd; 484 + interfaces.eth1.ipv6.addresses = singleton { 485 + address = "fd00:1234:5678:1::1"; 486 + prefixLength = 64; 487 }; 488 }; 489 services.radvd = { ··· 509 useDHCP = true; 510 interfaces.eth1 = { 511 preferTempAddress = true; 512 + ipv4.addresses = mkOverride 0 [ ]; 513 + ipv6.addresses = mkOverride 0 [ ]; 514 }; 515 }; 516 };
+14 -8
nixos/tests/nsd.nix
··· 15 clientv4 = { lib, nodes, ... }: { 16 imports = [ common ]; 17 networking.nameservers = lib.mkForce [ 18 - nodes.server.config.networking.interfaces.eth1.ipAddress 19 ]; 20 - networking.interfaces.eth1.ipAddress = "192.168.0.2"; 21 - networking.interfaces.eth1.prefixLength = 24; 22 }; 23 24 clientv6 = { lib, nodes, ... }: { 25 imports = [ common ]; 26 networking.nameservers = lib.mkForce [ 27 - nodes.server.config.networking.interfaces.eth1.ipv6Address 28 ]; 29 - networking.interfaces.eth1.ipv6Address = "dead:beef::2"; 30 }; 31 32 server = { lib, ... }: { 33 imports = [ common ]; 34 - networking.interfaces.eth1.ipAddress = "192.168.0.1"; 35 - networking.interfaces.eth1.prefixLength = 24; 36 - networking.interfaces.eth1.ipv6Address = "dead:beef::1"; 37 services.nsd.enable = true; 38 services.nsd.interfaces = lib.mkForce []; 39 services.nsd.zones."example.com.".data = ''
··· 15 clientv4 = { lib, nodes, ... }: { 16 imports = [ common ]; 17 networking.nameservers = lib.mkForce [ 18 + (lib.head nodes.server.config.networking.interfaces.eth1.ipv4.addresses).address 19 ]; 20 + networking.interfaces.eth1.ipv4.addresses = [ 21 + { address = "192.168.0.2"; prefixLength = 24; } 22 + ]; 23 }; 24 25 clientv6 = { lib, nodes, ... }: { 26 imports = [ common ]; 27 networking.nameservers = lib.mkForce [ 28 + (lib.head nodes.server.config.networking.interfaces.eth1.ipv6.addresses).address 29 ]; 30 + networking.interfaces.eth1.ipv4.addresses = [ 31 + { address = "dead:beef::2"; prefixLength = 24; } 32 + ]; 33 }; 34 35 server = { lib, ... }: { 36 imports = [ common ]; 37 + networking.interfaces.eth1.ipv4.addresses = [ 38 + { address = "192.168.0.1"; prefixLength = 24; } 39 + ]; 40 + networking.interfaces.eth1.ipv6.addresses = [ 41 + { address = "dead:beef::1"; prefixLength = 64; } 42 + ]; 43 services.nsd.enable = true; 44 services.nsd.interfaces = lib.mkForce []; 45 services.nsd.zones."example.com.".data = ''
+1 -1
nixos/tests/quagga.nix
··· 8 import ./make-test.nix ({ pkgs, ... }: 9 let 10 11 - ifAddr = node: iface: (pkgs.lib.head node.config.networking.interfaces.${iface}.ip4).address; 12 13 ospfConf = '' 14 interface eth2
··· 8 import ./make-test.nix ({ pkgs, ... }: 9 let 10 11 + ifAddr = node: iface: (pkgs.lib.head node.config.networking.interfaces.${iface}.ipv4.addresses).address; 12 13 ospfConf = '' 14 interface eth2