Advertisement
Bebop

iptables/vpn drop/safe ip

Jul 28th, 2011
1,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.65 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # iptables example
  4. #
  5. # Protect your real IP from leaking in the case of a VPN drop
  6. #
  7. # [This is for Linux client only (not server)]
  8. #
  9.  
  10. # Flush all current rules from iptables
  11. #
  12. iptables -F
  13. iptables -t nat -F
  14. iptables -t mangle -F
  15.  
  16. # Always accept local-host traffic
  17. #
  18. iptables -A INPUT -i lo -j ACCEPT
  19.  
  20. # Enable existing connections
  21. #
  22. iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  23.  
  24. #All other traffic is dropped unless its 'to' or 'from' the VPN server
  25. #
  26. iptables -A INPUT -s <SERVER-ADDRESS> -j ACCEPT
  27. iptables -A INPUT -j DROP
  28. iptables -A OUTPUT -d <SERVER-ADDRESS> -j ACCEPT
  29. iptables -A OUTPUT -j DROP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement