Configure WANem via PowerShell
If you want to simulate a WAN connection (lower bandwidth, add delay, jitter, etc.) then WANem is a solution that is (relatively) easy to use and free.
Configuring the WAN emulator is done via a webpage, but unfortunately there are no API’s exposed to automate the configuration.
Since I needed to automate the configuration of the WAN emulator I wrote a PowerShell script. You can find the PowerShell scrip below.
Download
Functions
The PowerShell script contains two WANem functions
- WANEmulator_Reset – Resets the configuration (of the optional interface)
- WANEmulator_Set – Sets the specified parameters (for the optional interface)
Usage
WANEmulator_Reset –HostName [-Interface]
- HostName : The hostname of the WANem appliance (FQDN or IP address)
- Interface : The interface to configure (default 0)
WANEmulator_Set –HostName [-Interface]
- HostName : The hostname of the WANem appliance (FQDN or IP address)
- Interface : The interface to configure (default 0)
- PacketLimit : The packet limit (default 1000)
- SymmetricalNetwork : Symmetrical network (Default Yes)
- BandwidthPreset : A preset bandwidhth configuration (Default Other)
- BandwidthSpecify : A bandwidth limit in Kbps (Default 0)
- DelayTime : Delay time in milliseconds (Default 0)
- Etcetera
All items that are configurable in the advanced configuration page of WANem are available as a parameter. The parameters that are shown in a dropbown box, like the bandwidth preset, are presented as an enumerable type. WYSIWYG.
Was once an enthusiastic PepperByte employee but is now working at Citrix. His blogs are still valuable to us and we hope to you too.
Leave a Reply
Want to join the discussion?Feel free to contribute!