Jump to content

User:Amstan/Thunderbolt Bridge Networking

From ArchWiki

When connecting 2 hosts together over thunderbolt, Linux will generally create thunderbolt networking interfaces on each device. This is a guide how to complete the puzzle for a pretty plug and play setup. The theory of operation is to create a networking bridge between all wired interfaces (ethernet and thunderbolt) for every device.

This could be very useful in cases where a laptop is connected over thunderbolt to a desktop, so the desktop's ethernet uplink is now shared with the laptop as well.

Network Manager

/etc/NetworkManager/system-connections/bridge-eth.nmconnection
[connection]
id=bridge-eth
uuid=15588d71-ffa4-42a7-8ab9-9336c2814c22
type=ethernet
controller=555eba24-961e-4203-9248-c8f99b66552b
interface-name=enp191s0
port-type=bridge
/etc/NetworkManager/system-connections/bridge-thunderbolt0.nmconnection
[connection]
id=bridge-thunderbolt0
uuid=77b4e047-85ac-4533-aa61-1b44b3e7c23b
type=ethernet
controller=555eba24-961e-4203-9248-c8f99b66552b
interface-name=thunderbolt0
port-type=bridge

[ethernet]
mtu=65520
/etc/NetworkManager/system-connections/bridge.nmconnection
[connection]
id=bridge
uuid=555eba24-961e-4203-9248-c8f99b66552b
type=bridge
interface-name=nm-bridge

[bridge]
stp=false
# WARNING: Enable stp above if you want to have a network with loops

[ipv4]
method=auto
[ethernet]
#cloned-mac-address=9c:bf:0d:00:e0:86
# fill in above mac address from the ethernet interface to keep your existing dhcp assignments

Spanning Tree Protocol

In the case where the setup has loops (for example a tight cluster of computers networked together with thunderbolt, with ethernet uplinks), Spanning Tree Protocol (STP) should be enabled.

In bridge.nmconnection, stp=true should be configured.

After that the path costs for the links should be configured. In each of the interfaces, add a new section:

/etc/NetworkManager/system-connections/bridge.nmconnection
[bridge-port]
# low cost so this path is preferred
path-cost=1

It is recommended to keep thunderbolt with a path-cost set to 1 so it's highest priority, ethernet interfaces should have raised priority, perhaps starting at 1000, increasing by 100 for each of the "backup" ethernet uplinks of the other nodes in the cluster.