Flush (reset) iptables rules

Tags: April 28, 2012 10:30 AM

Sebaiknya dibuat script untuk melakukan flushing iptables agar dapat dieksekusi dilain waktu.

# vim /root/scripts/iptables-flush.sh
[-- SNIP --]
#!/bin/bash

echo "Flushing iptables..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
[-- SNIP --]

# chmod +x /root/scripts/iptables-flush.sh
# /root/scripts/iptables-flush.sh
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

Share on Facebook Twitter

0 comments:

Post a Comment