Use WANem to create a great adjustable WAN simulator in 10 minutes!

Use WANem to create a great adjustable WAN simulator in 10 minutes!

I thought I’d write something up as I was looking for a WAN simulator tool to pass some VM traffic between to determine impacts on a few scenarios. As I don't have a web site and I'm using VMWare Fusion this seems like a logical place to put it.


Basically this will give you a few subnets with a fake WAN in between which will allow you to; increase latency, added jitter, reduce bandwidth, etc.


I’ve made the following assumptions, which you can change as you see fit -


1. I’m a Mac user so this is written with VMWare Fusion in mind, though Workstation would be pretty much the same

2. LAN 1 has the subnet 10.1.1.0/24 (you can change these or even use IPv6)

3. LAN 2 has the subnet 10.1.2.0/24

4. LAN 3 has the subnet 10.1.3.0/24

5. LAN 4 has the subnet 10.1.4.0/24

6. This VM interfaces will be configured as private (Private to my Mac)

7. VMWare’s DHCP is disabled on private (KB102651)


Okay, lets get started…


We’ll be using WANem - http://wanem.sourceforge.net/


Note that are instructions on the net about setting up WANem but most require you to add default routes on the guest OS’s, I think it’s better to use gateways.


I’m using version 3 beta 2. You’ll need the ISO for this, so download that and unzip it. Create a VM with the following specs -


A. OS - Other Linux 3.x kernel

B. 1 vCPU

C. 256MB of RAM (more might be needed if you're pushing heavy data loads through)

D. 4x NIC’s (less or more is fine, whatever you think you’ll need)

E. IDE HDD with 3GB of space (more might be needed if you intend to push heavy data loads through)

F. Disable as much as possible - audio, BT and USB, Printer, etc.


Attach the ISO to the CD Drive and boot. You’ll notice as it’s booting it won’t find any DHCP and will throw a few errors - thats expected.


Once it’s started you should be presented with a web browser and the Network Connections configuration page. Close that page and the browser.


Click on the icon to the bottom left, select Preferences, WANem HD Install. Click Accept through the next few windows.


Select Disk use whole hard disk. Select the disk which should be around 3GB and OK. Select Yes and let it install. You should get a good message. You’ll be asked to select a disk again, select the top item which should be /dev/sda2 with around 2GB of space and click OK. It should now be installing.


Next up you’ll be prompted to configure the boot loader grub. Click OK. Go with the default top option mbr and click OK. Click Yes to install. Click OK to the success message and finally click Yes to restart.


Do as it says - disconnect the CD ISO image and hit return.


Once WANem restarts you’ll be at the WANem prompt. At this point WANem is installed, any configuration changes you make will now stick where as before you were booting a LiveCD and each reboot would see the settings lost.


Almost there.


Type startx and press enter to get the GUI back.


Once the GUI starts you should be back to the web browser and Network Connections.


Click eth0 then click edit. Select the IPv4 (or v6) settings, change Method to Manual. Click add and enter 10.1.1.1 and press return. Being a class A address it will assume a /8 subnet mask, double click 8 and make it 24 then press return. Now click save.


Do the same for eth1, eth2 and eth3 using 10.1.2.1/24, 10.1.3.1/24 and 10.1.4.1/24. Close the Network Connections page.


Now would be a good time to shutdown and create a snapshot or copy the VM to a safe backup location. To shutdown select the icon in the bottom right.


Once it’s rebooted (or continuing on from above without a reboot) select Basic Mode in the web browser. As you can see here you can set the WAN speed and network delay for each interface or as you can think of them now virtual WAN links. You can also go more in depth in the Advanced Mode tab.


I’ll leave the rest up to you. From this point when you boot the VM it will start in a CLI, you can startx but you can also make changes using “help” but it’s easier in the GUI. For those advanced users keep an eye on top and swap usage and increase RAM as needed. For those who are worried about pushing big data loads through WANem simply give it a bit more RAM, at 128MB it does swap a little but at 256MB I haven't see it swap so 512MB would be very safe.


So now when you build a VM in one of those subnets you use the 10.1.x.1 IP as the gateway and adjust it’s WAN performance however you like.


Hope that helps anyone who’s after a lean WAN emulator that works really well. Thanks to TATA Consulting Services who make WANem, all credit to them for the great distro.


If I’ve made any mistakes let me know and I’ll update this post.


Cheers.

Comments

Thanks, interesting even in 2019, to watch for RAM demands..

Version history
Revision #:
1 of 1
Last update:
‎05-03-2014 04:21 AM
Updated by: