WANem (Wide Area Network Emulation) is an awesome tool for emulating a WAN in your test/dev environment or even a demo lab. I use it in my demo lab to show customers how the technologies might behave in their environment.
WANem is a piece of software running on Knoppix, a well-known Linux distribution based on Debian. It comes in two forms:
- As an ISO that is launched through a LiveCD at computer startup.
- As a VMware Virtual Appliance that can be launched from a VMware platform.
You can get WANem from here: http://wanem.sourceforge.net/
Since my lab runs multiple hypervisors I found it too complex to build the switching and routing required to implement it as a virtual appliance, so I acquired an old PC and purchased a 2nd network card. This gives me the flexibility needed to implement it as needed.
For ease of implementation I implement it in Bridge mode. Unfortunately Bridge mode does not support all the nice Advanced Mode features, but it does enable you to set the bandwidth and latency (delay) from within the Basic Mode configuration page.
An advantage with Bridge mode is that it will automatically pass through DHCP broadcasts. This is a drawback if running WANem as a router because the current implementation of WANem does not contain the dhcp-helper package, and as of version 2.2, there is currently no way to add it because it is launched through a LiveCD at computer startup, unless of course you use the VMware virtual appliance. As of version 2.2 WANem cannot be installed on a hard drive. This should be possible in a future releases, which will then mean that additional packages can be added, such as the dhcp-helper package, etc.
The following notes were collated from here:
To configure the WANem as a Bridge
When the WANem first boots…
- It will ask if you want to configure all interfaces via DHCP. Type y and hit Enter.
- Enter a new UNIX password. (Enter the password of your choice.)
- Retype the new UNIX password.
You will need the password if you want to remotely access the Knoppix Linux platform via SSH.
Once it has completed its initialisation, type exit2shell to drop out to the knoppix shell.
To configure, type the following commands:
# Remove any existing IP configuration and bring up all the interfaces:
ifconfig eth0 0.0.0.0 up
ifconfig eth1 0.0.0.0 up
# Create the Bridge-group interface called br0
brctl addbr br0
# Add each interface to the bridge-group br0
brctl addif br0 eth0
brctl addif br0 eth1
# Set an ip address to the bridge-group br0 for management
ifconfig br0 10.0.160.200 netmask 255.255.255.0
# Add a default Route so that it can be managed from another network
route add default gw 10.0.160.5
Now ping a device on your network to test connectivity.
Type wanem to restart the WANem tool.
To manage the WANem, connect to it via HTTP:
You can also access the Knoppix/Linux level with SSH.
The username is “perc” and the password is what was previously set at the end of the Knoppix boot process.
WANem CLI (Command Line Interface):
The “help” command provides the available commands list:
help — Displays this help.
about — About WANem
clear — Clear the Screen
reset — Reset the network setting and services
shutdown — Shutdown the System
restart — Restart the System
status — Check the status of Network settings and services
wanemreset — Reset WANem settings from here if GUI is very slow
assign — Assign an IPAddress to a device usage:assign
quit — Quit the shell
So as you can see, it so simple to implement and use, and works really well.