Bridge, VM guest gets dhcp but can't ping router

Hi! This might be a total noob question.

I have set up my bridge on Virtualbox (7.0.8 r156879) with VyOS 1.2.9-S1.
set service ssh
set interfaces bridge br0
set interfaces ethernet eth0 bridge-group bridge br0
set interfaces ethernet eth1 bridge-group bridge br0
set interfaces bridge br0 address dhcp

The local network is already set up with dhcp and internet access via the router. I have a bridge in VirtualBox with 1 bridged adapter (using my wifi card) and 1 on the internal net. I have another vyos VM with 1 interface on the internal network just using “set interfaces… address dhcp” and it grabs the a correct address from the local dhcp server.

I can also ping out from my guest VM to my local wifi card address on the local net, my other VM with only a bridged adapter using my wifi card, and my bridge. Pings to the router on the local network fail and same to quad8 or any other local devices I found on the arp table. arp fails to resolve the local domain names for the boxes on the local network that have them, and route shows the router ip.

I’m at a total loss, does anyone know if I’m making any stupid mistakes?

Is this potentially a VirtualBox only problem? I tried VMware but I can’t get it to allow prolific mode so the bridge won’t even work. I’d rather figure out the problem now than not have a clue on the next customer install

I think you have configured it backwards in Virtualbox.

I think what you want to do is to first enable the amount of interfaces you want Virtualbox to expose to the VyOS image - lets say all 4 which is available through GUI (if you want more you must use VBoxManage in the console of the host).

Then configure all these as “bridged” in Virtualbox.

This way your single physical interface (normally if you run this on a desktop) will “switch” the traffic to the 4 virtual interfaces which VyOS will then be able to see.

Then from within VyOS you can configure them as either static address or using dhcp. If you do dhcp then the dhcpserver of your physical network will be used for example the dhcpserver of your broadbandrouter.

1 Like

I’ll try that, thank you!

So it seems bridging between interfaces on the same network crashed my network. Is there another setting that I’m missing? It seems like I want to bridge between separate networks but I have only 1 actual network interface on my computer.

When you are bridging you must verify that you wont cause any IP-conflicts since the interface(s) of VyOS will be directly connected to your network.

Example:

Your gateway in your network use 192.168.1.254/24

Your client (which runs Virtualbox) use 192.168.1.1/24

Then the interfaces of VyOS (who are bridged in Virtualbox) must not use 192.168.1.254 or 192.168.1.1 but any other IP-address is fine lets say 192.168.1.2/24 if you want eth0 of VyOS to reach internet for ntp and updates.

The other interfaces can be configured with for example eth1: 10.0.1.254/24, eth2: 10.0.2.254/24, eth3: 10.0.3.254/24

You connected 2 interfaces in VirtualBox to the same bridge and then in vyos both interfaces connected to another bridge.

You make L2 loop so your network die.

Yeah because bridge will always switch to the physical interface. And having two bridges the way you describe will only work if each goes to a physical interface of the Virtualbox host and they in turn is NOT connected to the same VLAN.

What I think you want to do for both groups or at least for that second group to not cause issues is in Virtualbox go to Host Network Manager and there create one or two Host-only networks.

Then in the VM guest settings within Virtualbox in Network you select “Host-only adapter” and the name you created above as “Attached to”.

This way you can still reach each network from the Virtualbox host (IP of the gateway which is the Virtualbox host itself is defined in the Host Network Manager).

Right. So what I had initially was a bridge to the local network, and an virtual box “internal network” which doesn’t have automatic dhcp.

That should solve the issue of IP conflicts and network loops right?

I don’t actually have 2 physical interfaces I can use as bridged adapters in VirtualBox, or is that the only way?

Thanks!

Depends on what you want to test.

Another method would be to setup as a single bridge and within VyOS you configure each interface with a tagged vlan.

This way these tags are sent out of the physical interface and the switch you connected your host to could configure all these vlans.

For example untagged traffic would be the host itself while tagged 101-104 would be the tagged vlan of VyoS int eth1-4.

If you bridge 2 VyOS interfaces, which are on the same VirtualBox bridge, you create a layer2 loop.
Why do you need to bridge in the 1st place? I’d let let the VM host do the bridging.

Hi sorry for the way late reply. I was told to go practice installing other things, but this is still bugging me.

Tagging the traffic is interesting. I’ll try that, would make sense that the network can’t tell the difference between my host and VM packets through the bridge behind the VirtualBox bridge.

I’m doing this as a bridge solely because I need to practice helping customers with bridges that insist on setting up bridges in their networks. It’s a cruel world haha