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

My network looks as follows:

PC1 >––––– [Router1 (Wlan)] ––––––––– [Router2] –––––––––> Internet
                                ^         |
                                x         +––––––< PC2

On PC 1 everything works fine except that I don't get any «226 Transfer complete.» responses via FTP. This does not happen on PC 2. (Actually the same machine.)

What I want to do (also to get a better understanding of the topic) is to put my laptop between Router1 and Router2 and play proxy. To see if the 226 packet would actually arrive at Router1.

Attempt so far looks as follows (Laptop at position demarked by the x)

ifconfig eth0 netmask up # Goes to Router2
ifconfig eth1  netmask up
route add default gw dev eth0
echo "1" > /proc/sys/net/ipv4/ip_forward

Router2 configuration:

Static IP:

Now when pinging any address on the WWW I get a Destination Host Unreachable. How do I configure my laptop (and the router) correctly in order to have the traffic proxied through so I can examine it with e.g. Wireshark?

share|improve this question
Do you have an old Hub handy? – joeqwerty Oct 17 '12 at 21:04
@joeqwerty Nope, just a switch. The hub would share all traffic with all ports, right? thinking about where to get one just for fun – Simon A. Eugster Oct 18 '12 at 5:40
Right, which would simplify the setup. Just plug the relevant links and the laptop into the hub and watch all the traffic with no further configuration needed. – joeqwerty Oct 18 '12 at 13:47
up vote 3 down vote accepted

Through the miracle of brctl. This sets up Linux bridges, and is what you need to do what you're looking for. A command sequence would look like:

brctl addbr snooper
brctl addif snooper eth0 eth1
ifconfig snooper up 

This turns your laptop into a 2-port switch, and works best if the WLAN router and the WAN router are connected directly to your laptop. Packets come one one port and out the other. You can sniff on either interface.

For extra fun, you can even use iptables rules on the bridge to filter packets!

share|improve this answer
Thanks a lot! This worked. Very cool. Unfortunately it also seems that the 226 response gets eaten away somewhere else because I could not capture it between the two routers. But that's a different story :) – Simon A. Eugster Oct 18 '12 at 14:55

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.