1{ pkgs, lib, ... }:
2{
3 name = "ndppd";
4 meta = with pkgs.lib.maintainers; {
5 maintainers = [ fpletz ];
6 };
7
8 nodes = {
9 upstream =
10 { pkgs, ... }:
11 {
12 environment.systemPackages = [ pkgs.tcpdump ];
13 networking.useDHCP = false;
14 networking.interfaces = {
15 eth1 = {
16 ipv6.addresses = [
17 {
18 address = "fd23::1";
19 prefixLength = 112;
20 }
21 ];
22 ipv6.routes = [
23 {
24 address = "fd42::";
25 prefixLength = 112;
26 }
27 ];
28 };
29 };
30 };
31 server =
32 { pkgs, ... }:
33 {
34 boot.kernel.sysctl = {
35 "net.ipv6.conf.all.forwarding" = "1";
36 "net.ipv6.conf.default.forwarding" = "1";
37 };
38 environment.systemPackages = [ pkgs.tcpdump ];
39 networking.useDHCP = false;
40 networking.interfaces = {
41 eth1 = {
42 ipv6.addresses = [
43 {
44 address = "fd23::2";
45 prefixLength = 112;
46 }
47 ];
48 };
49 };
50 services.ndppd = {
51 enable = true;
52 proxies.eth1.rules."fd42::/112" = { };
53 };
54 containers.client = {
55 autoStart = true;
56 privateNetwork = true;
57 hostAddress = "192.168.255.1";
58 localAddress = "192.168.255.2";
59 hostAddress6 = "fd42::1";
60 localAddress6 = "fd42::2";
61 config = { };
62 };
63 };
64 };
65
66 testScript = ''
67 start_all()
68 server.wait_for_unit("multi-user.target")
69 upstream.wait_for_unit("multi-user.target")
70 upstream.wait_until_succeeds("ping -c5 fd42::2")
71 '';
72}