Installing and Configuring WANem Virtual Appliance

Published by Christian Mohn · Read in about 6 min (1188 words)

In a previous post, Using the WANem WAN Emulator Virtual Appliance, I’ve talked about how I’ve successfully used WANem to emulate different WAN scenarios.

Since I work for a shipping company, the ability to emulate VSAT conditions are especially useful for testing and proof-of-concept scenarios.

You can use WANem a couple of different ways but my setup is pretty simple but does the job perfectly.

Downloading WANem #

I have chose to use the WANem Virtual Appliance running in a virtual machine hosted by VMware Workstation. If you don’t have Workstation handy, VMware Player will also do the job. You don’t need to use the virtual appliance, as WANem also offers a bootable ISO download that you could boot your VM from

Starting and configuring WANem #

First off, extract the WANemv2.1.zip file, and place the virtual machine files in a know location. My choice is _c:\virtual machines_ but you will have to adjust that for your specific environment.

Secondly, fire up VMware Workstation and chose the “Open existing VM or Team” option

In the file dialog box browse to where you extracted the virtual machine files and select “Open”

I like to run the WANem VM in bridge mode, since this gives the VM it’s own IP address from my DHCP server. This comes in handy later when we setup what traffic we want to route through WANem. By default the VM is configured in “Bridge Mode” which is the network mode we want, so go ahead and start the VM by pressing the “Power on this virtual machine” option.

The WANem VM starts to boot up, but it stops asking if you want to configure all network interfaces via DHCP.

As I use DHCP in my network, I don’t have to specify any network information so I hit ‘y’ to let it continue booting. Once again the boot process stops, this time asking you to specify a root password for the VM. Provide your own password twice, and the boot process is finished. Don’t worry about the password strength, or even if you remember it later. The VM boots on a pre-configured Knoppix LiveCD, and the next time you start it it will ask for a new password.

If you don’t see the IP address that WANem has received from your DHCP server, type status and hit enter, and it will show you the IP it has been assigned.

Open your favorite browser, and point it to http://WANemIP/WANem (in my case this was http://192.168.5.90/WANem)

And there it is, WANem is up and running. We’ll leave it as is for the time being, and start routing traffic through it as is.

Running IP traffic trough WANem #

You have a couple of choices when it comes to routing your traffic through WANem. The easiest setup si where you set WANem as your default gateway and route all traffic through it. Remember though that this only comes into play if your destination is on another subnet than the one you are currently connected to. In many scenarios this isn’t desirable, and I prefer to route specific traffic through WANem and not have to play around with my DHCP assigned settings.

What I usually do, is to drop into cmd in administrator mode, and issue the following command:

route add {destination IP} mask 255.255.255.255 {WANem IP}

This routes all traffic from the computer I run the command on, through the WANem IP address, and from there on it goes to it’s original destination. This allows it to work on local subnet traffic, as well as remote traffic, and it will not affect any other IP traffic from that computer to the rest of the network.

Obviously, we need a destination as well. For this lab setup I decided to route the traffic to my local printer through WANem. It’s ip is 192.168.5.12, so the command to run inside cmd as administrator is:

route add 192.168.5.12 mask 255.255.255.255 192.168.5.90

Now, all traffic from my local computer to my printer is routed through WANem. For now, nothing much happens. WANem receives the data on it’s network card, and promptly sends it on it’s merry way to the final destination; my printer. No innocent packets have been mauled or otherwise hurt in the process, at least not so far.

If you want to route everything even local subnet traffic through WANem, enter the following command:

route add 0.0.0.0 mask 0.0.0.0 {WANem IP} See this comment for context**_. _**

Tweaking WANem settings #

Finally, the fun part! Now we can start playing around with those innocent little network packets that flow through the network. Ever wanted to know what happens if you try to print to a printer over a 128kb WAN link? Well, now you can! I would strongly advise against trying to print your über 120 slide PowerPoint presentation at this point, but you can if you want to. Possibly.

I’m not going to try to print over the link as it is now, we’ll have to settle for a little demonstration using much simpler means.

Tool of choice the ever faithfull ping. Basically I’ll demonstrate how WANem fiddles with your network traffic. First off, a just a normal ping of my printer with no edits done by WANem what so ever:

As you can see, as this is on my local network, the response time is great at 1ms and no dropped packets.

Now we can open the WANem web interface, and start messing about. Click on “Advanced Mode” and then on the “Start” button to bring up the web interface.

The next screen brings up a lot of options, and we’re going to tweak a couple of them.

I set the “Delay Time (ms)” to 200ms and the “Loss %” to 25%, and hit “Apply Settings”. When we turn back to our cmd window, we should see instant results in our ping monitor.

As you can see, the response time is now approximately 200ms and the packet loss is about 25%, in accordance with the settings I’ve applied. Of course, as you can see, there are lots of other settings to play around with as well.

WANem also allows you to save your settings, so if you find your own perfect little real world emulation scenario you can export the settings and re-apply them later if you wish.

Cleaning house #

When testing is over, be sure to remove your static route(s) again. If you don’t, and you power down your WANem appliance you simply will not be able to reach your destination(s) until it’s powered on again. Thankfully, removing the static routes are as easy as adding them in the first place. The command to run, in an administrative mode cmd is:

route delete {destination IP}

Conclusion #

WANem is a very nice, and simple to set up, little appliance that could make it much easier planning deployments and emulating real world scenarios. After all, do you know how your applications behave if they get high latency connections? Or if you get jitter problems or even dropped packets?

Give it a test, you might just get a bit surprised at the results you get.

Post last updated on January 2, 2024: Add author

About

vNinja.net is the online hub of Christian Mohn and Stine Elise Larsen.

The site primarily focuses on IT architecture and data center technologies, with a strong emphasis on virtualization and related topics.
While the main content revolves around these areas, you'll also find a range of other subjects covered from time to time, reflecting the interests of authors.

Sponsors