Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # RESET RULES
- iptables -F INPUT
- iptables -F OUTPUT
- iptables -F FORWARD
- iptables -t nat -F
- iptables -F
- iptables -X
- iptables -Z
- # DEFAULT POLICY
- iptables -P FORWARD DROP
- iptables -P INPUT DROP
- iptables -P OUTPUT DROP
- # Enable only for a router
- #iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
- # MISC - Allow established connections
- iptables -A FORWARD -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
- iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
- iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
- # MISC - Allow ping
- iptables -A INPUT -p icmp -j ACCEPT
- iptables -A OUTPUT -p icmp -j ACCEPT
- # Uncomment only when above rules are tested and valid
- #iptables-save
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement