summaryrefslogtreecommitdiff
path: root/hosts/poweredge/networking.nix
blob: c29383186f171a810771dbef646d0dfe7bc7a19d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
	networking = {
		# Label lan and wan interfaces
		_interfaceLabels = {
			enable = true;
			interfaces = {
				lan0 = "50:9a:4c:5d:c3:7a";
				wan0 = "50:9a:4c:5d:c3:7b";
			};
		};
		# Set ip addresses
		interfaces = {
			lan0.ipv4.addresses = [{
				address = "192.168.1.1";
				prefixLength = 24;
			}];
			wan0.useDHCP = true;
		};
		#defaultGateway.interface = "wan0";
		nameservers = [ "127.0.0.1" ];
		# Firewall rules
		firewall = {
			interfaces.wan0 = {
				allowedUDPPorts = [ 51820 ];
			};
		};
		#nat.forwardPorts = [
		#	{
		#		sourcePort = 2222;
		#		proto = "tcp";
		#		destination = "10.1.1.1:22";
		#	}
		#	{
		#		sourcePort = 22;
		#		proto = "tcp";
		#		destination = "10.1.1.1:22";
		#	}
		#];
	};

	services._router = {
		dnsDhcpConfig = {
			localDomain = "wg-router.pls.lan";
			dhcp = {
				defaultGateway = "192.168.1.1";
				localhostIp = "192.168.1.1";
				rangeStart = "192.168.1.50";
				rangeEnd = "192.168.1.250";
				staticLeases = {
					idrac-7N94GK2 = {
						macAddress = "50:9a:4c:5d:c3:7c";
						staticIp = "192.168.1.3";
					};
					OpenWrt-Attic = {
						macAddress = "34:98:b5:60:5e:be";
						staticIp = "192.168.1.4";
					};
					OpenWrt-Basement = {
						macAddress = "8c:3b:ad:35:c7:8c";
						staticIp = "192.168.1.5";
					};
					ArcherC54 = {
						macAddress = "12:eb:b6:13:f9:e2";
						staticIp = "192.168.1.6";
					};
					T495 = {
						macAddress = "04:33:c2:9d:34:74";
						staticIp = "192.168.1.11";
					};
					optiplex = {
						macAddress = "e4:54:e8:bc:ba:05";
						staticIp = "192.168.1.12";
					};
				};
			};
		};
	};
}