Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Flush all rules
- iptables -F
- iptables -X
- # Allow unlimited outgoing traffic to all networks and protocols (for now)
- iptables -P OUTPUT ACCEPT
- # Allow unlimited incoming traffic on private network for all protocols
- iptables -A INPUT -i lo -j ACCEPT
- # Allow incoming traffic from established/related connections on public network for all protocols
- iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
- # Allow new (incoming) SSH on public network
- iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
- # Allow new (incoming) HTTP/HTTPS on public network
- # HTTP
- iptables -A INPUT -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
- # HTTPS
- iptables -A INPUT -i eth0 -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
- # Drop everything elese
- iptables -P INPUT DROP
- iptables -P FORWARD DROP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement