2018-05-16 15:32:00 +00:00
|
|
|
{ lib, ... }:
|
2017-07-23 19:43:12 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
krebs.iptables.tables.filter.FORWARD.rules = [
|
|
|
|
{ v6 = false; predicate = "-d 10.233.2.0/24 -o ve-+ -m conntrack --ctstate RELATED,ESTABLISHED"; target = "ACCEPT"; }
|
|
|
|
{ v6 = false; predicate = "-s 10.233.2.0/24 -i ve-+"; target = "ACCEPT"; }
|
|
|
|
{ v6 = false; predicate = "-i ve-+ -o ve-+"; target = "ACCEPT"; }
|
|
|
|
{ v6 = false; predicate = "-o ve-+"; target = "REJECT --reject-with icmp-port-unreachable"; }
|
|
|
|
{ v6 = false; predicate = "-i ve-+"; target = "REJECT --reject-with icmp-port-unreachable"; }
|
|
|
|
];
|
2018-05-16 18:19:57 +00:00
|
|
|
krebs.iptables.tables.nat.PREROUTING.rules = [
|
|
|
|
{ v6 = false; predicate = "-s 10.233.2.0/24"; target = "ACCEPT"; precedence = 1000; }
|
|
|
|
];
|
2017-07-23 19:43:12 +00:00
|
|
|
krebs.iptables.tables.nat.POSTROUTING.rules = [
|
|
|
|
{ v6 = false; predicate = "-s 10.233.2.0/24 -d 224.0.0.0/24"; target = "RETURN"; }
|
|
|
|
{ v6 = false; predicate = "-s 10.233.2.0/24 -d 255.255.255.255"; target = "RETURN"; }
|
|
|
|
{ v6 = false; predicate = "-s 10.233.2.0/24 ! -d 10.233.2.0/24"; target = "MASQUERADE"; }
|
|
|
|
{ v6 = false; predicate = "-s 10.233.2.0/24 ! -d 10.233.2.0/24 -p tcp"; target = "MASQUERADE --to-ports 1024-65535"; }
|
|
|
|
{ v6 = false; predicate = "-s 10.233.2.0/24 ! -d 10.233.2.0/24 -p udp"; target = "MASQUERADE --to-ports 1024-65535"; }
|
|
|
|
];
|
2018-05-16 15:32:00 +00:00
|
|
|
boot.kernel.sysctl."net.ipv4.ip_forward" = lib.mkDefault 1;
|
2017-07-23 19:43:12 +00:00
|
|
|
}
|