Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 want to create a linux gateway proxy for my wireless router. I have a modem connected to a non-wireless router connected to a wireless router set up as an access point. I want to put the linux server between the non-wireless router and the wireless router, so all traffic goes in one NIC and out the other. I'd like to be able to monitor the traffic. I'd also like to limit the amount of speed the wireless is allowed. The traffic should be mainly HTTP, so it won't matter too much if I can only monitor and reroute HTTP packets. I also want to be able to modify the pages it serves like inserting text in the page. How can I do this?

share|improve this question
up vote 1 down vote accepted
echo 1 > /proc/sys/net/ipv4/ip_forward
modprobe ipt_MASQUERADE
iptables -F; iptables -t nat -F; iptables -t mangle -F
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to IP_EXTERN_OF_LINUX

MASQUERADE is used for dynamic ip address. If you have a static ip you can use SNAT (let me know)

share|improve this answer

For the second part of your question, install a caching proxy like Squid on the box and set it up as a transparent proxy.

You can then filter some or all requests and change them whichever way you want using a redirection script. For a funny but interesting example refer to:

share|improve this answer

I think you should go with ClearOS.

ClearOS is a powerful network and gateway server designed for small organizations and distributed environments. Though ClearOS comes with an extensive list of features and integrated services, the solution is easy to configure thanks to the intuitive web-based interface.

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.