Skip to content

Instantly share code, notes, and snippets.

@openrijal
Created August 17, 2016 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save openrijal/9a5fde6867b63fbaea1667418923fe08 to your computer and use it in GitHub Desktop.
Save openrijal/9a5fde6867b63fbaea1667418923fe08 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "Flush all firewall rules and allowing everyone..."
ipt="/sbin/iptables"
## Failsafe - die if /sbin/iptables not found
[ ! -x "$ipt" ] && { echo "$0: \"${ipt}\" command not found."; exit 1; }
$ipt -P INPUT ACCEPT
$ipt -P FORWARD ACCEPT
$ipt -P OUTPUT ACCEPT
$ipt -F
$ipt -X
$ipt -t nat -F
$ipt -t nat -X
$ipt -t mangle -F
$ipt -t mangle -X
$ipt -t raw -F
$ipt -t raw -X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment