0

I configured bridged networking in my VirtualBox, but my router is only showing 1 device connected. When a guest OS(Ubuntu) boots up, the router shows that the guest IP address connected. When I shutdown VirtualBox the router shows that the host(Windows) IP address is connected. I want both devices connected to show up on the router simultaneously to do port forwarding.

2
  • 1
    Are you trying to use bridged networking with Wi-Fi? Commented Oct 31, 2020 at 11:11
  • Yes I am usin wifi for bridged networking
    – RazaHaider
    Commented Oct 31, 2020 at 11:16

1 Answer 1

1

The problem is partially caused by Wi-Fi, and partially by your router being silly.

  • Your router tries to list devices according to the MAC addresses it sees, together with whatever IP address was seen active from that MAC address most recently. It doesn't know that a host is allowed to have multiple IP addresses.

    (Its firmware was most likely built with the assumption that the owner won't do any advanced networking whatsoever – no bridging, no routing, no VMs, just a basic computer or two. I've had a D-Link ADSL modem exactly like that.)

  • Wi-Fi isn't exactly like Ethernet – it cannot be fully bridged, because a connected client is only allowed to have one MAC address. (The same MAC address field in the Wi-Fi header is used for two purposes – it's also used to keep track of the physical connection or "association" to the access point.)

    In order to make "Bridged networking" work with Wi-Fi, VirtualBox has to hide your VMs' MAC addresses and replace them with the host's (in other words, it literally performs MAC-layer NAT).

    This means your router sees both the host and the VM as a single MAC address and assumes it's actually a single device.

Fortunately, "port forwarding" is entirely IP-layer and should not care about MAC addresses. So as long as your host and your VM have different (and static) IP addresses, you should still be able to configure port forwarding. If the router forces you to select a device from the list, you can:

  1. Boot the VM, so that it shows up in the router's list
  2. Configure port forwarding to the VM
  3. Shut down the VM and wait for the host to re-appear in the router's list
  4. Configure port forwarding to the host

But normally the router should allow you to enter the IP address by hand (instead of selecting the device from the list), which would avoid the problem completely.

(I would really prefer getting a better router that doesn't do silly things.)

1
  • I will try this trick and will let you know. But my router shows the list of currently connected devices with mac address to do port forwarding. It will show only one at a time when VirtualBox guest is running. This means on wifi I cannot do work(related to port forwarding) on host when VirtualBox guest is on.
    – RazaHaider
    Commented Oct 31, 2020 at 12:12

You must log in to answer this question.

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