r/debian icon

Go to debian

How do i enable iptables under debian 11?

Thumbnail image: Apple Card is a no-fee credit card that gives you up to 3% unlimited Daily Cash back on all of your purchases. Apply now and use right away. Terms apply.

I am running Debian 11 and I see it at /usr/sbin/iptables. The 'which' command finds it if I am logged in as root. I usually do not run it by hand though - I let ufw take care of it.

Same location for me. But yeah, unfortunately not working.

More replies More replies

Don't use iptables - it's deprecated, and not suitable for new projects.

Its replacement is nftables and has been the default in Debian since Debian 10.

The debian server is running an old gameserver and it needs those very specific iptables rules in order to be protected from various exploits and DoS attacks. I don't have the time, nor the willpower to learn about nftables and make them work there.

More replies More replies

Have you installed the package? Use apt install iptables.

Keep in mind that even if you install the package it is going to be using the nft-based translations by default. If you really truly need iptables, you also need to switch the alternatives.

This forces the 'legacy' version of iptables.

update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

apt install ipset should also cause it to switch to iptables