2019-11-27 22:22:16 +03:00
|
|
|
import ./make-test-python.nix ({ pkgs, lib, ...} : {
|
2019-02-02 18:05:12 +03:00
|
|
|
name = "ndppd";
|
2021-01-10 22:08:30 +03:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2019-02-02 18:05:12 +03:00
|
|
|
maintainers = [ fpletz ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nodes = {
|
|
|
|
upstream = { pkgs, ... }: {
|
|
|
|
environment.systemPackages = [ pkgs.tcpdump ];
|
|
|
|
networking.useDHCP = false;
|
|
|
|
networking.interfaces = {
|
|
|
|
eth1 = {
|
|
|
|
ipv6.addresses = [
|
|
|
|
{ address = "fd23::1"; prefixLength = 112; }
|
|
|
|
];
|
|
|
|
ipv6.routes = [
|
|
|
|
{ address = "fd42::";
|
|
|
|
prefixLength = 112;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
server = { pkgs, ... }: {
|
|
|
|
boot.kernel.sysctl = {
|
|
|
|
"net.ipv6.conf.all.forwarding" = "1";
|
|
|
|
"net.ipv6.conf.default.forwarding" = "1";
|
|
|
|
};
|
|
|
|
environment.systemPackages = [ pkgs.tcpdump ];
|
|
|
|
networking.useDHCP = false;
|
|
|
|
networking.interfaces = {
|
|
|
|
eth1 = {
|
|
|
|
ipv6.addresses = [
|
|
|
|
{ address = "fd23::2"; prefixLength = 112; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
services.ndppd = {
|
|
|
|
enable = true;
|
2019-08-14 00:52:01 +03:00
|
|
|
proxies.eth1.rules."fd42::/112" = {};
|
2019-02-02 18:05:12 +03:00
|
|
|
};
|
|
|
|
containers.client = {
|
|
|
|
autoStart = true;
|
|
|
|
privateNetwork = true;
|
|
|
|
hostAddress = "192.168.255.1";
|
|
|
|
localAddress = "192.168.255.2";
|
|
|
|
hostAddress6 = "fd42::1";
|
|
|
|
localAddress6 = "fd42::2";
|
|
|
|
config = {};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-11-27 22:22:16 +03:00
|
|
|
start_all()
|
|
|
|
server.wait_for_unit("multi-user.target")
|
|
|
|
upstream.wait_for_unit("multi-user.target")
|
|
|
|
upstream.wait_until_succeeds("ping -c5 fd42::2")
|
2019-02-02 18:05:12 +03:00
|
|
|
'';
|
|
|
|
})
|