VMware Cloud Community
Clarkington
Enthusiast
Enthusiast
Jump to solution

Netem VM between two VMs? Is this possible?

Hello,

I'd like to use netem on a linux VM between two other VMs to simulate latency. Netem needs a device with two NICs that it can bridge between. I've set up one VM on vSwitch0, one VM on vSwitch1, and then another VM with two NICs, one on each vSwitch. I was thinking I'd create that box for Netem use and then emulate between the two.

Has anyone ever done anything like this? I've ran into a ton of problems and want to know if people have tried it.

0 Kudos
1 Solution

Accepted Solutions
Clarkington
Enthusiast
Enthusiast
Jump to solution

I got this working by doing the following:

1. create VM a with a NIC on vSwitch0

2. create VM b with a NIC on vSwitch1

3. create VM n with a NIC on vSwitch0 and vSwitch1

4. Set the port groups for vSwitch0 and 1 to promiscuous mode accept (from default of reject)

5. configure VM n, a centOS VM, for a bridged interface using both NICs

Note: the NICs in VM a and VM b were in the same subnet.

After completing step 5 everything starting working and traffic passed between VM a and b through VM n. I experienced a solid 5ms delay on ping where there was a <1 ms delay on ping when VM a and b were on the same vSwitch. I came in the next day and the delay was gone. No idea why.

Since all the bridging and netem stuff is default in the CentOS 6.4 install, I was able to set conditions like delay and packet loss on the VM n and traffic between VM a and b degraded as desired.

The reason I wanted this to be complicated like this is I can take a VM from vSwitch 0 and pop it in vSwitch1 and all of a sudden traffic to and from it experiences degradation due to the conditions imposed by the bridge VM n's Netem configuration.

View solution in original post

0 Kudos
2 Replies
OscarDavey
Hot Shot
Hot Shot
Jump to solution

Since netem provides Network Emulation functionality for testing protocols i am sure you will have some incompatibility problems , but its solvable , just configuration and some tricks , let me know if you are facing a problem setting this up , still would like to know why would you do that ? you are making it kind of complicated tho .. just my 2 cents .

Best regards

Yours, Oscar

0 Kudos
Clarkington
Enthusiast
Enthusiast
Jump to solution

I got this working by doing the following:

1. create VM a with a NIC on vSwitch0

2. create VM b with a NIC on vSwitch1

3. create VM n with a NIC on vSwitch0 and vSwitch1

4. Set the port groups for vSwitch0 and 1 to promiscuous mode accept (from default of reject)

5. configure VM n, a centOS VM, for a bridged interface using both NICs

Note: the NICs in VM a and VM b were in the same subnet.

After completing step 5 everything starting working and traffic passed between VM a and b through VM n. I experienced a solid 5ms delay on ping where there was a <1 ms delay on ping when VM a and b were on the same vSwitch. I came in the next day and the delay was gone. No idea why.

Since all the bridging and netem stuff is default in the CentOS 6.4 install, I was able to set conditions like delay and packet loss on the VM n and traffic between VM a and b degraded as desired.

The reason I wanted this to be complicated like this is I can take a VM from vSwitch 0 and pop it in vSwitch1 and all of a sudden traffic to and from it experiences degradation due to the conditions imposed by the bridge VM n's Netem configuration.

0 Kudos