0

I'm trying to understand why many Linux (virtual) networking guides attach IP addresses to a bridge device? A physical bridge itself doesn't really have an IP, instead one attaches networks to it and their devices might have IP addresses. What is the logical scenario in which it actually makes sense to give an IP address to a bridge device, say, br0 instead of creating a virtual NIC, say, vnet0, attaching it to br0 and giving vnet0 the IP? Is the idea to have only one IP while connecting to multiple physical switches?

2 Answers 2

0

When you create a bridge in Linux it can automatically create a tap device on that bridge to give your Linux host an interface on that bridge. This is all done transparently when you set an IP address on the bridge itself. If you don't want/need that tap interface just don't give the bridge an IP.

4
  • In other words, this is to get an interface address on the same virtual switch as the VMs on that bridge?
    – JT1
    Nov 10, 2015 at 18:46
  • If the bridge is being used for VMs, then yes.
    – David King
    Nov 10, 2015 at 18:47
  • Thanks, that clarifies this approach. I thought one would have to generate such a tap device your self and connect it to the bridge.
    – JT1
    Nov 10, 2015 at 18:48
  • You certainly can if you need more than one but the use cases for doing bridging in Linux almost always need that tap so the developers just decided to be nice and do the work for you
    – David King
    Nov 10, 2015 at 18:50
0

I don't agree with the answer above.

In Linux world, bridge is a L2 device. And the term bridging actually means that the the bridge keeps a mac address table and keeps updating it. A bridge is allowed to be added to a Ethernet device(e.g eth2). One bad thing is that once eth0 is attached to a bridge(i.e. br0), the ip address of eth0 is no longer accessible. So the ip address of eth0 needs to be assigned to br0 now.

Linux bridge is an abstract of network device. As the ip address is assigned to br0. Now Linux is actually able to track the br0 from L3 - using ip tables or routing tables.

About TAP devices, as far as I know, TAP devices are served as a role talking to the Linux protocol stack from user space. E.g. user pace programs can talk to kernel and make it believe the packets are from another computer using TAP.

You must log in to answer this question.

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