Redirect all internet traffic to a specific webpage?

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
Meph1st0
DD-WRT Novice


Joined: 19 Jun 2008
Posts: 27

PostPosted: Sun Sep 10, 2017 16:52    Post subject: Redirect all internet traffic to a specific webpage? Reply with quote
I've created two guest WLANs following the steps in the wiki here: http://www.dd-wrt.com/wiki/index.php/Guest_WiFi_%2B_abuse_control_for_beginners

So the guest networks are working properly and isolated and unsecured as they should be. To take this a step further I would like to redirect all internet web requests from network clients on both networks to a specific website; a different website per network. I've tried to implement iptables NAT rules to redirect to a specific IP address but that doesn't work well enough since iptables NAT rules only run at layer three. The websites don't quite render correctly by only going to the IP address; there's a bunch of dns, redirects and hotlinking to other sites to put the website together.

The command I was using:
Code:
iptables -t nat -A PREROUTING -s 192.168.5.0/24 -j DNAT --to-destination <IP Address>


I've kind of figured out that I need something that runs at layer 7; like a full featured proxy server or maybe captive portal solution.

I also only want traffic from those two guest networks to pass through the proxy or captive portal solution. My regular home network should go straight out to the internet.

I've tried looking at WifiDog and Chillispot but I couldn't tell if this would be the route to go.

I have a NAS that is capable of squid proxy server but it looks like this implementation of squid is only intended for web caching and does not do any web redirection.

Does anyone have any pointers they could suggest? Rather than squid, would you recommend something else? I'm dangerous enough with Linux that I could probably implement a solution with a little guidance.
Sponsor
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6867
Location: Romerike, Norway

PostPosted: Sun Sep 10, 2017 20:56    Post subject: Reply with quote
Have you tried Services->Hotspot->http Redirect?
Meph1st0
DD-WRT Novice


Joined: 19 Jun 2008
Posts: 27

PostPosted: Sun Sep 10, 2017 22:48    Post subject: Reply with quote
HTTP redirect is just like what I was doing with iptables. It only allows me to provide an IP address to redirect all outbound packets to. I need to be able to provide a URL.

If I ping the website that I want to redirect to it returns an IP address, but I can't just take that IP address and insert it into my address bar. Upper layer functions need to be involved.

Additionally, the HTTP redirect feature doesn't allow me to specify settings separate settings depending on the WLAN the client is connected to.
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6867
Location: Romerike, Norway

PostPosted: Mon Sep 11, 2017 4:40    Post subject: Reply with quote
NoCatSplash have a URL.
Meph1st0
DD-WRT Novice


Joined: 19 Jun 2008
Posts: 27

PostPosted: Tue Sep 12, 2017 2:32    Post subject: Reply with quote
Is it possible to configure a different nocatsplash configuration for each WLAN?
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum