How to make the IP address of the virtual window the same as my base

I have Windows7 as the base operating system. In addition, I installed Virtual Box with Ubuntu. I want ubuntu to get the same IP address as my base os (Win7). How do I achieve this? Any idea?

Thank you, Sauraby.

+4
source share
2 answers

You cannot have the same IP address and expect to be able to communicate. How do packages know where to go?

If you are saying that your host and guest seem to have the same IP address for the outside world, you simply establish a network connection as NAT, not a bridge.

This will translate the network addresses on the host, mainly using the host to route packets and change the source and destination details in them.

+1
source

Oh yes you can! Just like you are installing the server behind the router / firewall. paxdiablo was right. If the host and guest (s) have the same port, the TCP / IP stack does not know where to send the packet. But if you have only a guest server that processes a specific port, which becomes nothing, just move the host port to the guest port (exactly the same as you need to do when configuring the router).

In my case, I run VirtualBox on Win7 and have a guest on which the linux distribution is running. Only the linux distribution runs WebGUI, so the network parameter I used was NAT. Then the interesting part comes in, according to the NAT option, select "Port Forwarding". From there, you can add the host IP (192.168.1.123) and the guest IP (10.0.2.15 in my case), but it has port 80 from the host to guest port 80. It works like magic! You will need to do this for each port that your guest listens to.

If you have more than one guest listening on the same port (for example, 80), you will have to assign a different port from the host and forward it to the guest. (for example: 8080 from host to port 80 of guest # 2 IP) Any external devices that connect to guest 2 will be located at http://192.168.1.123:8080 .

You can now have (almost) as many guests who use the same IP address. Hope this helps.

Jim Chan

0
source

All Articles