Skip to main content How do i enable iptables under debian 11? : r/debian
r/debian icon
Go to debian
[deleted]

How do i enable iptables under debian 11?

Hello, failing miserably at enabling iptables. It is installed and i tried this https://wiki.debian.org/iptables but it didn't do anything. Yes, im logged in as root. When i enter an iptables command it says command not found. Thanks in advance

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.
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.
Sort by:
Best
Open comment sort options
[deleted]

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.

[deleted]

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.

[deleted]

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