3

I'd like to use the Raspberry Pi 2 as a WAN emulator, i.e.

  • It would have 2 network adapters (1 built-in, 1 USB)
  • It acts as a "man in the middle" between 2 hosts
  • It delays packets, randomizes the order of packets, drops packets, modifies packets, ...

I know WANEM, but it does not seem that would work with a Raspberry Pi. At least I don't know how to boot from an ISO. I also know Clumsy, but that's for Windows only.

How would I build above functionality with the Raspberry Pi?

3

There's a fairly lengthy tutorial on disk91.com that looks promising. It's a little dated and based on Wheezy rather than Jessie, but I think it should at least provide some pointers.

A USB ethernet dongle was connected to an original model B Pi. The network configuration was then changed to allow traffic to flow between the built in network adapter and the dongle. They used dnsmasq to allow the Pi to act as a DNS server to a device on the local network.

To create given conditions on the network they used tc. They chose to manipulate connection bandwidth and latency, but from the look of the man page you can play with it to create a wide range of disturbances. To adjust the parameters they built a simple locally hosted web page which passed form inputs to a CGI script.

At the time of writing the tutorial page includes a downloadable script which should automagically set up their limited bandwidth/latency scenario.

  • I had to change a few things (like directories for lighttpd, they seem to be in /var/www/html nowadays), but otherwise excellent and very easy to follow. I also can't fully recommend the script. It needs eth0 to be the WAN interface, which in my setup isn't the case and the script does not allow to configure it. – Thomas Weller Apr 17 '16 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.