Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

this is just a small hacking attemp to our router.

I'm trying to setup a small DNS and forward webpages through proxy behind the scene. I've successfully implement the DNS server that will do the resolving or anything involved in address resolve.

But is there anyway I can forward the user using DNS to a proxy instead of request directly to the server? Are there any software/opensource that I can use?

I notice on paid wireless, they can provide a login page if user is not login yet, i think this is a way of implementing proxy.

Also the hardware is very basic with linksys and netgear router which connect directly to the internet. It's a basic LAN

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I may be answering the wrong question because you are talking about using DNS to give false replies, but I will give this answer any way in case this is what you really want to be doing (if you want to implement a login-type page for all users).

You want to implement something known as a "Walled Garden" or, if you look in Wikipedia, a "Captive Portal".

Learn IPTables - you will most likely want a default rule that forwards all traffic to your HTTP server. Your HTTP server will then have an intelligent page that updates a database or similar with the IP addresses that have a valid login and consequently a script will update your iptables rules with those ip addresses permitted access to the Internet.

You would create a chain called "garden", and add the following rules to it which would force all traffic except DNS to be forwarded to 192.168.1.1:

iptables -A garden -p tcp --dport ! 53 -j DNAT --to 192.168.1.1
iptables -A garden -p udp --dport ! 53 -j DNAT --to 192.168.1.1

Then in the appropriate chain (be it NAT or whatever) add a rule to jump to the "garden" chain if not a registered valid IP address.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.