USB Tethering

This is a guide for using the mobile data or wifi of a postmarketOS device through USB on your host device. For the inverse see the USB Internet page if you need to use the USB connection to get internet from your host into the postmarketOS device.

= Automatically (SXMO) =

Open menu "Networks", select menu "Add a USB Hotspot", you'll be prompt to set a profile name (e.g. USB Tethering).

Activate the newly created interface (i.e. )USB Tethering by selecting it.

Your computer should receive internet traffic from your postmarketOS device automatically.

= Automatically (GNOME) =

1. Connect your phone over USB to your desktop.

2. On the phone, open Settings

3. Go to the Network panel tab.

4. You should see 1 wired connection at the top, tab the edit settings button (gear).

5. An old panel opens which doesn't fit your screen (use Phosh Mobile Settings to enable scale-to-fit for this panel only, it will be shown in the list of active apps).

6. Go to the IPv4 tab.

7. Select 'Shared to other computers' and tab the Apply button in the right corner.

= Manually =

If you don't use SXMO or GNOME, you should follow the following instructions. To make USB Tethering to work, you'll have to repeat these instructions every time your system reboots.

On the postmarketOS device
On the postmarketOS device side the firewall needs to be configured to perform NAT between the USB interface and it's default gateway. The default gateway can be either the WiFi or the modem in the device.

First enable ip forwarding between the interfaces:

Then adjust the firewall configuration to NAT between the USB interface and the other interfaces

The default nftables configuration in postmarketOS already has the other rules setup to make USB tethering work.

On the host side
Plug the postmarketOS device into your PC or laptop and run a DHCP client against the USB interface that shows up. It's also possible to use a static IP configuration.

If your host has automatically done DHCP on the USB interfaces, as is common on most Linux distributions. The only thing required is setting the default gateway to the USB interface since the DHCP server on the postmarketOS device does not set the default gateway.