Super User is a question and answer site for computer enthusiasts and power users. 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

At the moment I have a router on, a Linux box on and desktop clients from

Everything works with as the default gateway.

I'd like to send the traffic from the desktop clients via the Linux box before it goes out through the router so I can sniff the traffic (some of these are wireless connections).

Can I set the default gateway to on the desktop clients and then perhaps add some iptables rules to forward this traffic through

Quite happy to change the client desktops to another subnet if that makes it easier. Thanks in advance.

share|improve this question

Yes. No iptables rules are needed. Normal routing will send the packets to their destination. Just make sure IP forwarding is enabled. Just remember, you won't see the packets going in the other direction unless you make a similar configuration in the router. Turn off ICMP redirects.

share|improve this answer
Thanks. cat /proc/sys/net/ipv4/ip_forward returns 1, but setting the default gateway on a client desktop to results in browser requests timing out. – rich Sep 1 '12 at 11:13
Turn off the firewall on the machine. – David Schwartz Sep 1 '12 at 11:14
Same behaviour. – rich Sep 1 '12 at 11:51
if its all traffic I would find it easier to add a 2nd ip to the linux box and have the router and linux box on a different network ip ie linux/router 10.1.1.x and every one else/linux 2nd ip on 192.168.1.x the masquerade lines arent to hard in iptables since you want to allow every thing. its 4? iptables lines with 2 nics may be a tad more if its just 1 nic and 2 ip's. also the monitoring app may make you have 2 nics just to be able to attach to 1 device and monitor every thing logically. – Kendrick Sep 1 '12 at 17:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .