iproute2mac
iproute2mac copied to clipboard
Bridge management
Simple bridge management in Linux is handled by iproute2 as follow:
$ sudo ip link add name br0 type bridge
$ sudo ip link set dev br0 up
$ sudo ip link set dev eth0 master br0
$ sudo ip link set dev eth1 master br0
To remove an interface from the bridge:
$ sudo ip link set dev eth0 nomaster
In macOS the same result can be obtained with:
$ sudo ifconfig bridge0 create
$ sudo ifconfig bridge0 addm en0
$ sudo ifconfig bridge0 addm en1
And to remove an interface from the bridge:
$ sudo ifconfig bridge0 deletem en0
Bridge interfaces must be named bridge<n>
, otherwise the system will throw an exception:
$ sudo ifconfig br0 create
ifconfig: SIOCIFCREATE2: Invalid argument