LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (http://www.linuxquestions.org/questions/linux-security-4/)
-   -   IPTable rules (http://www.linuxquestions.org/questions/linux-security-4/iptable-rules-327335/)

RecoilUK 05-26-2005 12:20 PM

IPTable rules
 
Hi guys

Have a question about IPTABLES I hope someone can help me with.

Here is my current firewall script...

Code:

#!/bin/sh

IPT=/sbin/iptables

# Close all ports by default.
$IPT -P INPUT DROP
$IPT -P OUTPUT DROP
$IPT -P FORWARD DROP

# Flush all rules.
$IPT -F

# Allow SSH traffic.
$IPT -A INPUT  -p tcp --dport 22 -j ACCEPT
$IPT -A OUTPUT -p tcp --sport 22 -j ACCEPT

#Allow DNS Traffic
$IPT -A INPUT -p udp --sport 53 -j ACCEPT
$IPT -A OUTPUT -p udp --dport 53 -j ACCEPT

Now when I rerun the script, none of my connections that are allready established get disconnected.

How can I first, make all connections close, and secondly prevent connections from being closed? as I have a static IP and want to prevent disconnection from that.

Thankyou.

JrLz 05-27-2005 08:25 PM

you need to restart the service (run a script named iptables)
$./iptables restart
this script is usually located /etc/rc.d or in my system, it's /etc/init.d
hope it helps


All times are GMT -5. The time now is 11:34 AM.