Skip to content

Instantly share code, notes, and snippets.

@dtanham
Created January 27, 2014 12:43
Show Gist options
  • Save dtanham/8647893 to your computer and use it in GitHub Desktop.
Save dtanham/8647893 to your computer and use it in GitHub Desktop.
Remove firewall rules from default Debian build
#!/bin/sh
# This file will reset the firewall to allow everything.
#
# Set the default policy
#
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
#
# Set the default policy for the NAT table
#
/sbin/iptables -t nat -P PREROUTING ACCEPT
/sbin/iptables -t nat -P POSTROUTING ACCEPT
/sbin/iptables -t nat -P OUTPUT ACCEPT
#
# Delete all rules
#
/sbin/iptables -F
/sbin/iptables -t nat -F
#
# Delete all chains
#
/sbin/iptables -X
/sbin/iptables -t nat -X
# End message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment