iptables-restore command failing on new Debian 6 server
When I run 'sudo iptables-restore < /etc/iptables.firewall.rules' I receive the following output (I get the same output if I enter the command as root without sudo):
FATAL: Module ip_tables not found.
'ptables-restore v1.4.8: iptables-restore: unable to initialize table 'filter
Error occurred at line: 1
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
I've googled this content quite a bit, as well as searching these forums for what appear to be the distinguishing snippets of the error message, but unfortunately I'm not finding anything that speaks directly to my situation (as far as I can tell).
The iptables package is up to date, according to apt-get.
In spite of the error message, the first line in /etc/iptables.firewall.rules is definitely '*filter' (NOT " 'filter ").
The output of 'sudo iptables -L' is normal (according to the guide):
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Any thoughts on the matter would be most welcome. Thanks!
5 Replies
FATAL: Module ip_tables not found.
This is probably going to painfully illustrate my ignorance, but I understand iptables-restore to be part and parcel of the iptables package, which is clearly installed and enabled on my system. How is it that I've got iptables running, but there's a critical portion of the package missing from a clean install? Surely I'm not the first person to run into this - I'm following the beginnner's guides step by step.
Your options include getting this fixed as a bug, using the stock Debian kernel
/Martin
This problem often happens if iptables.firewall.rules was created on another system. For example, I created the file in Windows and then SFTP'ed it to my Linux server. This will not work.
The solution is to create the file from scratch using your Linux machine:
sudo nano /etc/iptables.firewall.rules
If you are using Putty, you can still copy-and-paste text from a Windows web browser into Putty's nano session and it will work.