Configure iptables Firewall: Difference between revisions
From WickyWiki
Created page with "Configuring iptables Firewall: * http://www.lammertbies.nl/comm/info/iptables.html IP CIDR notation: * https://en.wikipedia.org/wiki/CIDR_notation" |
No edit summary |
||
| Line 1: | Line 1: | ||
== See also == | |||
Configuring iptables Firewall: | Configuring iptables Firewall: | ||
* http://www.lammertbies.nl/comm/info/iptables.html | * http://www.lammertbies.nl/comm/info/iptables.html | ||
IP CIDR notation: | IP-address CIDR notation: | ||
* https://en.wikipedia.org/wiki/CIDR_notation | * https://en.wikipedia.org/wiki/CIDR_notation | ||
== List iptables settings == | |||
List iptables settings: | |||
<syntaxhighlight lang=bash> | |||
sudo iptables -vnL | |||
</syntaxhighlight> | |||
== Clear all iptables settings == | |||
<syntaxhighlight lang=bash> | |||
sudo -i | |||
IPTABLES="$(which iptables)" | |||
# RESET DEFAULT POLICIES | |||
$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 mangle -P PREROUTING ACCEPT | |||
$IPTABLES -t mangle -P OUTPUT ACCEPT | |||
# FLUSH ALL RULES, ERASE NON-DEFAULT CHAINS | |||
$IPTABLES -F | |||
$IPTABLES -X | |||
$IPTABLES -t nat -F | |||
$IPTABLES -t nat -X | |||
$IPTABLES -t mangle -F | |||
$IPTABLES -t mangle -X | |||
exit | |||
</syntaxhighlight> | |||
[[Category:Ubuntu]] | |||
[[Category:Ubuntu Network]] | |||
[[Category:Ubuntu Server]] | |||
[[Category:201301]] | |||
Revision as of 11:08, 6 January 2013
See also
Configuring iptables Firewall:
IP-address CIDR notation:
List iptables settings
List iptables settings:
sudo iptables -vnL
Clear all iptables settings
sudo -i IPTABLES="$(which iptables)" # RESET DEFAULT POLICIES $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 mangle -P PREROUTING ACCEPT $IPTABLES -t mangle -P OUTPUT ACCEPT # FLUSH ALL RULES, ERASE NON-DEFAULT CHAINS $IPTABLES -F $IPTABLES -X $IPTABLES -t nat -F $IPTABLES -t nat -X $IPTABLES -t mangle -F $IPTABLES -t mangle -X exit