1 { pkgs, lib, config, ... }:
3 inherit (builtins) hasAttr readFile;
4 inherit (pkgs.lib) unlinesAttrs;
5 inherit (config) users;
6 inherit (config.services) shorewall shorewall6;
12 DNS(ACCEPT) $FW net {user=${users.users.unbound.name}}
14 HKP(ACCEPT) $FW net {user=julm}
52 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
53 # PORT(S) PORT(S) LIMIT GROUP
58 #ACTION SOURCE DEST PROTO DEST SOURCE RATE USER/
59 # PORT(S) PORT(S) LIMIT GROUP
60 PARAM - - udp 60000-61000
65 services.shorewall = {
69 ${readFile "${shorewall.package}/etc-example/shorewall/shorewall.conf"}
77 # DOC: shorewall-zones(5)
84 # DOC: shorewall-interfaces(5)
86 net enp1s0 arp_filter,nosmurfs,routefilter=1,tcpflags
87 lan enp2s0 arp_filter,nosmurfs,routefilter=1,tcpflags
88 unused enp3s0 arp_filter,nosmurfs,routefilter=1,tcpflags
91 # DOC: shorewall-policy(5)
96 # WARNING: the following policy must be last
100 # DOC: shorewall-rules(5)
114 services.shorewall6 = {
116 configs = macros // {
117 "shorewall6.conf" = ''
118 ${readFile "${shorewall6.package}/etc-example/shorewall6/shorewall6.conf"}
126 # DOC: shorewall-zones(5)
133 # DOC: shorewall-interfaces(5)
135 net enp1s0 nosmurfs,tcpflags
136 lan enp2s0 nosmurfs,tcpflags
137 unused enp3s0 nosmurfs,tcpflags
140 # DOC: shorewall-policy(5)
145 # WARNING: the following policy must be last
149 # DOC: shorewall-rules(5)