Difference between revisions of "OpenVPN/Firewall"

From Secure Computing Wiki
Jump to: navigation, search
(Created page with 'Follow these instructions to disable/clear your firewall rulesets for various firewalls. == pf == pfctl -d == iptables == ## Save a backup of current firewall config iptables-s...')
 
Line 2: Line 2:
  
 
== pf ==
 
== pf ==
pfctl -d
+
Disable firewall
 +
<pre>pfctl -d</pre>
 +
 
 +
Enable firewall
 +
<pre>pfctl -e</pre>
  
 
== iptables ==
 
== iptables ==
## Save a backup of current firewall config
+
Save a backup of current firewall config
iptables-save > ~/fw-backup.ipt
+
<pre>iptables-save > ~/fw-backup.ipt</pre>
  
## Restore a firewall config
+
Restore a firewall config
iptables-restore < ~/fw-backup.ipt
+
<pre>iptables-restore < ~/fw-backup.ipt</pre>
  
## Completely turn off firewalling
+
Completely turn off firewalling
iptables -t nat -P PREROUTING ACCEPT
+
<pre>iptables -t nat -P PREROUTING ACCEPT
 
iptables -t nat -P POSTROUTING ACCEPT
 
iptables -t nat -P POSTROUTING ACCEPT
 
iptables -t nat -P OUTPUT ACCEPT
 
iptables -t nat -P OUTPUT ACCEPT
Line 28: Line 32:
 
iptables -t mangle -X
 
iptables -t mangle -X
 
iptables -t filter -F
 
iptables -t filter -F
iptables -t filter -X
+
iptables -t filter -X</pre>

Revision as of 11:28, 7 April 2009

Follow these instructions to disable/clear your firewall rulesets for various firewalls.

pf

Disable firewall

pfctl -d

Enable firewall

pfctl -e

iptables

Save a backup of current firewall config

iptables-save > ~/fw-backup.ipt

Restore a firewall config

iptables-restore < ~/fw-backup.ipt

Completely turn off firewalling

iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t mangle -P INPUT ACCEPT
iptables -t mangle -P OUTPUT ACCEPT
iptables -t mangle -P FORWARD ACCEPT
iptables -t mangle -P PREROUTING ACCEPT
iptables -t mangle -P POSTROUTING ACCEPT
iptables -t filter -P INPUT ACCEPT
iptables -t filter -P OUTPUT ACCEPT
iptables -t filter -P FORWARD ACCEPT
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -t filter -F
iptables -t filter -X