0

I have a local vagrant virtual machine running ubuntu and apache (lamp stack). On the host machine, I make request to the VM by accessing host defined /etc/hosts and vagrant configuration. Now on the virtual machine, all the request coming from my host machine shows they're coming from the same IP address. The IP for my vagrant box is defined in config.json "ip": "192.168.44.44",. On the virtual machine, all the requests in the apache access log show they're coming from "ip": "192.168.44.1", How do I send http request from my host machine to the virtual machine using some sort of a local proxy in order to simulate users coming from different terminals?

5
  • Why do you believe it matters if you have multiple clients from multiple clients? If each instance of the browser is in its own vagrant box it shouldn't matter.
    – Ramhound
    Commented Jan 3, 2017 at 22:19
  • Trying to test a voting application that uses hostname and ip addresses to filter & validate votes. So to test stuff locally I would like to do the same. I am not sure if this answer your question.
    – Ali
    Commented Jan 3, 2017 at 22:34
  • You do realize that its trivial to change the hostname of a system right? What wil you do about the clients that have an ISP that use a single IP address for multiple customers? in other words multiple hosts with the same ip address.
    – Ramhound
    Commented Jan 3, 2017 at 22:42
  • Yup, I understand the single IP address. But now I am testing it as is for other reasons that deal with caching .. one step at a time. how do I change hostname?
    – Ali
    Commented Jan 3, 2017 at 22:57
  • Also, I don't think it;s possible with my set up. This has to do with the gatway assigned by virtualbox. but I thought perhaps there are other ways to simulate one server/muli client setup on a local development env.
    – Ali
    Commented Jan 3, 2017 at 23:11

1 Answer 1

0

Is your host machine Windows or Linux? You can try using iptables srcnat and dstnat rules to masquarade incoming traffic on Linux. Not much possible on Windows though you can try the same on VM too using input chain.

Take a look here maybe it will help.

Regards.

1
  • You really should bring some of the information from that linked document into your answer, because as it is currently written, it provides very little of an actual answer. Perhaps some details on how to use SRCNAT or an Input Chain. Commented Feb 9, 2017 at 18:46

You must log in to answer this question.

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