Connecting Two Laptops: Ubuntu 22.04 & macOS 14.5 via Thunderbolt
In this article, we will discuss the process of connecting two laptops, one running Ubuntu 22.04 and the other running macOS 14.5, using a Thunderbolt cable. This connection can be useful for transferring large files, sharing peripherals, or even using one computer as a display for the other. The process is straightforward and does not require any specialized knowledge.
Requirements
To follow this guide, you will need the following:
- Two laptops, one running Ubuntu 22.04 and the other running macOS 14.5
- A Thunderbolt cable compatible with both laptops
Connecting the Laptops
Connect the two laptops using the Thunderbolt cable. On Ubuntu, the connection should be recognized automatically and no additional setup is required. On macOS, you may need to approve the connection in the Security & Privacy settings.
Setting up the Connection
Once the laptops are connected, you can start using them as two separate computers or as a single network. To use them as a single network, you will need to set up a bridge between the two computers.
On Ubuntu
On Ubuntu, open the Terminal and enter the following commands:
sudo ip link add name bridge_name type bridge
sudo brctl addif bridge_name enp0s20f0u1
sudo ip link set bridge_name up
Replace "bridge\_name" with the name you want to give to the bridge, and "enp0s20f0u1" with the name of the Thunderbolt interface. You can find the name of the Thunderbolt interface by running the command "ip a".
On macOS
On macOS, open the Terminal and enter the following commands:
sudo ifconfig en1 down
sudo ifconfig bridge100 creation
sudo ifconfig bridge100 addm en1
sudo ifconfig bridge100 up
Replace "bridge100" with the name you want to give to the bridge, and "en1" with the name of the Thunderbolt interface. You can find the name of the Thunderbolt interface by running the command "ifconfig".
Testing the Connection
Once the bridge is set up, you can test the connection by pinging one computer from the other. On Ubuntu, open the Terminal and enter the following command:
ping ip_address_of_macos_computer
On macOS, open the Terminal and enter the following command:
ping ip_address_of_ubuntu_computer
Replace "ip\_address\_of\_macos\_computer" and "ip\_address\_of\_ubuntu\_computer" with the actual IP addresses of the computers.
Disconnecting the Laptops
To disconnect the laptops, simply disconnect the Thunderbolt cable. On Ubuntu, the bridge will be automatically removed. On macOS, you will need to remove the bridge manually by running the following commands:
sudo ifconfig bridge100 down
sudo ifconfig bridge100 deletion
Connecting two laptops, one running Ubuntu 22.04 and the other running macOS 14.5, using a Thunderbolt cable is a simple process that does not require any specialized knowledge. Once connected, the laptops can be used as two separate computers or as a single network by setting up a bridge between the two computers. This connection can be useful for transferring large files, sharing peripherals, or even using one computer as a display for the other.