.. _bridge-interface: ###### Bridge ###### A Bridge is a way to connect two Ethernet segments together in a protocol independent way. Packets are forwarded based on Ethernet address, rather than IP address (like a router). Since forwarding is done at Layer 2, all protocols can go transparently through a bridge. The Linux bridge code implements a subset of the ANSI/IEEE 802.1d standard. .. note:: Spanning Tree Protocol is not enabled by default in VyOS. :ref:`stp` can be easily enabled if needed. Configuration ############# Common interface configuration ------------------------------ .. cmdinclude:: ../_include/interface-common-with-dhcp.txt :var0: bridge :var1: br0 Member Interfaces ----------------- .. cfgcmd:: set interfaces bridge member interface Assign `` interface to bridge ``. A completion helper will help you with all allowed interfaces which can be bridged. This includes :ref:`ethernet-interface`, :ref:`bond-interface`, :ref:`l2tpv3-interface`, :ref:`openvpn`, :ref:`vxlan-interface`, :ref:`wireless-interface`, :ref:`tunnel-interface` and :ref:`geneve-interface`. .. cfgcmd:: set interfaces bridge member interface priority Configure individual bridge port ``. Each bridge has a relative priority and cost. Each interface is associated with a port (number) in the STP code. Each has a priority and a cost, that is used to decide which is the shortest path to forward a packet. The lowest cost path is always used unless the other path is down. If you have multiple bridges and interfaces then you may need to adjust the priorities to achieve optimium performance. .. cfgcmd:: set interfaces bridge member interface cost Path `` value for Spanning Tree Protocol. Each interface in a bridge could have a different speed and this value is used when deciding which link to use. Faster interfaces should have lower costs. .. _stp: STP Parameter ------------- :abbr:`STP (Spanning Tree Protocol)` is a network protocol that builds a loop-free logical topology for Ethernet networks. The basic function of STP is to prevent bridge loops and the broadcast radiation that results from them. Spanning tree also allows a network design to include backup links providing fault tolerance if an active link fails. .. cfgcmd:: set interfaces bridge stp Enable spanning tree protocol. STP is disabled by default. .. cfgcmd:: set interfaces bridge forwarding-delay Spanning Tree Protocol forwarding `` in seconds (default: 15). Forwarding delay time is the time spent in each of the Listening and Learning states before the Forwarding state is entered. This delay is so that when a new bridge comes onto a busy network it looks at some traffic before participating. .. cfgcmd:: set interfaces bridge hello-time Spanning Tree Protocol hello advertisement `` in seconds (default: 2). Periodically, a hello packet is sent out by the Root Bridge and the Designated Bridges. Hello packets are used to communicate information about the topology throughout the entire Bridged Local Area Network. Additional Bridge Options ------------------------- .. cfgcmd:: set interfaces bridge aging