What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Trying to connect via a proxy with IP tables- but stuck

mrdude

Regular Contributor
Sorry if this has been discussed before - but I have been trying for hours with various options to connect to a proxy server, I have put the following in my jffs/scripts/firewall-start file:

Code:
PROXY_IP=87.246.54.12
PROXY_PORT=3128
LAN_IP=`nvram get lan_ipaddr`
LAN_NET=$LAN_IP/`nvram get lan_netmask`

/usr/sbin/iptables -t nat -A PREROUTING -i br0 -s $LAN_NET -d $LAN_NET -p tcp --dport 80 -j ACCEPT
/usr/sbin/iptables -t nat -A PREROUTING -i br0 -s ! $PROXY_IP -p tcp --dport 80 -j DNAT --to $PROXY_IP:$PROXY_PORT
/usr/sbin/iptables -t nat -I POSTROUTING -o br0 -s $LAN_NET -d $PROXY_IP -p tcp -j SNAT --to $LAN_IP
/usr/sbin/iptables -I FORWARD -i br0 -o br0 -s $LAN_NET -d $PROXY_IP -p tcp --dport $PROXY_PORT -j ACCEPT

Some other entries in that file work fine so I know that the script is executing properly.

I was expecting when I go to check my IP that it would be the same as the proxy - but it's not, what am I doing wrong? thanks.
 
You are wanting the router to redirect all LAN traffic through the proxy?

I think your iptables setup assumes the remote proxy is a similar iptables setup, rather than a standard socks or http proxy.

Also, are you sure you want to send all traffic unencrypted?
 
Yes all traffic is to go via the proxy, I don't know about the proxy servers iptables - I just want to be able to use any free proxy server, also I don't care about encryption as I just want to be able to do this now and again - I will disable it when not required.

Thanks
 
You need a service to translate your raw network traffic into whatever protocol the proxy uses.

Rather than trying to do this at the router, I would do this at the client. There's a neat program called proxychains that can tunnel command-line programs.


Can I ask why you are trying to proxy? If you want to browse pseudo-anonymously, there are all sorts of plugins & addons for standard web browsers.
 
I have an oscam card server running from my router and sometimes I want to be able to connect to people via a proxy, as it's running from the router itself and uses different ports and both udp and tcp I can't use any plugins or a web browser - or any other windows software. That's why I want to use Iptables to connect to the proxy.
 
Can socks/http proxies even handle UDP?
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top