Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
IPtables first script
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
Pryka
l33t
l33t


Joined: 08 Jun 2007
Posts: 658
Location: /dev/null

PostPosted: Thu May 06, 2010 3:01 pm    Post subject: IPtables first script Reply with quote

Hi this is my first iptables script... can somebody check it?

Code:
iptables -F
iptables -X
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -i eth0 -s 0/0 -p tcp --dport 8192:65535 -j ACCEPT
iptables -A INPUT -i eth0 -s 0/0 -p udp --dport 8192:65535 -j ACCEPT
iptables -A INPUT -i lo -s 127.0.0.1 -p tcp -j ACCEPT
iptables -A INPUT -i lo -s 127.0.0.1 -p udp -j ACCEPT
iptables -A INPUT -i eth0 -s 0/0 -p tcp -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 -s 0/0 -p udp -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 -s 0/0 -p tcp -m state --state INVALID -j DROP
iptables -A INPUT -i eth0 -s 0/0 -p udp -m state --state INVALID -j DROP


I just need torrent's and web-browser
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Thu May 06, 2010 3:56 pm    Post subject: Reply with quote

You should check mine : http://gentoo-quebec.org/wiki/index.php/Utilisation_de_Iptables_pour_un_seul_ordinateur

The idea is to block what's want to enter your box and the output is not blocked.

With my config, you will be able to browse and use bittorrent but you will protect your box from incoming trafic that doesn't make sense.
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