How to Use a USB Tethering Connection on Arch Linux

How to Use a USB Tethering Connection on Arch Linux

In a world where connectivity is essential, USB tethering remains a reliable method to share your smartphone’s internet connection with your computer. Whether you’re dealing with unstable Wi-Fi, traveling, or just want a quick connection via your phone’s cellular network, USB tethering can be a handy solution. For Arch Linux users, setting up USB tethering may seem daunting at first, but it is relatively straightforward with the right knowledge and tools.

This guide covers everything you need to know about using a USB tethering connection on Arch Linux—from prerequisites and kernel modules to configuring systemd-networkd or NetworkManager for connectivity.


1. What is USB Tethering?

USB tethering is a feature found in most modern smartphones that allows them to share their mobile data connection with a computer via a USB cable. Unlike Wi-Fi hotspot tethering, USB tethering typically offers more stable and faster connections and consumes less battery on the phone.

When USB tethering is enabled, the phone acts as a USB network interface card (NIC), and your Linux system detects it as a new network device.


2. Prerequisites

Before you begin, ensure the following:

  • A smartphone with USB tethering capability (Android or iOS)
  • A USB cable to connect the phone to your Arch Linux system
  • An Arch Linux installation with the following components:
    • Linux kernel with support for USB networking
    • Appropriate USB drivers
    • A network management tool (e.g., systemd-networkd, NetworkManager)

3. Connect Your Phone via USB

  1. Plug in your smartphone using a USB cable.
  2. On the smartphone, enable USB Tethering:
    • On Android: Go to Settings > Network & Internet > Hotspot & Tethering > USB Tethering, and toggle it ON.
    • On iOS: Go to Settings > Personal Hotspot, enable it, and connect the phone to the computer via USB.

4. Check the USB Network Interface

Once USB tethering is enabled, the phone presents itself as a USB Ethernet device to the Arch Linux system.

Open a terminal and type:

ip link

You should see a new interface, usually named something like usb0, enp0s20u1, or enxXXXXXX, depending on your system and udev naming conventions.

You can also run:

dmesg | grep -i usb

This can help you verify whether the kernel detected the USB network device.


5. Load Required Kernel Modules

Most modern Linux distributions, including Arch Linux, load the necessary modules automatically. However, if your device is not recognized, ensure the following kernel modules are loaded:

  • usbnet: Core USB networking driver
  • rndis_host: For Android phones using RNDIS (Remote Network Driver Interface Specification)
  • cdc_ether: For devices that present themselves as CDC Ethernet devices (some iPhones and certain Android models)

To load these manually:

sudo modprobe usbnet
sudo modprobe rndis_host
sudo modprobe cdc_ether

Check if the interface appears again using:

ip addr

6. Configure Network Access

Once the USB network interface is detected, you can configure the connection using either systemd-networkd or NetworkManager, depending on your system setup.


Option 1: Using systemd-networkd

If you are using systemd-networkd for managing network connections:

  1. Identify the interface name:
ip link

Assume the interface is named enp0s20u1.

  1. Create a network configuration file:
sudo nano /etc/systemd/network/20-usb-tethering.network
[Match]
Name=enp0s20u1

[Network]
DHCP=yes
  1. Enable and start systemd-networkd:
sudo systemctl enable systemd-networkd --now
  1. Restart the interface or reboot:
sudo systemctl restart systemd-networkd

or simply:

sudo ip link set enp0s20u1 down
sudo ip link set enp0s20u1 up

Then check if you have an IP address:

ip addr show enp0s20u1

And check connectivity:

ping archlinux.org

Option 2: Using NetworkManager

If you are using a desktop environment, you likely have NetworkManager running, which simplifies the process.

  1. Install NetworkManager if not already installed:
sudo pacman -S networkmanager
  1. Start and enable NetworkManager:
sudo systemctl enable NetworkManager --now
  1. Let NetworkManager handle the USB interface automatically:

Once the phone is connected and USB tethering is enabled, NetworkManager should detect and auto-configure the interface.

You can verify with:

nmcli device

If the interface is listed and its state is “connected”, you are online.


7. Troubleshooting

USB Interface Not Detected

  • Check if the phone is properly connected and recognized with dmesg.
  • Ensure USB tethering is enabled on the phone.
  • Try different USB ports or cables.

No Internet Access

  • Run ip a to verify if the interface has an IP address.
  • Check routing with ip route.
  • Use dig or nslookup to test DNS resolution.
  • Check iptables or firewall rules that may block outgoing traffic.

Interface Keeps Disconnecting

  • Ensure your phone doesn’t enter battery-saving mode.
  • Try using a different USB cable or avoid USB hubs.
  • On Android, avoid aggressive power-saving features or use developer options to keep the USB debugging connection awake.

8. Using USB Tethering Persistently

If you frequently use USB tethering, you may want to automate the connection process.

For systemd-networkd users, simply plugging in the phone will trigger the .network configuration based on interface matching.

For NetworkManager, you can create a connection profile:

nmcli connection add type ethernet ifname enp0s20u1 con-name usb-tethering
nmcli connection modify usb-tethering ipv4.method auto
nmcli connection up usb-tethering

This ensures it connects automatically each time the device is plugged in.


9. Tips and Best Practices

  • Data Usage: Be cautious of mobile data limits when tethering.
  • Security: USB tethering is inherently more secure than open Wi-Fi tethering.
  • Battery Impact: While tethering via USB usually charges your phone, extended usage may still drain power depending on the load.

10. Alternatives

If USB tethering does not work, consider alternatives like:

  • Wi-Fi Hotspot: Turn your phone into a Wi-Fi router.
  • Bluetooth Tethering: Slower but works wirelessly for basic browsing.

Each method has pros and cons depending on your use case, but USB tethering generally offers the most reliable performance with minimal configuration.


Conclusion

Using USB tethering on Arch Linux is a practical way to get online when conventional internet access is unavailable. While the process may seem technical at first, once the required modules are in place and your network manager is configured, it becomes a plug-and-play solution.

Whether you’re on the go, setting up a backup connection, or just testing mobile networking, mastering USB tethering adds a useful tool to your Linux skill set. As with most things in Arch, understanding what’s happening under the hood gives you full control—and a better appreciation of the simplicity and power of Linux networking.