Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. IPv4 (v6 has been disabled)
  2. IP Address: 192.168.0.1
  3. Netmask: 255.255.255.128
  4. Gateway: 192.168.0.250
  5. METRIC: 1
  6.  
  7. IP GW Metric
  8. 192.168.0.0 192.168.0.250 1 # mine
  9. 192.168.0.0 0 # system default
  10. # plus some other routes that I don't think are important
  11.  
  12. # clear existing iptables rules
  13. iptables -F
  14. iptables -X
  15. iptables --table nat -F
  16. iptables --table nat -X
  17. iptables --table mangle -F
  18. iptables --table mangle -X
  19.  
  20. # the rest of these rules were adapted from a blog post and I don't fully understand how they work
  21. iptables -t nat -A PREROUTING -i eth0 -s 192.168.0.0/24 -d 192.168.0.0/24 -p tcp --dport 80 -j ACCEPT
  22. iptables -t nat -A PREROUTING -i eth0 -s 192.168.0.0/24 -p tcp --dport 80 -j DNAT --to 192.168.0.250:3128
  23. iptables -t nat -I POSTROUTING -o eth0 -s 192.168.0.0/24 -d 192.168.0.250 -p tcp -j SNAT --to 192.168.0.1
  24. iptables -I FORWARD -i eth0 -o eth0 -s 192.168.0.0/24 -d 192.168.0.250 -p tcp --dport 3128 -j ACCEPT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement