Redirect port 80 traffic to a random Web site

How would I redirect Internet traffic reaching my router's WAN to a particular Web site?

Suppose my public IP address was 1.2.3.4 and I used a DDNS domain e.g. abc.dynu.net.

Schematically the redirect would look like these:

  1. abc.dynu.net:80 > google.com
  2. abc.dynu.net:80 > whatever is Google's IP address
  3. 1.2.3.4:80 > google.com
  4. 1.2.3.4:80 > whatever is Google's IP address

Maybe not all four are possible.

My motivation is to understand how redirect works. Also, cases 1 and 2 would give me a convenient way to check whether DDNS is working (I don't need port 80 access to the router).

Either LuCI or config instructions would do. Thanks.

1 Like

You seem to be referring to HTTP redirection; you need to configure a HTTP server, listening on port 80 of the WAN interface, and configure the server to do the redirection to Google's URL.

2 Likes

OK. So OpenWrt can't do it (short of having a HTTP server installed to it). Thanks.

OpenWrt provides the built-in HTTP to HTTPS redirect.
So, the one you want should also be possible, something like this:
https://openwrt.org/docs/guide-user/services/webserver/uhttpd#embedded_lua

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.