WAN Emulator - Single NIC
I have a handful of Linux/Windows VMs that I'd like to use to simulate a WAN (with bandwidth caps and latency introduced artificially).
To keep things simple, let's say I have three boxes:
VM A: SuSE, "web client" (192.168.1.100)
VM B: SuSE, "web server" (192.168.1.101)
VM C: SuSE, "router" (192.168.1.102)
I want to route all traffic that goes between A and B through C, and then set up the latency/bandwidth using 'tc' running on C. I would therefore set:
VM A: (192.168.1.100)
ip route add 192.168.1.101/32 via 192.168.1.102 dev eth0 metric -1
VM B: (192.168.1.101)
ip route add 192.168.1.100/32 via 192.168.1.102 dev eth0 metric -1
VM C: (192.168.1.102)
// enable ip forwarding
I'm using a metric of -1 because the default route has a metric of 0.
A traceroute shows the first hop going through VM C as expected. A tcpdump on VM C shows something going through it, but not the data I'm expecting. (I'm accessing a website, but not seeing anything that looks like the expected content.) If I do a continuous ping, I see a few packets at the beginning, and then nothing else.
Is there something I'm missing here, or should it work? I only have one NIC on each VM.
Thanks!!
|