Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm setting up an ubuntu embedded system as a "master" server which will then broadcast to clients using ad-hoc in a wlan. The purpose is for a client to access the wlan and then access a webapp on my local network.

But instead of having then going to my ip address or my hostname.local i want then to be redirected from all requests to the my hostname.local address in order for them to only access my webapp and nothing else.

Searching on the forum, I found dnsmasq although I'm not sure if this would work for me seeing as I need all requests * to be redirected.

Any ideas? Regards

share|improve this question
add comment

1 Answer

If I understand you correctly, you want to redirect all network traffic to a single web server.

You could do this with an iptables rule on you gateway that is controlling you WLAN.

Taken from here: http://serverfault.com/questions/365000/how-can-i-use-iptables-to-forward-all-traffic-to-a-certain-website

To redirect traffic :/sbin/iptables -t nat -A PREROUTING -s [source network/mask] -p all -j DNAT --to-destination [your webserver]

You will also have to rewrite the source address to remain as you client connection and not the gateway.

To rewrite the source: iptables -t nat -A POSTROUTING -j MASQUERADE

share|improve this answer
add comment

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.