Laptops are invariably limited to Wi-Fi only connections; desktop computers never have built-in mobile internet. But what if you need to get your Linux computer online but have no wireless or Ethernet network?
The answer is tethering. With a smartphone you can share your mobile internet with your computer.
As long as your carrier doesn’t limit how you use your data, internet connection sharing (also known as netshare) with a Linux computer is a good option. Wi-Fi tethering is one option—here’s how to use USB tethering on Linux with Android and iPhone.
What Is Tethering?
Tethering is the name given to connecting a mobile device to a computer such in order to share mobile internet.
While some carriers might restrict this activity, these days that is rare. Most smartphones have a data plan which allows tethering, making tethering an attractive way to get online.
Strictly speaking, tethering refers to using a USB cable to share mobile internet. This means that you will need to carry your phone’s USB data cable around if you plan to use tethering.
Wireless tethering is also possible, using Wi-Fi or Bluetooth; this is also known as “wireless hotspot”. In most cases wireless tethering is easier but there are good reasons to use USB tethering:
- For a reliable network connection
- To keep your phone charged
- Avoid wireless interference
- Prevent wireless sniffers intercepting data
If you don’t have a suitable USB cable, here’s how to use your phone as a wireless hotspot. Simply connect your Linux computer to your phone’s hotspot to get online.
Use the Right USB Cable for Tethering
Before proceeding, you need to be sure that you’re using a USB cable that is suitable for tethering. Not all cables will work for this, as some are designed purely for power. The best way to check that your USB cable is suitable for tethering is to plug it into your computer. Connect your phone and wait for either device to detect the other. If some sort of data transfer or file browsing is available, it is suitable for tethering.
If there is a problem with the cable, you should be able to buy a suitable data-ready alternative online.
The following methods all require you to connect the mobile device to your PC via USB cable before activating tethering.
How to Tether Android Phones to Linux
If you have an Android device, tethering is straightforward, thanks in part to both phone and PC being Linux-based.
If you want to tether Android to Linux via a USB cable:
- Connect the USB cable to your phone and Linux PC.
- Android will detect the connection—when prompted to Allow access, select Allow.
- In the Notifications find the USB message, and tap it.
- Under Use USB for, select USB tethering.
In most cases, the connection will be automatically established. Check the IP address for your device to confirm it has worked using
ip address. Look for an option labeled
With some distros, you may need to select the USB connection.
- On Linux system, find the network tray applet
- Click to find the network option with a name like “auto usb0”.
- Select this to connect Linux to your phone via the USB cable.
Don’t have a data plan which allows tethering? Installing a custom Android ROM can help circumvent restrictions.
Want to Tether a BlackBerry Phone?
Depending on how old your BlackBerry is, there are several options for tethering it to a Linux system. If you have a BlackBerry, it is either running:
- Android (since 2015)
- BlackBerry 10 (2013-2018)
- Blackberry OS 7.0 (2011-2013)
For BlackBerry devices running Android, refer to the section above. For BlackBerry 10 and BlackBerry OS 7.0, check below.
To tether phones over USB running BlackBerry 10, start by connecting the phone to your computer. Then:
- Open Settings > Network Connections > Internet Tethering.
- Tap Connect.
- Select USB.
- Enable Internet Tethering.
Want to tether a BlackBerry OS phone to Linux?
- Tap Manage Connections > Network and Connections.
- Find Mobile Hotspot Connections then
- Set up the network credentials.
Whichever method you use, select the usb0 network in your Linux panel if it doesn’t automatically connect.
How to Tether iPhones to Linux
If you have an iPhone with a data plan which allows tethering, you can set up USB tethering.
Unlike Android, however, this doesn’t connect automatically. Instead, you will need
libimobiledevice, described as a “cross-platform software protocol library and tools to communicate with iOS devices natively.” Head to www.libimobiledevice.org to confirm current compatibility.
If you’re using Ubuntu, libimobiledevice should already installed. If not, before hooking up your iPhone to Linux, open a terminal and enter:
sudo apt install libimobiledevice6
To connect to the internet through your iPhone:
- Open Settings > Personal Hotspot.
- Enable Allow Others to Join.
All you need to do now is select the connection in Linux. Unlike Android, iPhone devices display as a new Ethernet device, rather than USB. So, look for
eth1—usually the latter, as
eth0 should be assigned to your Ethernet port.
Tethering Linux Phones to Linux
Several Linux mobile operating systems are available. These include a mobile version of Pure OS on the Librem 5, PostmarketOS on the PinePhone, and UBPorts, the continuation of Ubuntu Touch.
Perhaps surprisingly, not all of these have reliable options for USB or wireless tethering. For specifics, check the documentation of whichever Linux mobile project you’re using.
Tethering Your Phone to Linux: Success!
While smartphones can be used as wireless hotspots for laptops and computers, USB tethering remains useful. Your computer may have a damaged network card, for example, or you may have equipment susceptible to wireless interference.
Ultimately, sharing your phone’s mobile internet is a great way to get your Linux PC or any other device online. And if you’re concerned about the phone losing charge, the USB cable will ensure it draws power from your PC. It’s win-win!
Want to share your phone’s internet connection with a different operating system? You can connect mobile internet from an Android phone to your PC or laptop, as well as use the hotspot feature on an iPhone.
Read the full article: How to Tether Any Smartphone to Linux for Mobile Internet