l gg23: configure NAT directly
This commit is contained in:
parent
48659d3b63
commit
415b6a349c
@ -25,14 +25,15 @@ with import <stockholm/lib>;
|
|||||||
# Managed = true;
|
# Managed = true;
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
|
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
|
||||||
systemd.network.networks."50-int0" = {
|
systemd.network.networks."50-int0" = {
|
||||||
name = "int0";
|
name = "int0";
|
||||||
address = [
|
address = [
|
||||||
"10.42.0.1/24"
|
"10.42.0.1/24"
|
||||||
];
|
];
|
||||||
networkConfig = {
|
networkConfig = {
|
||||||
IPForward = "yes";
|
# IPForward = "yes";
|
||||||
IPMasquerade = "both";
|
# IPMasquerade = "both";
|
||||||
ConfigureWithoutCarrier = true;
|
ConfigureWithoutCarrier = true;
|
||||||
DHCPServer = "yes";
|
DHCPServer = "yes";
|
||||||
# IPv6SendRA = "yes";
|
# IPv6SendRA = "yes";
|
||||||
@ -51,6 +52,9 @@ with import <stockholm/lib>;
|
|||||||
krebs.iptables.tables.nat.PREROUTING.rules = mkBefore [
|
krebs.iptables.tables.nat.PREROUTING.rules = mkBefore [
|
||||||
{ v6 = false; predicate = "-s 10.42.0.0/24"; target = "ACCEPT"; }
|
{ v6 = false; predicate = "-s 10.42.0.0/24"; target = "ACCEPT"; }
|
||||||
];
|
];
|
||||||
|
krebs.iptables.tables.nat.POSTROUTING.rules = [
|
||||||
|
{ v6 = false; predicate = "-s 10.42.0.0/24"; target = "MASQUERADE"; }
|
||||||
|
];
|
||||||
|
|
||||||
networking.domain = "gg23";
|
networking.domain = "gg23";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user