Share USB Tethering to WiFi and Ethernet Devices


I have an Android with 4G Internet access. I connect it to Ubuntu via a USB cable and enable the USB Tethering in Android. The Ubuntu identify it in “Ethernet Connected” → “Wired connection 2” immediately.

My next step is to share internet from Ubuntu notebook through its built-in Ethernet and WiFi. Here is how.

Share Through Ethernet

I found Sharing Connection to other PCs (Via Wired Ethernet) [duplicate]  is very useful but some dialogs have changed in 18.04. cannot share wired network connection in 18.04 has the correct information for 18.04.

  1. Open a terminal and run nm-connection-editor
  2. In the “Network Connections” dialog, edit the wired connection.
  3. In the edit dialog, switch to the “IPV4 Settings” tab.
  4. Choose “Shared to other computers” in Method.
  5. Click the “Save” button to apply.

Clicking on the Ethernet or Wifi icon which is located on the upper right corner and “Ethernet Connected” → “Wired Settings” brings up the “Settings” → “Network” tab. There is no “Shared to other computers” option while editing IPV4.

The “Network Connection” dialog is different from the”Settings” → “Network” tab.

Share Through WiFi

How To Create A Wi-Fi Hotspot In Ubuntu 18.04 / Gnome (And Edit Its Settings) has detail explanation.

First, turn on Wi-Fi.

Then click on the Ethernet or Wifi icon which is located on the upper right corner and “Wi-Fi Not Connected” → “Wi-Fi Settings”. It would bring up the “Settings” → “Wi-Fi” tab. Click on the “Command” icon which looks like three horizontal line stacks together on the dialog border and select “Tuen On Wi-Fi Hotspot”. One more dialog will popup and click on the “Tune on” to confirm.

To configure, launch the “Network Connections” dialog by running nm-connection-editor. Edit the “Hotspot” profile in Wi-Fi. Change SSID in the “Wi-Fi” tab and WPA in the “Wi-Fi Security” tab.

Reference

  1. AskUbuntu: cannot share wired network connection in 18.04
  2. AskUbuntu: Sharing Connection to other PCs (Via Wired Ethernet) [duplicate] 
  3. Linux Uprising: How To Create A Wi-Fi Hotspot In Ubuntu 18.04 / Gnome (And Edit Its Settings)
  4. Matt’s Blog: Sharing WiFi Connection over Ethernet on Ubuntu 18.04

2 thoughts on “Share USB Tethering to WiFi and Ethernet Devices

  1. hi,
    At the Share Through Ethernet its not clean:
    I need Wired connection 2 for usb and also Wired connection 1 for shareing? ?
    Thx Donnie

    Like

    • Hi Donnie,

      In this post, I try to set up my Linux PC as an AP. The WAN is connected to Android via USB tethering. This internet connection will be shared with others via LAN and wireless network. You may share both or just one of them.

      If you just want to turn your PC into a wireless AP, you may skip the “Share Through Ethernet” section.

      Wish it helps!

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.