简体   繁体   中英

Understanding Virtual Machine IP Address ???? Basics?

Host Machine is Windows 7 and I am using Oracle Virtual Box ( GUEST OS - FEDORA 20). I have enabled bridged connection in between host machine and guest machine. (Did it by selecting bridge connction inside virtual box manager)

Now I am a bit confused about IP addresses.

On my FEDORA guest machine when I do ifconfig. It shows me 2 interfaces. lo (localloop) and p2p1 with an IP address 192.168.0.12. When I use firefox inside fedora is shows me some ip address which is same ip address as my host machine. (I checked using whats my ip address dot com)

Now I have a few questions

a) How come my guest OS and Host OS have same IP address ?

b) From where does interface p2p1 is getting an address 192.168.0.12 ? Is it assigned by my Wifi router ? If yes, then is it possible to do ssh to 192.168.0.12 to reach my virtual machine from other machines connected to same router ? (provided if i enable ssh on my virtual machine)

c) Since it's an bridge network, How can I ssh or telnet my host windows machine from virtual machine ?

When I use firefox inside fedora is shows me some ip address which is same ip address as my host machine.

No. It shows the public IP address of your DSL router which is the same for your host and the virtual machine, as any traffic to the internet is going over the router. You need to understand that first.


When you have enabled "bridged connection" the vm is in the same private subnet as your host machine. The IP address 192.168.0.12 has been assigned by the local DHCP server, which is running on your router.

Since both, the vm and your host computer are in the same network you can ssh into your host computer from the vm using your host computer's IP address, which will be 192.168.0.??? .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM