Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Some iptables problems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Eden
n00b
n00b


Joined: 18 Aug 2006
Posts: 21

PostPosted: Tue Jan 16, 2007 4:06 pm    Post subject: Some iptables problems Reply with quote

I'm trying to set up a basic iptable setup from the wiki guide http://gentoo-wiki.com/HOWTO_Iptables_for_newbies I save the iptables and edit it with the following (the same rules as in the guid but with a couple extra).

Code:
# Generated by iptables-save v1.3.5 on Tue Jan 16 15:34:30 2007
*filter
:INPUT ACCEPT [926:70821]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [741:169405]

# accept all from localhost
-A INPUT -s 127.0.0.1 -j ACCEPT

# accept all previously established connections
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

# ssh
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT

# ftp / webserver related
-A INPUT -p tcp -m state --state NEW -m tcp --dport 20 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT

# Windows / Samba
-A INPUT -p tcp -m state --state NEW -m tcp --dport 137:139 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 426 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 445 -j ACCEPT

# up to 5 Bit-torrent connections
-A INPUT -p tcp -m state --state NEW -m tcp --dport 6881:6886 -j ACCEPT

#Teamspeak
-A INPUT -p tcp -m state --state NEW -m tcp --dport 14534
-A INPUT -p tcp -m state --state NEW -m tcp --dport 51234
-A INPUT -p udp -m state --state NEW -m udp --dport 8767

# reject everything else
-A INPUT -j REJECT --reject-with icmp-port-unreachable

COMMIT
# Completed on Tue Jan 16 15:34:30 2007


However when I go to restore it I get the following error.
Code:

# iptables-restore /etc/iptables.bak
iptables-restore v1.3.5: no command specified
Error occurred at line: 38
Try `iptables-restore -h' or 'iptables-restore --help' for more information.


Line 38 is the 'COMMIT' line.

anyone have any suggestions?
Back to top
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Tue Jan 16, 2007 6:11 pm    Post subject: Reply with quote

Generally caused by insufficient kernel support. If you've gone the modular route you either lack some option(s) or have failed to load the module.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum