Subdomain Posts
None | 230 days ago
None | 328 days ago
None | 407 days ago
None | 409 days ago
None | 683 days ago
Bash | 692 days ago
None | 706 days ago
None | 786 days ago
Bash | 841 days ago
None | 845 days ago
Recent Posts
Java | 25 sec ago
PHP | 27 sec ago
Bash | 1 min ago
HTML | 1 min ago
Python | 1 min ago
PHP | 1 min ago
None | 1 min ago
HTML | 1 min ago
Bash | 2 min ago
None | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By transparent_proxysh on the 28th of Apr 2008 09:36:18 AM Download | Raw | Embed | Report
  1. #!/bin/sh
  2. iptables -t nat -F  # clear table
  3. iptables -t nat -X
  4. iptables -t filter -F
  5. iptables -t filter -X
  6.  
  7. # bypass laptop
  8. iptables -t nat -A PREROUTING -p tcp -i eth1 -s 192.168.0.27 -j ACCEPT
  9.  
  10. # chains
  11. iptables -t nat -N REDGUARDIAN
  12. iptables -t nat -N REDSQUID
  13.  
  14. # normal transparent proxy
  15. iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 80 -j REDIRECT --to-port 8080
  16. iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 21 -j REDIRECT --to-port 2121
  17.  
  18. # handle connections on the same box (192.168.0.2 is a loopback instance)
  19. gid=`id -g proxy`
  20. dgid=`id -g dansguardian`
  21. iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --gid-owner $gid  -j ACCEPT
  22. iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --gid-owner $dgid -j ACCEPT
  23. iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --gid-owner 1000 -j ACCEPT
  24. iptables -t nat -A OUTPUT -p tcp --dport 80 -m owner --gid-owner 0 -j ACCEPT
  25. iptables -t nat -A OUTPUT -p tcp --dport 21 -m owner --gid-owner $gid -j ACCEPT
  26. iptables -t nat -A OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j ACCEPT
  27. iptables -t nat -A OUTPUT -p tcp -d 192.168.0.5 --dport 80 -j ACCEPT
  28. iptables -t nat -A OUTPUT -p tcp -d 192.168.0.27 --dport 80 -j ACCEPT
  29. iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination 192.168.0.1:3128
  30. #iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination 192.168.0.1:8080
  31. iptables -t nat -A OUTPUT -p tcp --dport 21 -j DNAT --to-destination 192.168.0.1:2121
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: