lieb39
Mar 22 2006, 05:42
Hello everyone,
I'm looking for a distro. of Linux that has a DHCP server & DNS Server builtin. However, there is a twist. I want all requests for any websites to be redirected to a address of my choice. E.g. if someone tries to get on the www.google.com, they get redirected to a website of my choice. I'm essentially setting up a wireless chat, so I need all requests to be redirected.
Thanks!
-lieb39
Billprozac
Mar 22 2006, 14:14
I am not a linux expert (just getting started), but I believe that could be done using iptables. Setup up the linux server with DHCP/DNS (They almost all have the services builtin, but have fun with BIND). Configure the defGW to be your server. Configure redirect in IPTables to redirect all ip traffic outside the local subnet to the default webserver.
Wait why do you want google.com to go to a webpage of your choice?
That just sounds silly
Billprozac
Mar 23 2006, 01:11
Ummm, it actually a very common thing. Captive portals will use this concept inside a walled garden. Many proxies will redirect naughty sites to an internal splash page.
lieb39
Mar 23 2006, 08:55
Billprozac: Thanks for clearing that up. The exact reason why I'm redirecting all (not certain web-sites) because there is no actual Internet connection available, I just want to make a local chat, which all users are redirected to.
Can any linux experts help me out, to configure the IP tables?
Thanks,
lieb39
Ahh so you using it as a proxy got you.
You can use iptables, but its quite ugly. You can look at the wifidog or nocatsplash to do it.
ugly?? what is ugly about adding a rule at the bottom to redirect all outgoing web requests to a local port:
ipchains -A input -p tcp -d 0.0.0.0/0 80 -j REDIRECT 8888 -l
Then use "tproxyd" or "redir" to redirect to the other machine if webserver is not running on the same server?
redir --lport=8888 --laddr=192.168.1.100 --cport=80 --caddr=192.168.1.101
Im curious though - if there is no internet connection.. how are they going to even attempt to goto www.google.com?? Since without a internet connection, how will they or any machine resolve where www.google.com is? If it can not be resolved, browser will not go anywhere
daPhoenix
Apr 6 2006, 13:33
Quote - (BudMan @ Apr 6 2006, 15:18) [snapback]587389319[/snapback]
ugly?? what is ugly about adding a rule at the bottom to redirect all outgoing web requests to a local port:
But but.. it's a command line. *cry*
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.