fix: use iptables-nft if nftables is loaded

This commit is contained in:
Peter Galonza 2025-03-28 18:29:06 +03:00
parent 2a6e6a1e24
commit fa32608c61
No known key found for this signature in database
GPG key ID: C85D94460DBECFA2
7 changed files with 35 additions and 0 deletions

View file

@ -1,3 +1,8 @@
# check if nf_tables is loaded
if lsmod | grep -qw nf_tables; then
sudo update-alternatives --set iptables /usr/sbin/iptables-nft
fi
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -C INPUT -p icmp --icmp-type echo-request -j DROP || sudo iptables -A INPUT -p icmp --icmp-type echo-request -j DROP