Advertisement
Guest User

ipconfig

a guest
May 6th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. # 1. Delete all existing rules
  2. iptables -F
  3.  
  4. # 2. Set default chain policies
  5. iptables -P INPUT DROP
  6. iptables -P FORWARD DROP
  7. iptables -P OUTPUT ACCEPT
  8.  
  9. # 4. Allow ALL incoming SSH
  10. iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
  11. iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
  12.  
  13. # 12. Ping from inside to outside
  14. iptables -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT
  15. iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT
  16.  
  17. # 13. Ping from outside to inside
  18. iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
  19. iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT
  20.  
  21. # 14. Allow loopback access
  22. iptables -A INPUT -i lo -j ACCEPT
  23. iptables -A OUTPUT -o lo -j ACCEPT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement