Help - Search - Members - Calendar
Full Version: Linux DHCP & DNS Server?
Neowin Forums > *nix Customization & Support > Linux Server/BSD/Unix
lieb39
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
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.
msg43
Wait why do you want google.com to go to a webpage of your choice?
That just sounds silly
Billprozac
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
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
msg43
Ahh so you using it as a proxy got you.
ivanz
You can use iptables, but its quite ugly. You can look at the wifidog or nocatsplash to do it.
BudMan
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 wink.gif
daPhoenix
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* whistle.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.