summaryrefslogtreecommitdiff
path: root/hosts/vidhar/network/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/vidhar/network/default.nix')
-rw-r--r--hosts/vidhar/network/default.nix94
1 files changed, 18 insertions, 76 deletions
diff --git a/hosts/vidhar/network/default.nix b/hosts/vidhar/network/default.nix
index 29d4ba92..a1d1b172 100644
--- a/hosts/vidhar/network/default.nix
+++ b/hosts/vidhar/network/default.nix
@@ -21,7 +21,7 @@
21 { address = "10.141.1.1"; prefixLength = 24; } 21 { address = "10.141.1.1"; prefixLength = 24; }
22 ]; 22 ];
23 }; 23 };
24 interfaces."wifibh" = { 24 interfaces."dmz01" = {
25 ipv4.addresses = [ 25 ipv4.addresses = [
26 { address = "10.141.2.1"; prefixLength = 24; } 26 { address = "10.141.2.1"; prefixLength = 24; }
27 ]; 27 ];
@@ -32,11 +32,11 @@
32 id = 2; 32 id = 2;
33 interface = "eno2"; 33 interface = "eno2";
34 }; 34 };
35 "eno2.lan" = { 35 lan = {
36 id = 3; 36 id = 3;
37 interface = "eno2"; 37 interface = "eno2";
38 }; 38 };
39 wifibh = { 39 dmz01 = {
40 id = 4; 40 id = 4;
41 interface = "eno2"; 41 interface = "eno2";
42 }; 42 };
@@ -70,6 +70,13 @@
70 option domain-name-servers 10.141.1.1; 70 option domain-name-servers 10.141.1.1;
71 option broadcast-address 10.141.1.255; 71 option broadcast-address 10.141.1.255;
72 } 72 }
73
74 subnet 10.141.2.0 netmask 255.255.255.0 {
75 range 10.141.2.128 10.141.2.254;
76 option domain-name-servers 10.141.2.1;
77 option broadcast-address 10.141.2.255;
78 option routers 10.141.2.1;
79 }
73 ''; 80 '';
74 machines = [ 81 machines = [
75 { 82 {
@@ -89,81 +96,16 @@
89 } 96 }
90 ]; 97 ];
91 }; 98 };
92 systemd.network = { 99 systemd.network.networks = {
93 netdevs = { 100 "eno1" = {
94 "wifibh01" = { 101 matchConfig.Name = "eno1";
95 netdevConfig = { 102 linkConfig = {
96 Name = "wifibh01"; 103 ActivationPolicy = "down";
97 Kind = "gretap";
98 };
99 tunnelConfig = {
100 Local = "10.141.2.1";
101 Remote = "10.141.2.2";
102 };
103 };
104 "wifibh01.lan" = {
105 netdevConfig = {
106 Name = "wifibh01.lan";
107 Kind = "vlan";
108 };
109 vlanConfig = {
110 Id = 2;
111 };
112 };
113 lan = {
114 netdevConfig = {
115 Name = "lan";
116 Kind = "bridge";
117 };
118 }; 104 };
119 }; 105 };
120 106 "eno2" = {
121 networks = { 107 matchConfig.Name = "eno2";
122 "eno1" = { 108 networkConfig.LinkLocalAddressing = "no";
123 matchConfig.Name = "eno1";
124 linkConfig = {
125 ActivationPolicy = "down";
126 };
127 };
128 "eno2" = {
129 matchConfig.Name = "eno2";
130 networkConfig.LinkLocalAddressing = "no";
131 };
132 "40-wifibh" = {
133 matchConfig.Name = "wifibh";
134 networkConfig = {
135 Tunnel = ["wifibh01"];
136 };
137 };
138 "wifibh01" = {
139 matchConfig.Name = "wifibh01";
140 linkConfig = {
141 MACAddress = "02:01:00:00:00:00";
142 RequiredForOnline = false;
143 };
144 networkConfig = {
145 LinkLocalAddressing = "no";
146 VLAN = ["wifibh01.lan"];
147 };
148 };
149 "wifibh01.lan" = {
150 matchConfig.Name = "wifibh01.lan";
151 networkConfig.Bridge = "lan";
152 extraConfig = ''
153 [Bridge]
154 HairPin = true
155 Cost = 10
156 '';
157 };
158 "40-eno2.lan" = {
159 matchConfig.Name = "eno2.lan";
160 networkConfig.Bridge = "lan";
161 extraConfig = ''
162 [Bridge]
163 HairPin = false
164 Cost = 1
165 '';
166 };
167 }; 109 };
168 }; 110 };
169 }; 111 };