Distroname and release: Debian Stretch

Creating an bridged adapter

brctl vs ip

It seems that brctl cannot do vlan tagging, for which I tend to use the ip package instead if brctl.
brctl is part of bridge-utils
ip is part of iproute2. Lets start by installing required packages.
apt-get install iproute2
We will create an bridge on eth0.
If you are connected through SSH on eth0, you WILL be disconnected, so please have an IRMC,ILO,IMPI or whatever in this case.
Make sure that there is no previously IP attached to this interface.
ifconfig eth0
Create an bridge named br0, and bridge it with eth0
ip link add name br0 type bridge
ip link set dev br0 up
ip link set dev eth0 master br0
Now add network configuration:
auto br0                                                                                                                                                                                                                                        
iface br0 inet static
    hwaddress ether xx:xx:xx:xx:xx:xx 
    bridge_ports eth0
    bridge_stp off 
    bridge_fd 0
Bring the new interface up
ifup br0
Notice, that the IP address should be on br0, NOT eth0.
ip addr show br0
21: br0:  mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet brd scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::ec4:7aff:fe86:a22a/64 scope link
       valid_lft forever preferred_lft forever

Job done

Useful commands

Remove interface from bridge
ip link set dev eth0 nomaster
Destroy bridge
ip link del br0

Do not trust the authors words! POC, tests and experience is key

Copyright LinuxLasse.net 2009 - 2018 All Rights Reserved.

Valid HTML 4.01 Strict Valid CSS!