devices.vps4/6: move forward to vps6

This commit is contained in:
2025-06-05 10:43:20 +08:00
parent 9774ea9a2d
commit 8e9185ec6b
2 changed files with 19 additions and 19 deletions

View File

@@ -31,24 +31,5 @@ inputs:
xray.server.serverName = "xserver.vps4.chn.moe";
};
};
networking.nftables.tables.forward =
{
family = "inet";
content = let srv2 = inputs.topInputs.self.config.dns."chn.moe".getAddress "wg1.srv2-node0"; in
''
chain prerouting {
type nat hook prerouting priority dstnat; policy accept;
tcp dport 7011 fib daddr type local counter meta mark set meta mark | 4 dnat ip to ${srv2}:22
}
chain output {
type nat hook output priority dstnat; policy accept;
tcp dport 7011 fib daddr type local counter meta mark set meta mark | 4 dnat ip to ${srv2}:22
}
chain postrouting {
type nat hook postrouting priority srcnat; policy accept;
oifname wg1 meta mark & 4 == 4 counter masquerade
}
'';
};
};
}

View File

@@ -62,5 +62,24 @@ inputs:
beesd."/" = {};
};
};
networking.nftables.tables.forward =
{
family = "inet";
content = let srv2 = inputs.topInputs.self.config.dns."chn.moe".getAddress "wg1.srv2-node0"; in
''
chain prerouting {
type nat hook prerouting priority dstnat; policy accept;
tcp dport 7011 fib daddr type local counter meta mark set meta mark | 4 dnat ip to ${srv2}:22
}
chain output {
type nat hook output priority dstnat; policy accept;
tcp dport 7011 fib daddr type local counter meta mark set meta mark | 4 dnat ip to ${srv2}:22
}
chain postrouting {
type nat hook postrouting priority srcnat; policy accept;
oifname wg1 meta mark & 4 == 4 counter masquerade
}
'';
};
};
}