niels Posted January 30, 2012 Share Posted January 30, 2012 Hey everybody, I'm having some issue on an older version of Iptables version 1.4.2 I'm using this command : iptables-restore < /etc/network/iptables.config And the content of the iptables.config file is : *filter -P INPUT ACCEPT -P FORWARD ACCEPT -P OUTPUT ACCEPT -A INPUT -i lo -j ACCEPT -A OUTPUT -o lo -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT --src x.x.x.x -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT --src x.x.x.x -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT --src x.x.x.x -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j DROP -A INPUT -j REJECT -A FORWARD -j REJECT COMMIT I've used this exactly the same config for another server and there I did't got any troubles. But now I got this output: iptables-restore v1.4.2: no command specified Error occurred at line: 16 Try `iptables-restore -h' or 'iptables-restore --help' for more information. I already truncated the file line endings, commenting out some rules but still didn't work. And it always throws the error/exception. Strange part is I use the exact same file for another server and it doesn't complain about any errors or exceptions and it works fine. Anybody had the same experience or anybody some advise ? Thanks a lot in advance! Quote Link to comment Share on other sites More sharing options...
Infiltrator Posted February 2, 2012 Share Posted February 2, 2012 What Linux distro are you using? Quote Link to comment Share on other sites More sharing options...
niels Posted February 3, 2012 Author Share Posted February 3, 2012 What Linux distro are you using? I'm using this version of debian: Linux version 2.6.26-2-xen-amd64 (Debian 2.6.26-24) (dannf@debian.org) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Sun Jun 20 20:51:58 UTC 2010 Quote Link to comment Share on other sites More sharing options...
xpn Posted February 7, 2012 Share Posted February 7, 2012 Is this the exact copy of the file you are using during your restore ? Just wondering what is on Line 16 that is causing problems ? Quote Link to comment Share on other sites More sharing options...
niels Posted February 8, 2012 Author Share Posted February 8, 2012 Is this the exact copy of the file you are using during your restore ? Just wondering what is on Line 16 that is causing problems ? Yes it is, I'm using a ruby script to deploy several firewalls on different servers and a git repo to keep up with the changes. But I also tried this one manually and I wasn't able to get it working. Anybody a clue, seems that older servers can't handle the syntax. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.