NAT or bridged networking?

Discussions about using Windows guests in VirtualBox.
Post Reply
Krischu
Posts: 41
Joined: 8. Apr 2016, 10:43

NAT or bridged networking?

Post by Krischu »

I took an already running VM that ran under Hyper-V, kloned it using VMWare vCenter Converter Standalone, did an OVF export from VMWARE-Workstation and imported the image into VirtualBox using that OVF export.

Anyway, so far, so good. I changed/stopped services (apache and tomcat) that were running on that machine and installed an Oracle database
to give it another designation. Network was NAT and I mapped the port 1521:1521 to have it available on the outside. I believe, internally the guest's address was 192.168.99.100.

A day or two all went fine until someone was claiming that the webserver that was running on the machine, the image had been cloned from,
was unreachable. It is an intranet server, not that severe but anyway, a while I was wondering why the intranet server was reachable from my notebook but not from other colleagues desktop.

It seemed to be that my colleagues were accessing the guest from the company network (which didn't run the apache service any longer).

Then it came to me that it could be that I didn't change the MAC-Address of the guest and found the button in the settings where one can change the MAC. Is this a random MAC address that is generated there?

How can I assure that the cloned VM doesn't any longer "reincarnate itself" as being the former Webserver it had been cloned from?
Should I change the hostname also?

Most desirable for me would be that the guest is "hidden" within the host and it's name doesn't appear in the company LAN at all.
At most mapping the database server port to the outside.


Now you :)

--
Christoph
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: NAT or bridged networking?

Post by mpack »

Krischu wrote:I believe, internally the guest's address was 192.168.99.100.
Not with NAT it wasn't. It would have a private network address in the 10.x.x.x range, as all comms have to pass through the server process on the host.

VMs behind a NAT interface are always unreachable. That's one of the features of a NAT interface (automatic firewall). You can only work around it by designating port forwarding rules.

NAT is fine for basic browsing from inside a VM. However a server usually needs more, i.e. it needs bridged networking. Then the VM is a peer on whatever physical network the host PC is attached to. At that point you need to make sure there are no MAC conflicts.

The IP address (not the MAC address) should IMHO never be your concern. Many newbies make it their concern unnecessarily, they overthink it. You should just configure the VM as a DHCP client (i.e. acquire IP addresses automatically), and let it do its thing regardless of what type of networking is configured.
Krischu
Posts: 41
Joined: 8. Apr 2016, 10:43

Re: NAT or bridged networking?

Post by Krischu »

mpack wrote:
Krischu wrote:I believe, internally the guest's address was 192.168.99.100.
Not with NAT it wasn't. It would have a private network address in the 10.x.x.x range, as all comms have to pass through the server process on the host.

VMs behind a NAT interface are always unreachable. That's one of the features of a NAT interface (automatic firewall). You can only work around it by designating port forwarding rules.

NAT is fine for basic browsing from inside a VM. However a server usually needs more, i.e. it needs bridged networking. Then the VM is a peer on whatever physical network the host PC is attached to. At that point you need to make sure there are no MAC conflicts.

The IP address (not the MAC address) should IMHO never be your concern. Many newbies make it their concern unnecessarily, they overthink it. You should just configure the VM as a DHCP client (i.e. acquire IP addresses automatically), and let it do its thing regardless of what type of networking is configured.
Thanks. Actually I only need port 1521 to be visible from the outside making the host look like it is offering port 1521.
All the rest should be hidden within the host.

Sorry. I was wrong about the guest's IP (that is 10.0.2.15 right now) and the mapping looks like

Code: Select all

Name   Protokoll Host-IP     Host-Port  Gast-IP       Gast-Port
Oracle TCP       127.0.0.1   1521       10.0.2.15     1521
Though it seemed like the guest addressed itself in the company network (or it was a relict from a couple of days before when I played with bridged networking). Anyway, the problem went away, when I did an

Code: Select all

ipconfig /flushdns
on the affected Windows hosts.

--
Christoph
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: NAT or bridged networking?

Post by BillG »

If you had it set to bridged, it would indeed get its IP from the DHCP server on the physical network.
Bill
Post Reply