13

Shouldn't bridge (or a switch) be working without having an IP address? I believe I can have a bridge br0 setup with eth0 and eth1 as members both having no IP addresses.

I can't understand why an address should be allocated to br0?

Kevdog777
  • 3,194
  • 18
  • 43
  • 64
Vinay Kumar
  • 133
  • 1
  • 5

1 Answers1

18

A bridge does not need an IP address to function. Without one it will just perform layer 2 switching, spanning tree protocol and filtering (if configured).

An IP address is required if you want your bridge to take part in layer 3 routing of IP packets.

As an example you can setup a bridge without an IP address in Debian/Ubuntu using the following in /etc/network/interfaces

auto br0
iface br0 inet manual
         bridge_ports eth0 eth1
Richm
  • 3,812
  • 23
  • 15
  • Second sentence answers my question. Remove the remaining part and I'll accept that as an answer. – Vinay Kumar Sep 02 '14 at 10:15
  • 2
    I am a little reluctant to trim all but the 2nd sentance. The first sentence answers the first line of your question. Admittedly the way to setup an IP-less interface on Debian/Ubuntu is only mildly related to your question so that could likely be deleted if considered too off-topic. – Richm Sep 02 '14 at 14:17
  • Does this mean if the interfaces on the bridge want to access host network or the internet, then the bridge must have an IP address? So effectively this turns the bridge into a layer 3 device (like a router)? – stackoverflower Jun 22 '17 at 22:36