Route all traffic with iptables to external proxy -


i route http/https/other ports traffic coming pc1 pc2, pc2 should route external proxy able set @ pc2.

my current config is: pc1 (eth0 / 192.168.0.1, gateway: 192.168.0.2) -> pc2 (eth0 / 192.168.0.2) pc2 has nics, eth0 , eth1. eth1 wan connection. in summary, eth1 @pc2 should able route incoming traffic eth0 proxy server.

what i've tried:

sysctl -w net.ipv4.conf.all.forwarding=1 -a forward -i eth0 -o eth1 -j accept -a forward -i eth1 -o eth0 -j accept iptables -t nat -a output -p tcp -o eth1 --dport 80 -j dnat --to proxy:3128 

i'm able ping pc2, unfortunately already. i'm new iptables, help.

there guide setting transparent proxy squid seems might have useful information. seems have different methods adapted solve problem.

most os distributions have guides , tutorials using iptables , routing particular semantics os of choice. have used guides ubuntu help , centos in past , helpful when first learning use iptables.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -