0

I'm trying to understand somethings.

General Part:

I'm new on this area and I saw a video of a phisical network that told that a bridge connects two networks and knows if certain host is on the A side or the B side. But:

How this works with virtual machines and/or containers?

Why if you set a VirtualBox Windows and set it to Bridge Mode it gets an IP on the Local Network, like, where is the bridge device? How is my NIC acting as a bridge device if it is using the internet?

Edit:

To understand better the answer, I reccommend seing:

  • this post to understand how VirtualBox driver works
  • this post to undestand how VirtualBox basic bridge flow works
  • this post to understand why most Wi-Fi adapters can't really bridge
Kobra
  • 349

1 Answers1

1

The second half you've already posted in a separate thread yesterday, so I'll only answer the first half for now:

I'm new on this area and I saw a video of a phisical network that told that a bridge connects two networks and knows if certain host is on the A side or the B side.

Specifically, the term is used for "local" networks like Ethernet – and fully understanding its purpose probably needs remembering how old-style CSMA/CD Ethernet worked. When all hosts were connected to the same coax cable, all of them would physically receive everything from everyone else; a bridge would be used to partition such an ethernet in half.

In modern use, every Ethernet switch is a bridge and each port is its own "side", with the switch keeping track of whether a certain host is on port 1, port 2, or port 3 – but the actual term 'bridge' usually refers to software implementations (e.g. Linux virtual bridge interfaces) rather than switches.

Why if you set a VirtualBox Windows and set it to Bridge Mode it gets an IP on the Local Network, like, where is the bridge device?

Inside VirtualBox. It has an internal implementation of the full MAC bridging logic (i.e. a virtual Ethernet switch), which considers each VM to be a separate port and the physical NIC to be another port. This is not really made visible anywhere in the GUI, but it's there in the source code and is used for several of its network modes.

(It also has a full internal implementation of an IP router, which is used for its "NAT" mode.)

How is my NIC acting as a bridge device if it is using the internet?

The NIC is not acting as a bridge device in either case. It is acting more like a port of the bridge.

But in the case of VirtualBox, the rest of the system is unaware of the bringing being done; the additional "bridge driver" that VirtualBox installs will grab a copy of all Ethernet packets before the host OS gets to evaluate them, meaning that the host OS still only looks at packets directed to its MAC and ignores the rest, as before.

(Aside from that: a bridge can participate in the network it's bridging; it just needs to have an additional port internally. For example, an 8-port managed switch would really have 9 ports: eight physical, the ninth wired up internally to its management CPU.)

grawity
  • 501,077