- How to enable internet sharing via USB Ubuntu 20.04 to android 6.0.1 and 10
- 2 Answers 2
- How to access to internet on Linux using Android Tethering
- Tethering on Linux
- USB Tethering
- Wifi Tethering
- Bluetooth Tethering
- How to: How to tether your Android to Ubuntu (>=9.10) or Fedora as an Internet modem via the USB cable
How to enable internet sharing via USB Ubuntu 20.04 to android 6.0.1 and 10
Internet connection on Ubuntu is by Ethernet cable.
I want to connect two devices and share internet from Ubuntu to Samsung Galaxy Note Edge [SM-N915FY; android: 6.0.1] and Samsung Galaxy Note 9 [SM-N960F; android 10] by USB cable. I have read all previous topics about sharing internet, tired all but I have failed to share data. In Connections — System Settings Module -> tab IPv4 changed method to Shared to other computers, but still not working. Of course I’ve accepted permission to access by PC on phone.
There is no reverse tethering option on both Samsung Notes. Also tired to enable USB debugging.
It is probably quite a bit easier to check your router for DHCP options, and setting it up to provide «Internet» to the phones via wlan.
as i mentioned before, i want to share internet via USB, not wireless. I know how to share internet wireless, but not via USB.
Right, now the big question is; is there a driver that works for Ubuntu or any other linux? Please be more specific.
2 Answers 2
Pretty old question but there is a simple way, thanks to an amazing tool
I have a way but a little bit tricky. You are going to need:
- Android with the «USB-PC internet share» option (not the classic USB tethering)
- iptables or nftables (for masquerade/SNAT)
- tcpdump
- iproute2
- a dns server on your linux (dnsmasq is quick to set up)
1/ On you android device: got to Settings >> Network connection >> Tethering and portable hotspot >> USB-PC internet share . Say ok or choose any OS suggested (usually different Windows versions), it does not matter as long as the functionnality is enabled. => now your smartphone is going to immediately try to connect to internet, but your Linux system is not yet ready. You will need to retrieve the folling information: the subnet and the default gateway you smartphone is going to use. This can be done with tcpdump
2/ On your Linux: use tcpdump to capture traffic from the USB network interface (enabled when USB PC internet share is activated from android). You are going to see a lot of whohas XXXX. This ip address is the default gateway you android is trying to reach. add this ip address and the correct subnetmask to the tethering interface (sudo ip address add XXXXX dev XXXX) or use network manager
3/ enable masquerading with iptables:
sudo iptables -A POSTROUTING -o usb_thethering_interface -j MASQUERADE
4/ make sure you dns server is working on the Linux.
How to access to internet on Linux using Android Tethering
It’s been over 30 years since the World Wide Web was introduced to the world. Over time, the internet took its toll and now has roughly around 45 million web pages compared to 10,000 websites earlier. We really do have come a long way.
Emerging from the primitive world of 2G signals we are now living in the era where mostly every device has an internet connection and if not of its own, gets one from another system. The technical term for sharing your phone’s internet connection to another phone or system is known as Tethering.
Tethering on Linux
Tethering the internet through your phone to your Linux desktop can be done mainly via three simple ways.
USB Tethering
Connection over USB is just as simple as connecting your phone to a charger point. However, just like electricity is essential to charge your phone, internet connection in your phone is necessary to share it with others. Rare is the case when your charging cable is not suitable to be used as a data-transfer wire and you need to buy an apt one separately.
The connection is automatically established by plugging in your USB cable to both your computer and phone. A dialog box of confirmation highlighting the name of your device pops up.
Now, Under the Settings in your phone select Wireless and Network (or Network and Internet ). Click on the More tab and choose Tethering & Portable Hotspot and Enable USB Tethering . On the top right corner of your Linux machine, bring down the Network Connections toolbar as shown, where a tab Ethernet Connected is visible.
Your system’s internet connection is ready!
However, in a few cases you might have to further enable the Wired Settings window, where you can add a new connection and also view the IP address of your attached device. Here in this case, it is named Profile 1 .
Wifi Tethering
Following the same process as mentioned above, in your Android phone, open Settings and go to Network & Internet . Next, select Mobile Hotspot and Tethering and turn on the Mobile Hotspot . In your Linux system, again under the Network Connections , turn Wifi On
Here you can view all the available networks and connect with anyone by just entering the password available in your phone under Mobile Hotspot .
The Wi-Fi symbol in the top panel will now indicate that it’s connected.
Bluetooth Tethering
Yes! The bluetooth connection can be used not only to transfer data files but for passing on your phone’s internet connection to your Linux machine. Navigating through the Network Connections tab, switch on the Bluetooth on your Linux distro and go to Bluetooth Settings .
Make sure you have turned on Bluetooth in your phone too. Both of your devices will discover each other so click on the device’s name and a confirmation pin message will show up on both of the devices. If the pin matches, click confirm and Bluetooth pairing will be established.
Now, again go to the Network Connections tab and under the paired device, here e9b7c69c , select the option to Connect to Internet .
The Bluetooth symbol in the top panel will now indicate that it’s connected.
Go ahead and explore the unlimited boundaries of the internet on your Linux system! Thanks to the unimaginable scope of technology, without a doubt, your cellphone will always be at your rescue whenever a sudden need of an internet connection is required to your system.
Help us improve this content by editing this page on GitHub
How to: How to tether your Android to Ubuntu (>=9.10) or Fedora as an Internet modem via the USB cable
So after using the Verizon Droid (Android Linux-based phone) for awhile, I set out in search of a piece of functionality that I hadn’t yet replaced from my Blackberry days. That is: The capability to tether my cell phone as an Internet modem to my Ubuntu GNU+Linux machine using the USB cable.
On the Blackberry, this was as simple as, a.) provisioning the data service through Verizon(yes, this does cost extra), and then b.) setting up the Berry4All/BBTether script (by the extravagant Mr. Thibaut Colar) on my Ubuntu Linux box.
In my search for a solution, the first place I checked for a tethering application was in the Android Market. And while there are many other applications, the only app I was able to find for tethering, required for my phone to be rooted. And so instead of jumping right into that, I went looking for an easier solution, and voila! — I found it.
What I found are some easy tethering instructions by the masterful Shwan.c at Ubuntuforums.org. So now there was only one problem: I’m using the Verizon Droid, not the HTC Magic. The good news is that the process is generally the same, except for a difference in hardware id information for the udev rules settings in Ubuntu.
So after some minor changes to the instructions for the HTC Magic, I’ve now successfully tethered my Verizon Droid via USB as a modem for my Ubuntu GNU+Linux machine.
Follow these easy steps to get you up and running with using your Droid as a USB tethered modem (and a big Thanks to Shwan.c for posting the original idea).