HTTP Redirect

From DD-WRT Wiki

Revision as of 18:47, 3 March 2009 by Pbix (Talk | contribs)
Jump to: navigation, search

Option found in "Administration" > "HotSpot" > "HTTP Redirect"

Image:V23-hotspot-menu.png
Image:v23-http-redirect.png

This option enables an HTTP redirector for proxy usage. While it's located on the Hotspot configuration page, Hotspot does not have to be enabled for this option to work properly. The HTTP Redirector works by redirecting all port 80 traffic from the LAN/WLAN to a specified address which could be an HTTP proxy server like Squid, CCProxy, or Winproxy. This feature is especially useful for content filtering in schools, libraries, businesses etc.

It's not completely clear what the purpose of the "HTTP Source Network" setting is. In my tests, setting the IP address in here for only one of the client computers made no difference. All clients were proxied regardless. According to BrainSlayer "you can set a source network which excludes the proxy server", thereby allowing the proxy server to get it's Internet from the same router that has the HTTP Redirector enabled. So far, my tests of this feature, using a WRT54G with v23 SP2, have not produced good results.

HTTP Redirector Source Network

As stated above this option forwards port 80 traffic to the specified destination IP address and port. This is great for example in implementing an anonymous proxy server. However not all traffic gets forwarded. For example, traffic to DD-WRTs own web server is never forwarded (at least in v24) so you will never loose your ability to connect to the router web interface regardless of what you enter here.

In addition you can use the "Source Network" setting to further restrict forwarded traffic. If the "Source Network" is set to 0.0.0.0 then all traffic is forwarded. But if the "Source Network" is set to something else, say 192.168.1.0, then only traffic from the 192.168.1.0 subnet will be forwarded to the proxy.

One reason you might do this is if you want traffic routed to your own proxy on the LAN side of your router. The idea would be for your proxy to be on its own special subnet (ie. 192.168.10.10) with all the other computers being in the standard subnet (ie. 192.168.1.xx). You would set the HTTP Destination IP to 192.168.10.10 and the HTTP Source Network to 192.168.1.0. DD-WRT would then only redirect port 80 traffic coming from your 192.168.1.0 subnet to your proxy. All other subnets would not be re-directed and the proxy server which needs direct access the destination servers would be able to do its job.

Bad HTTP Redirector Settings

If you entered settings into your router's HTTP Redirector settings that were not correct, likely you are unable to log into the web interface because your request to the router's web server is being redirected to who-knows-where. You can use Telnet or SSH to fix this problem.

Telnet into the router.
Enter username and password.
Enter the following commands:

cd /usr/sbin
nvram set http_redirect_enable=0
nvram commit
reboot