[donotprint]
Tutorial details | |
---|---|
Difficulty | Intermediate (rss) |
Root privileges | Yes |
Requirements | OpenBSD v2.5+ |
Time | 10m |
How do I setup bridge0?
Create a file called /etc/hostname.bridge0, enter:
# vi /etc/hostname.bridge0
Append the following interface names:
add vr0 add vr1 add vr2 add vr3 add rl0 up
Save and close the file. This is saying set up a bridge consisting of the five NICs, vr0, vr1, vr2, vr3, and rl0 and activate it. The order the cards are listed does not matters. Make sure each NICs is configured as per your requirements:
# cat /etc/hostname.vr0
Sample outputs:
up media autoselect
The rest of the config:
# cat /etc/hostname.vr1
up media autoselect
# cat /etc/hostname.vr2
up media autoselect
# cat /etc/hostname.vr3
up media autoselect
However, NIC rl0 has static IP address configuration as follows:
# vi /etc/hostname.rl0
Sample outputs:
inet 192.168.1.254 255.255.255.0 192.168.1.255
Save and close the file. Reboot the server to test new settings:
# reboot
Verify new switch settings:
# ifconfig bridge0
Sample outputs:
bridge0: flags=41<UP,RUNNING> groups: bridge priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp designated: id 00:00:00:00:00:00 priority 0 run0 flags=3<LEARNING,DISCOVER> port 8 ifpriority 0 ifcost 0 vr3 flags=3<LEARNING,DISCOVER> port 4 ifpriority 0 ifcost 0 vr2 flags=3<LEARNING,DISCOVER> port 3 ifpriority 0 ifcost 0 vr1 flags=3<LEARNING,DISCOVER> port 2 ifpriority 0 ifcost 0 vr0 flags=3<LEARNING,DISCOVER> port 1 ifpriority 0 ifcost 0 rl0 flags=3<LEARNING,DISCOVER> port 5 ifpriority 0 ifcost 0 Addresses (max cache: 100, timeout: 240): 74:44:01:40:57:fb vr0 0 flags=0
To see rl0 config:
# ifconfig rl0
References:
- Debian Linux: Configure Network Interfaces As A Bridge / Network Switch
- OpenBSD: Configure Network Interface As A Bridge / Network Switch
- How To PFSense Configure Network Interface As A Bridge / Network Switch
- FreeBSD: NIC Bonding / Link Aggregation / Trunking / Link Failover
- How To Setup Bridge (br0) Network on Ubuntu Linux 14.04 and 16.04 LTS
- Ubuntu setup a bonding device and enslave eth0+eth2
- Setup Bonded (bond0) and Bridged (br0) Networking On Ubuntu
- Ubuntu 20.04 add network bridge (br0) with nmcli command
- CentOS 8 add network bridge (br0) with nmcli command
- How to add network bridge with nmcli (NetworkManager) on Linux
- Set up and configure network bridge on Debian Linux
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 4 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
There’s a typo in the topic:
the “n” is missing at “OpeBSD” ;)
Thanks for the heads up!
Well, if you need to give bridge an address, don’t do it on physical interface. Once this particular interface goes down, you won’t be able to connect to bridge via any other interface.
Use vether* for this purpose. Give it address and add to a bridge. It is always-up and will be reachable as long as at least one physical interface of bridge is up.
Thanks for that awesome tip Paul, just stumbled across this!