Virtual Box and network configuration

Discussions related to using VirtualBox on Windows hosts.
Post Reply
JohnnhoJ
Posts: 1
Joined: 13. May 2021, 10:11

Virtual Box and network configuration

Post by JohnnhoJ »

Dear All,

I am a little confused as to what options should I chose regarding a virtual machine on which a virtual router will run (namely Mikrotik Router OS) .

I am running Virtual Box on a remote dedicated server with a static public IP address. There is no DHCP running on that setup from the provider (I do have an extra static public IP address from the provider, that is linked with that Windows Server 2019 machine) .

I read a lot of information stating to use bridge mode on VM in network configuration, however my understanding is that in this case the VM will take a second IP address (as if it was physically connected on a DHCP server running on a regular ISP modem), like I mentioned there is no DHCP server running in my setup, only one static Public IP address (with the addition of a second one).

This is what I am looking to do (if anyone is familiar with Mikrotik, it will help) : To run a DHCP server on that VM so I can hand out (internet reachable) LAN IP to the virtual Mikrotik router. In other words I am looking to have the Virtual Box operate as a regular ISP DHCP modem/router.

I also need to be able to forward some ports to that VM router, so open some ports on Windows Firewall e.g. port 4000 and then have Virtual Box forward that port, to the whatever LAN address virtual box give out the the virtual router, e.g. 192.168.100.10

I have done the above on physical machines that are behind an ISP modem / router , but not on a dedicated server.

Any ideas / help will be much appreciated!
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Virtual Box and network configuration

Post by mpack »

JohnnhoJ wrote:however my understanding is that in this case the VM will take a second IP address (as if it was physically connected on a DHCP server running on a regular ISP modem)
I'm not sure where you got that idea from.

Bridged mode makes the VM a full participant in the physical Ethernet network you bridge it to. In effect it installs the software equivalent of a network switch to allow host and VM to share a cable. The VM has exactly the same capabilities (or not) as any other PC would on the physical network. For example, if there's no DHCP server then the VM will not get an IP address. If you assign a static IP address then the VM will use it (actually, that's between you and the guest software). If you install a DHCP server on the VM then it could serve as "the" DHCP server for the network. If you install MikroTik RouterOS then it should behave exactly as it would on any other x86 PC with Ethernet NICs.

Naturally, most of the answers on these forums discuss a typical setup, e.g. a home or business network which includes a router with DHCP enabled, because that's what the questioner was using. However I feel that the actual basic function of bridged networking is explained quite well in the user manual (section 6.5).

p.s. There is no "port forwarding" in bridged mode. As already mentioned, bridged makes the VM a full network participant, there is no middle man deciding what comms the VM can and can't see.
Post Reply