1 # This is a simple distributed test involving a topology with two
2 # separate virtual networks - the "inside" and the "outside" - with a
3 # client on the inside network, a server on the outside network, and a
4 # router connected to both that performs Network Address Translation
6 import ./make-test-python.nix ({ pkgs, lib, ... }:
10 { virtualisation.vlans = [ 2 1 ];
11 networking.nftables.enable = true;
12 networking.nat.internalIPs = [ "192.168.1.0/24" ];
13 networking.nat.externalInterface = "eth1";
18 name = "dublin-traceroute";
19 meta = with pkgs.lib.maintainers; {
20 maintainers = [ baloo ];
23 nodes.client = { nodes, ... }: {
24 imports = [ ./common/user-account.nix ];
25 virtualisation.vlans = [ 1 ];
27 networking.defaultGateway =
28 (builtins.head nodes.router.networking.interfaces.eth2.ipv4.addresses).address;
29 networking.nftables.enable = true;
31 programs.dublin-traceroute.enable = true;
34 nodes.router = { ... }: {
35 virtualisation.vlans = [ 2 1 ];
36 networking.nftables.enable = true;
37 networking.nat.internalIPs = [ "192.168.1.0/24" ];
38 networking.nat.externalInterface = "eth1";
39 networking.nat.enable = true;
42 nodes.server = { ... }: {
43 virtualisation.vlans = [ 2 ];
44 networking.firewall.enable = false;
45 services.httpd.enable = true;
46 services.httpd.adminAddr = "foo@example.org";
47 services.vsftpd.enable = true;
48 services.vsftpd.anonymousUser = true;
56 server.wait_for_unit("network.target")
57 router.wait_for_unit("network.target")
58 client.wait_for_unit("network.target")
60 # Make sure we can trace from an unprivileged user
61 client.succeed("sudo -u alice dublin-traceroute server")