Home > Articles > Web Development

  • Print
  • + Share This
Like this article? We recommend

Route the Traffic Through WANem

The WAN emulator can be used as an IP router (inserted between your workstation and the rest of the network). In this scenario, no special configuration is needed on your workstation; you just have to configure correct IP routing tables on the WAN emulator.

It's much easier (and less disruptive) to attach the WAN emulator to your LAN through a single Ethernet interface and use software configuration to force the packets to traverse it. The setup on the client computer is simple: You just have to configure a host route toward the server pointing at the WAN emulator.

For example, if you want to insert a 200-millisecond round-trip delay between your Windows workstation and a LAN-attached server (see Figure 2), you should use the following command to force the packets from your workstation to pass the WAN emulator on their way toward the server.

$ route add 192.168.200.1 mask 255.255.255.255 192.168.200.199

To test whether the host route has been installed in the workstation's IP routing table, use the route print command. I would also suggest using an output filter (for example, the find command) to limit the amount of the output, as shown in the following listing:

$ route print | find "192.168.200.1"
  192.168.200.1  255.255.255.255  192.168.200.199 192.168.200.196 1

After the host route has been installed, the packets from the workstation traverse the WAN emulator on their way to the server, but the server still sends the return packets (most of the traffic) directly to the client, thus bypassing the delay introduced by WANem. To force the return traffic to go through the WAN emulator, configure Network Address Translation (NAT) on it with the nat add eth0 command. NAT changes the source IP address of the packets going from the client to the server; the return packets therefore traverse WANem automatically, as shown in Figure 3.

  • + Share This
  • 🔖 Save To Your Account