Skip to contentSkip to conversation

Network problem with bridge and virtualbox

DISCUSSION William Thompson 3 participants 5 messages Sep 29, 2011 – Oct 3, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Please keep me in the CC as I am not subscribed.

I'm using a 64-bit kernel 3.0.0 and virtualbox 4.1.2.

My problem is that I cannot ping the host from a virtual machine.

My bridge is configured as follows:

# brctl addbr br0
# brctl setfd br0 0
# brctl stp br0 off
# ifconfig br0 10.2.3.1 netmask 255.255.255.0

In the virtual machine, it is set to use br0 as it's interface (bridge mode) and it's IP is 10.2.3.10.

The host gets packets from the vm, but the vm does not receive packets back.

I have this same setup working on a 32-bit kernel 2.6.38.6 on another machine with virtualbox 4.0.4.

I had a thought that the bridge on the host wasn't responding due to having no ports configured so I added one of my spare ethernet cards to it as follows:

# brctl addif br0 eth1
# ifconfig eth1 up

The card was plugged into a switch. After doing this, the vm still could not talk to the host. I added a physical machine to the switch that eth1 was connected to and configured it to 10.2.3.2. I was able to ping 10.2.3.2 but not 10.2.3.1

#1 lore raw
Quoted 6 lines · William Thompson

Please keep me in the CC as I am not subscribed.

I'm using a 64-bit kernel 3.0.0 and virtualbox 4.1.2.

My problem is that I cannot ping the host from a virtual machine.

Quoted 8 lines

My bridge is configured as follows:

# brctl addbr br0
# brctl setfd br0 0
# brctl stp br0 off
# ifconfig br0 10.2.3.1 netmask 255.255.255.0

In the virtual machine, it is set to use br0 as it's interface (bridge mode) and it's IP is 10.2.3.10.

Why do you use bridge with VirtualBox?

VirtualBox provide several network modes, which remove the need for bridge on the host.

One of Bridged Network mode (using eth0), Internal Networking mode or Host-only Networking mode may suit your need well, without having to use a bridge.

Nicolas.

#2 lore raw
Quoted 16 lines · Nicolas de Peslo?an

Le 29/09/2011 14:49, William Thompson a ?crit :

Quoted 6 lines

Please keep me in the CC as I am not subscribed.

I'm using a 64-bit kernel 3.0.0 and virtualbox 4.1.2.

My problem is that I cannot ping the host from a virtual machine.

Quoted 8 lines

My bridge is configured as follows:

# brctl addbr br0
# brctl setfd br0 0
# brctl stp br0 off
# ifconfig br0 10.2.3.1 netmask 255.255.255.0

In the virtual machine, it is set to use br0 as it's interface (bridge mode) and it's IP is 10.2.3.10.

Quoted 7 lines

Why do you use bridge with VirtualBox?

VirtualBox provide several network modes, which remove the need for bridge on the host.

One of Bridged Network mode (using eth0), Internal Networking mode or Host-only Networking mode may suit your need well, without having to use a bridge.

I originally set this up as a hostonly (and routed) network. The bridge has no other interfaces added to it. I know virtualbox has hostonly builtin, but I did not want to use it's limited DHCP server and this was the only solution I came up with at the time. Due to the way the vboxnet interfaces are dynamically created, I didn't have a way at the time to start programs on that interface when it came up.

#3 lore raw
In reply to William Thompson
Quoted 23 lines · On Thu, 29 Sep 2011 08:49:41 -0400 William Thompson…

Please keep me in the CC as I am not subscribed.

I'm using a 64-bit kernel 3.0.0 and virtualbox 4.1.2.

My problem is that I cannot ping the host from a virtual machine.

My bridge is configured as follows:

# brctl addbr br0
# brctl setfd br0 0
# brctl stp br0 off
# ifconfig br0 10.2.3.1 netmask 255.255.255.0

In the virtual machine, it is set to use br0 as it's interface (bridge mode) and it's IP is 10.2.3.10.

The host gets packets from the vm, but the vm does not receive packets back.

I have this same setup working on a 32-bit kernel 2.6.38.6 on another machine with virtualbox 4.0.4.

I had a thought that the bridge on the host wasn't responding due to having no ports configured so I added one of my spare ethernet cards to it as follows:

Quoted 7 lines
# brctl addif br0 eth1
# ifconfig eth1 up

The card was plugged into a switch. After doing this, the vm still could not talk to the host. I added a physical machine to the switch that eth1 was connected to and configured it to 10.2.3.2. I was able to ping 10.2.3.2 but not 10.2.3.1

Did you add any interface to the bridge?
I think you were bit by the change in carrier behavior. No carrier on the bridge interface tracks the union of the devices in the bridge. Several people have been using bridge in strange way (as a dummy device) with no physical interfaces and some applications are checking for carrier.

#4 lore raw
Quoted 29 lines · Stephen Hemminger
Quoted 26 lines · On Thu, 29 Sep 2011 08:49:41 -0400 William Thompson…

Please keep me in the CC as I am not subscribed.

I'm using a 64-bit kernel 3.0.0 and virtualbox 4.1.2.

My problem is that I cannot ping the host from a virtual machine.

My bridge is configured as follows:

# brctl addbr br0
# brctl setfd br0 0
# brctl stp br0 off
# ifconfig br0 10.2.3.1 netmask 255.255.255.0

In the virtual machine, it is set to use br0 as it's interface (bridge mode) and it's IP is 10.2.3.10.

The host gets packets from the vm, but the vm does not receive packets back.

I have this same setup working on a 32-bit kernel 2.6.38.6 on another machine with virtualbox 4.0.4.

I had a thought that the bridge on the host wasn't responding due to having no ports configured so I added one of my spare ethernet cards to it as follows:

# brctl addif br0 eth1
# ifconfig eth1 up
Quoted 6 lines
Quoted 4 lines

The card was plugged into a switch. After doing this, the vm still could not talk to the host. I added a physical machine to the switch that eth1 was connected to and configured it to 10.2.3.2. I was able to ping 10.2.3.2 but not 10.2.3.1

Did you add any interface to the bridge?

Initially, no.

Quoted 4 lines

I think you were bit by the change in carrier behavior. No carrier on the bridge interface tracks the union of the devices in the bridge. Several people have been using bridge in strange way (as a dummy device) with no physical interfaces and some applications are checking for carrier.

That's how I have been using it.

Using it as a dummy, ie no interfaces added to the bridge, on 3.0.0 I was unable to communicate with the host from the VM. I added eth1 to it. This has a link to a physical network. I assigned IPs to the host and the VM to be on the same network that eth1 was attached. From the VM I could communicate with devices on the physical network but not the host. The host could also communicate with the other devices.