aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-08-07 11:29:15 +0100
committerdiogo464 <[email protected]>2025-08-07 11:29:15 +0100
commit481ebae4f0fc9bed6afdfdf9f08e3b2b04f276c6 (patch)
treed1d98f4fe8e34906f43f01e531600d586b081c41
parentd9f0415c1dceb418eac81ff16d6eaa78fe1f4743 (diff)
disabled conntrack on 10.0.0.0/8 packets
we were hitting conntrack limits when opening lots of connections and sending UDP packets to many different hosts. this resulted in TCP packets getting dropped which would manifest itself as errors when connecting or timeouts and when sending UDP packets using `sendto` it would fail with permission denied error. disabling conntrack fixes all of these problems.
-rw-r--r--src/main.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 839ddf8..310477c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1038,6 +1038,21 @@ fn machine_generate_configs(
1038 } 1038 }
1039 1039
1040 machine_nft_script.push_str("table ip oar-p2p {\n"); 1040 machine_nft_script.push_str("table ip oar-p2p {\n");
1041 machine_nft_script.push_str(
1042 r#"
1043 chain prerouting {
1044 type filter hook prerouting priority raw;
1045 ip saddr 10.0.0.0/8 notrack
1046 ip daddr 10.0.0.0/8 notrack
1047 }
1048 chain output {
1049 type filter hook output priority raw;
1050 ip saddr 10.0.0.0/8 notrack
1051 ip daddr 10.0.0.0/8 notrack
1052 }
1053"#,
1054 );
1055
1041 machine_nft_script.push_str("\tmap mark_pairs {\n"); 1056 machine_nft_script.push_str("\tmap mark_pairs {\n");
1042 machine_nft_script.push_str("\t\ttype ipv4_addr . ipv4_addr : mark\n"); 1057 machine_nft_script.push_str("\t\ttype ipv4_addr . ipv4_addr : mark\n");
1043 machine_nft_script.push_str("\t\telements = {\n"); 1058 machine_nft_script.push_str("\t\telements = {\n");