0

I am trying to test an application running in windows 7, and I would like to send the packets it generates to a server VM (I am using virtualbox) on the local machine which will act as a simulation for when packets will be really sent over the internet to a distant server.

I need to check for correctness of the packets in certain situations. Is there a way on windows to take packets produced by an application and instead of passing it to my router, pass it along to another process, i.e. My virtual machine.

I'd prefer not to change any of the code on my application and would rather find an outside solution. Is there such a solution for windows 7?

3
  • Packets go where they go based on the destination IP address. If the application sends packets to the IP address of your VM, then they will get routed there rather than to the internet. Are you saying you want packets destined for any IP address to be routed to the IP address of your VM, provided they come from the application?
    – Paul
    Nov 25, 2011 at 0:02
  • No, just one address. So if I just set the IP address of the vm to the desired one windows will automatically send the packets to it instead of the internet?
    – user836045
    Nov 25, 2011 at 0:07
  • "Are you saying you want packets destined for any IP address to be routed to the IP address of your VM, provided they come from the application?" Although, this would also be satisfactory, my application may later interact with multiple servers, so yes.
    – user836045
    Nov 25, 2011 at 0:09

1 Answer 1

1

If you can carry out your testing with your application interacting with a single IP address, then have it talk directly to the VM IP address, and windows will route this traffic automatically without you needing any complex application based routing.

If you want to simulate multiple servers down the line, the best way you can do this is to have multple VMs running on different IP addresses and again Windows will route to the right VM based on the IP the app is talking to.

You could even set up multiple IP addresses on a single VM to "sort of" simulate the multiple destinations scenario but with a single VM.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .