{"id":3741,"date":"2012-06-11T13:06:23","date_gmt":"2012-06-11T11:06:23","guid":{"rendered":"https:\/\/ingmarverheij.com\/?p=3741"},"modified":"2013-11-30T13:04:49","modified_gmt":"2013-11-30T12:04:49","slug":"configure-wanem-via-powershell","status":"publish","type":"post","link":"https:\/\/ingmarverheij.com\/en\/configure-wanem-via-powershell\/","title":{"rendered":"Configure WANem via PowerShell"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; padding-top: 0px; border-width: 0px;\" title=\"\" alt=\"\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/06\/slow-connection-2.jpg\" width=\"98\" height=\"92\" align=\"left\" border=\"0\" \/><\/p>\n<p>If you want to simulate a WAN connection (lower bandwidth, add delay, jitter, etc.) then <a href=\"https:\/\/wanem.sourceforge.net\/\" target=\"_blank\">WANem<\/a> is a solution that is (relatively) easy to use and free.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/06\/WanEm-Advanced3.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; padding-top: 0px; border-width: 0px;\" title=\"\" alt=\"\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/06\/WanEm-Advanced_thumb2.png\" width=\"204\" height=\"117\" align=\"right\" border=\"0\" \/><\/a>Configuring the WAN emulator is done via a webpage, but unfortunately there are no API\u2019s exposed to automate the configuration.<\/p>\n<p>Since I needed to automate the configuration of the WAN emulator I wrote a PowerShell script. You can find the PowerShell scrip below.<\/p>\n<p><!--more--><\/p>\n<h2 id=\"download\">Download<\/h2>\n<a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"\" href=\"https:\/\/ingmarverheij.com\/en\/download\/5825\/?tmstv=1776451435\" rel=\"nofollow\" id=\"download-link-5825\" data-redirect=\"false\" >\n\tConfigureWanEm.ps1<\/a>\n\n<p><span style=\"font-size: 1.5em;\">\u00a0<\/span><\/p>\n<h2>Functions<\/h2>\n<p>The PowerShell script contains two WANem functions<\/p>\n<ul>\n<li>WANEmulator_Reset \u2013 <em>Resets the configuration (of the optional interface)<\/em><\/li>\n<li>WANEmulator_Set \u2013 <em>Sets the specified parameters (for the optional interface)<\/em><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Usage<\/strong><\/p>\n<p>WANEmulator_Reset \u2013HostName [-Interface]<\/p>\n<ul>\n<li>HostName : <em>The hostname of the WANem appliance (FQDN or IP address)<\/em><\/li>\n<li>Interface : <em>The interface to configure (default 0)<\/em><\/li>\n<\/ul>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/06\/WANEmulator_Reset.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;\" title=\"\" alt=\"\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/06\/WANEmulator_Reset_thumb.png\" width=\"620\" height=\"93\" border=\"0\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>WANEmulator_Set<em>\u00a0<\/em>\u2013HostName [-Interface]<\/p>\n<ul>\n<li>HostName : <em>The hostname of the WANem appliance (FQDN or IP address)<\/em><\/li>\n<li>Interface : <em>The interface to configure (default 0)<\/em><\/li>\n<li>PacketLimit <em>: The packet limit (default 1000)<\/em><\/li>\n<li>SymmetricalNetwork : <em>Symmetrical network (Default Yes)<\/em><\/li>\n<li>BandwidthPreset : <em>A preset bandwidhth configuration (Default Other)<\/em><\/li>\n<li>BandwidthSpecify : <em>A bandwidth limit in Kbps (Default 0)<\/em><\/li>\n<li>DelayTime : <em>Delay time in milliseconds (Default 0)<\/em><\/li>\n<li>Etcetera<\/li>\n<\/ul>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/06\/WANEmulator_Set-Arguments.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;\" title=\"\" alt=\"\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/06\/WANEmulator_Set-Arguments_thumb.png\" width=\"620\" height=\"156\" border=\"0\" \/><\/a><\/p>\n<p>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.<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/06\/WANEmulator_Set-Enumerations.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; margin: 0px 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;\" title=\"\" alt=\"\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2012\/06\/WANEmulator_Set-Enumerations_thumb.png\" width=\"620\" height=\"234\" border=\"0\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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. &nbsp; Configuring the WAN emulator is done via a webpage, but unfortunately there are no API\u2019s exposed to automate the configuration. Since I needed to automate the configuration [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[152],"tags":[455,672,386],"class_list":["post-3741","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-posh","tag-powershell","tag-wanem"],"_links":{"self":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/3741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/comments?post=3741"}],"version-history":[{"count":11,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/3741\/revisions"}],"predecessor-version":[{"id":5886,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/3741\/revisions\/5886"}],"wp:attachment":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/media?parent=3741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/categories?post=3741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/tags?post=3741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}