File tree Expand file tree Collapse file tree 5 files changed +32
-94
lines changed Expand file tree Collapse file tree 5 files changed +32
-94
lines changed Original file line number Diff line number Diff line change 13
13
networkConfig = {
14
14
DHCPPrefixDelegation = true ;
15
15
IPv6AcceptRA = false ;
16
+ IPv6SendRA = true ;
16
17
IgnoreCarrierLoss = true ;
17
18
MulticastDNS = true ;
18
- Address = [
19
- cfg . routerIpv6Ula . cidr
20
- ] ++ lib . optional ( cfg . ipv6GuaPrefix != null ) cfg . routerIpv6Gua . cidr ;
21
19
} ;
20
+ ipv6SendRAConfig = {
21
+ EmitDNS = true ;
22
+ DNS = "_link_local" ;
23
+ } ;
24
+ ipv6Prefixes =
25
+ [
26
+ {
27
+ Prefix = cfg . ipv6UlaPrefix ;
28
+ Assign = true ;
29
+ }
30
+ ]
31
+ ++ lib . optionals ( cfg . ipv6GuaPrefix != null ) [
32
+ {
33
+ Prefix = cfg . ipv6GuaPrefix ;
34
+ Assign = true ;
35
+ }
36
+ ] ;
37
+ # TODO(jared): make nixos option
38
+ extraConfig = ''
39
+ [IPv6PREF64Prefix]
40
+ Prefix=${ config . networking . jool . nat64 . default . global . pool6 }
41
+ '' ;
22
42
} ;
23
43
} ;
24
44
}
Original file line number Diff line number Diff line change 6
6
./hostapd.nix
7
7
./lan.nix
8
8
./options.nix
9
- ./ra.nix
10
9
./wan.nix
11
10
] ;
12
11
Original file line number Diff line number Diff line change 7
7
hasStaticGua = cfg . ipv6GuaPrefix != null ;
8
8
guaNetwork = _lib . parseIpv6Network cfg . ipv6GuaPrefix ;
9
9
ulaNetwork = _lib . parseIpv6Network cfg . ipv6UlaPrefix ;
10
-
11
- mkIpv6GuaAddress = _lib . mkIpv6Address guaNetwork . hextets ;
12
- mkIpv6UlaAddress = _lib . mkIpv6Address ulaNetwork . hextets ;
13
10
in
14
11
{
15
12
options . router = with lib ; {
88
85
The 64-bit IPv6 GUA network prefix (in CIDR notation).
89
86
'' ;
90
87
} ;
91
- routerIpv6Gua = mkOption {
92
- internal = true ;
93
- readOnly = true ;
94
- default =
95
- let
96
- address = mkIpv6GuaAddress [
97
- 0
98
- 0
99
- 0
100
- 0
101
- 0
102
- 0
103
- 0
104
- 1
105
- ] ;
106
- in
107
- if hasStaticGua then
108
- {
109
- inherit address ;
110
- cidr = "${ address } /${ toString guaNetwork . prefixLength } " ;
111
- }
112
- else
113
- null ;
114
- } ;
115
88
ipv6UlaPrefix = mkOption {
116
89
type = types . str ;
117
90
example = "fd38:5f81:b15d::/64" ;
120
93
a ULA prefix at https://www.ip-six.de/index.php.
121
94
'' ;
122
95
} ;
123
- routerIpv6Ula = mkOption {
124
- internal = true ;
125
- readOnly = true ;
126
- default =
127
- let
128
- address = mkIpv6UlaAddress [
129
- 0
130
- 0
131
- 0
132
- 0
133
- 0
134
- 0
135
- 0
136
- 1
137
- ] ;
138
- in
139
- {
140
- inherit address ;
141
- cidr = "${ address } /${ toString ulaNetwork . prefixLength } " ;
142
- } ;
143
- } ;
144
96
dns = {
145
97
upstreamProvider = mkOption {
146
98
type = types . enum [
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -37,10 +37,15 @@ nixosTest {
37
37
} ;
38
38
39
39
testScript = ''
40
- router.wait_for_unit("systemd-networkd.service ")
41
- host1.wait_for_unit("multi-user .target")
40
+ router.wait_for_unit("network-online.target ")
41
+ host1.wait_for_unit("network-online .target")
42
42
43
- router.wait_until_succeeds("ping -c5 host1.local.")
44
- host1.wait_until_succeeds("ping -c5 router.local.")
43
+ print(router.succeed("networkctl status eth1"))
44
+ print(router.succeed("resolvectl"))
45
+ print(host1.succeed("networkctl status eth1"))
46
+ print(host1.succeed("resolvectl"))
47
+
48
+ router.wait_until_succeeds("ping -c3 host1.local.")
49
+ host1.wait_until_succeeds("ping -c3 router.local.")
45
50
'' ;
46
51
}
You can’t perform that action at this time.
0 commit comments