Sponsored Content
Top Forums UNIX for Dummies Questions & Answers LAN traffic rerouting to web server Post 302180101 by J-Fal on Saturday 29th of March 2008 06:17:10 PM
Old 03-29-2008
LAN traffic rerouting to web server

Hello. I am not sure where to post this and would appreciate any moderator help in moving this to the area where it is most applicable. Thank you.


I've posted these questions in a couple different forums, but have not received any answers about what I am doing wrong. I would appreciate any help you guys could provide me. Even a point to the right direction would be beneficial.

I am trying to set up a LAN web server. This is just a wireless router, a Linksys WRT160N flashed with DD-WRT (done) that users can connect to, and Mac Mini for the web server, running Apache 2.2.6 on OS X 10.5.2. There is no internet access here, just wireless clients connecting to the router.

I have set up DNSmasq on the router to run as the DHCP server (works perfectly), as well as for DNS. DNSmasq is set to be authoritative. I've entered the MAC address and IP address in DNSmasq for the webserver, named localserver.

Okay. So what I am trying to do is set up this so that when wireless clients connect, they can open their web browsers, and assuming they don't have a blank page set, they are redirected to the the index.html page on the web server. That's all. Then of course they can browse around the server. That is the entire function of this wireless network. The users don't know anything about the IP of the web server, nor its name.

Google should resolve as http://localserver/ ANYTHING, other than the router IP, localhost, or specific valid pages on the webserver, like http://localserver/page2.html, I would like to be redirected to http://localserver I will set up ipfw on the Mac so that any packets not destined for the web server (TCP 80) are just dropped. That's no problem.

But rerouting the traffic successfully is quite a task for me. I'm honestly a novice when it comes to networking. Is it possible to set up DNSmasq without needing a LAN domain, so no matter what is present in the client's web browser address bar, it will change to just http://localserver? I've tried forwarding all traffic with a LAN domain, and without, with mixed results.

This would be very similar to going to a library or a cafe and opening your browser once you connect to the router, and being redirected to a login page, only I'm just redirecting people to index.html on a web server. I can't just use port forwarding on the router because I'm forwarding traffic from the LAN, not a WAN.

The /etc/hosts file on the router is:

127.0.0.1 localhost
192.168.1.254 DD-WRT
192.168.1.253 localserver

I have to say here that in DD-WRT, under the DNSmasq options, I have added the line: address=/#/192.168.1.253 which I believe would resolve all entries that aren't found in the hosts file to 192.168.1.253. Is that correct? It does SEEM to work. Is the client then sent to the web server IP?

I can verify that without a LAN domain, under nslookup, I can get anything to resolve as 192.168.1.253, which is what I want, but when I open a web browser, the address bar does not change to http://localserver/. Why is that? I have attempted to do RedirectMatch and 404 redirects to index.html in Apache, but that does not work. If I can't get users to be redirected to http://localserver/, I'd be happy with just http://192.168.1.253 as long as they are actually able to just open their browser and get to the server with no interaction on their part.

Should I just set up a name server on the Mac Mini? I could do that, but then how would I go about it? Name Daemon (named)? I would like to avoid learning BIND if it's not absolutely necessary. And if the Mini is the name server, how would I forward all web traffic from the LAN clients to it?

Would you guys be willing to point me to where I can go to get more help with this? I guess I need direction on how to correctly configure DNSmasq for what I'm trying to do, how the traffic is routed from beginning to the server, and probably how to set up Apache correctly.

Thanks again. Smilie
 

4 More Discussions You Might Find Interesting

1. IP Networking

LAN server - Proxy, DNS, WEB - I'm lost!!!

Ok! I started to do something and I got lost...and crazy! I got MW2000S gateway device that provides wireless internet access! It is configured to work as NAT. Clients connect to MW and have access to internet and it works beautifully! And now! In the same network I have Ubuntu machine. First I... (0 Replies)
Discussion started by: salvor_hardin
0 Replies

2. Web Development

Cannot access Apache web server from Wan side, only Lan side.

I have installed WAMPSERVER 2.0 on my windows vista x64 system but still am having issues with getting the webserver to be seen outside my local network. It is working fine within my local network. Been through several setup tutorials so far, no dice still. For testing purposes I have... (1 Reply)
Discussion started by: davidmanvell
1 Replies

3. IP Networking

LAN traffic leaking on to WAN

Network map: WAN external interface 192.0.0.0 network | WAN internal interface 192.0.3.0 network | 192.0.3.0 LAN | wireless router 192.0.3.1 | DSL modem 192.0.3.2 The problem I am having is that some traffic from the 192.0.3.0 LAN seems to be "leaking" onto the 192.0.0.0 WAN. I... (0 Replies)
Discussion started by: herot
0 Replies

4. IP Networking

Routing traffic problem between 3G and Office Lan Network

Hi, I would like to ask some networking solution regarding my work LAN and 3G usb network problem. I want to route my internet traffic to the 3G network and sometimes connect to some of my work network for ssh to configure some workstation or print something. Currently my problem is i can't... (0 Replies)
Discussion started by: jao_madn
0 Replies
All times are GMT -4. The time now is 06:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy