File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,11 +34,18 @@ echo "COMMIT" >> "$RULES_FILE"
3434
3535iptables-restore < " $RULES_FILE "
3636
37- ip6tables -P OUTPUT DROP 2> /dev/null || true
38- ip6tables -F OUTPUT 2> /dev/null || true
39- ip6tables -A OUTPUT -o lo -j ACCEPT 2> /dev/null || true
40- # Allow established connections (needed for SSH responses over Fly's fdaa:: network)
41- ip6tables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT 2> /dev/null || true
37+ # IPv6 rules: use ip6tables-restore for atomic application (no window where
38+ # policy is DROP but rules are flushed, which would kill active SSH sessions)
39+ ip6tables-restore 2> /dev/null << ' IP6RULES' || true
40+ * filter
41+ :INPUT ACCEPT [0:0]
42+ :FORWARD ACCEPT [0:0]
43+ :OUTPUT DROP [0:0]
44+ -A OUTPUT -o lo -j ACCEPT
45+ -A OUTPUT -d fdaa::/16 -j ACCEPT
46+ -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
47+ COMMIT
48+ IP6RULES
4249
4350rm -f " $RULES_FILE "
4451echo " [NETWORK] iptables refreshed at $( date) " > & 2
You can’t perform that action at this time.
0 commit comments