title: Redirect all the traffic from router to proxy server
body: <p>I don't know if the question is related to the topics on stackoverflow so, if not sorry in advance.</p>
  
  <p>I have the following problem that I'm trying to solve : <br>
   I am connected to my university network that requires me to configure my browser to use a proxy. I want to set up a router in my house ( D-Link Dir-300 with Firmware: DD-WRT v24-sp2) and because I am using multiple Android devices that are not rooted ( I can't use global proxy apps ) I was thinking about the following solution : <br>
      <code>Question</code>  Can I make my router redirect all the traffic from my wireless network to the proxy server that I'm using ( allowing the devices not to configure a proxy server) ?</p>
  
  <p>I have a HTTP redirect tool available on the router configuration page
  <img src="https://i.stack.imgur.com/XwPOn.jpg" alt="HTTP Redirect">
  <br>
  <br> I looked up the destination IP address from the proxy URL that I was using and I get 4 IP addresses for that node, I tried to use two of them with the source network set to 192.168.1.0 but it didn't work -my browser on the android devices doesn't work without setting up the proxy.</p>
  
  <p>____________________________________ EDIT ____________________________<br>
  After looking some more I found this <a href="http://sq4ind.eu/redirect-traffic-to-external-server-with-dd-wrt/" rel="noreferrer">link</a></p>
  
  <pre><code>#!/bin/sh
  PROXY_IP=[IP]
  PROXY_PORT=[PORT]
  LAN_IP=`nvram get lan_ipaddr`
  LAN_NET=$LAN_IP/`nvram get lan_netmask`
  
  iptables -t nat -A PREROUTING -i br0 -s $LAN_NET -d ! $LAN_IP -p tcp --dport 80 -j DNAT --to $PROXY_IP:$PROXY_PORT
  iptables -t nat -A POSTROUTING -o br0 -s $PROXY_IP -p tcp -d $LAN_NET -j SNAT --to $PROXY_IP
  iptables -A FORWARD -i vlan1 -o br0 -s $LAN_NET -d $PROXY_IP -p tcp --dport $PROXY_PORT -j ACCEPT
  </code></pre>
  
  <p>How can I modify it to redirect all the traffic udp/tcp etc coming from all the ports?</p>