iptables flush script...

iptables flush script...

Post by Christopher Thorjusse » Sat, 19 Jan 2002 22:21:45



Quote:> $IPTABLES -t nat -P PREROUTING ACCEPT
> $IPTABLES -t nat -P POSTROUTING ACCEPT
> $IPTABLES -t nat -P OUTPUT ACCEPT

> $IPTABLES -t nat -P PREROUTING ACCEPT
> $IPTABLES -t nat -P OUTPUT ACCEPT

should of course be:

$IPTABLES -t nat -P PREROUTING ACCEPT
$IPTABLES -t nat -P POSTROUTING ACCEPT
$IPTABLES -t nat -P OUTPUT ACCEPT

$IPTABLES -t mangle -P PREROUTING ACCEPT
$IPTABLES -t mangle -P OUTPUT ACCEPT

 
 
 

iptables flush script...

Post by Christopher Thorjusse » Sat, 19 Jan 2002 22:17:29


I'm working on my own firewall script and also a flush/reset script. At this
point, I just want a few comments on my flush script. Is it addequit for
deleting all chains, resetting policies, flushing, etc? Short - Will this
script remove everything in iptables?

one quick question: is

$IPTABLES -F
and
$IPTABLES -t filter -F
the same?

/Christopher

script below:
----------------------------

IPTABLES="/usr/local/sbin/iptables"

$IPTABLES -F
$IPTABLES -t nat -F
$IPTABLES -t mangle -F

$IPTABLES -X
$IPTABLES -t nat -X
$IPTABLES -t mangle -X

$IPTABLES -P INPUT ACCEPT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -P OUTPUT ACCEPT

$IPTABLES -t nat -P PREROUTING ACCEPT
$IPTABLES -t nat -P POSTROUTING ACCEPT
$IPTABLES -t nat -P OUTPUT ACCEPT

$IPTABLES -t nat -P PREROUTING ACCEPT
$IPTABLES -t nat -P OUTPUT ACCEPT

rmmod ip_queue
rmmod ip_nat_snmp_basic
rmmod ip_nat_irc
rmmod ip_nat_ftp
rmmod ip_conntrack_irc
rmmod ip_conntrack_ftp
rmmod ipt_REJECT
rmmod ipt_mac
rmmod ipt_unclean
rmmod ipt_REDIRECT
rmmod ipt_ttl
rmmod ipt_owner
rmmod ipt_tos
rmmod ipt_multiport
rmmod ipt_length
rmmod ipt_TOS
rmmod ipt_MIRROR
rmmod ipt_tcpmss
rmmod ipt_TCPMSS
rmmod ipt_MARK
rmmod ipt_mark
rmmod iptable_mangle
rmmod ipt_limit
rmmod ipt_state
rmmod iptable_filter
rmmod ipt_MASQUERADE
rmmod iptable_nat
rmmod ip_conntrack
rmmod ipt_LOG
rmmod ip_tables

-------

after executing this script, a print of the tables (filter, nat and mangle
(are there more?) give me:

Displaying iptables|filter:
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
Displaying iptables|nat:
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Displaying iptables|mangle:
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

 
 
 

1. Where can i find my Iptables script for the current Iptables configuration?

Hello,

I am a Linux newbie working on a cluster project and i need to know if
there is any Linux file where the script for my current Iptables
configuration is stored. I need this because I will be setting my
iptables/firewall to a new configuration and sometime later will have
to revert to the one prior to the newer setting. Please help me with
this. Any pointer to this will be a help.

Thanks in advance!

2. Shell script: for checking services!

3. flushing iptables using C socket program ...

4. Need help with Proxy ARP!

5. flushing iptables - real basic question

6. ARGGGHH.. My username is root no matter who I login as!!!

7. Flush IPTABLES settings or reset to default.

8. kernel programming tutorials

9. IPTABLES Flushing PREOUTING

10. How do I flush buffers from a script?

11. CGI script output flushing?

12. Iptables not running firewall script properly at boot

13. iptables script (any problems?)