Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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:

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

Your Answer


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.