0

My goal is to have wired internet on different devices using the tethering from a smartphone. My idea is that a raspberry pi receives internet over USB tethering of a smartphone, and acts than as a router for the Intranet, providing internet over a switch to different devices. Is this achievable, and if yes, how?

1 Answers1

1

When using USB tethering with your smartphone you should get a network interface when connected. Check with ip -br addr. I don't know what its name is on your installation but with the Raspberry Pi OS it is mostly named usb0. Now you have two interfaces: eth0 connected to your switch and usb0 (or however it is named) as uplink to your smartphone.

You can just enable ip forwarding between interfaces and set a NAT (network address translation) to have a simple working router. Use a Raspberry Pi as router for a tethered internet connection. In that example just replace the modem and its interface with your smartphone. From the networking view it is just the same.

Ingo
  • 42,107
  • 20
  • 85
  • 197
  • Thanks for your help, that works. Is it also possible to share the tethering to both eth0 and wlan0? I've got some trouble setting up /etc/network/interfaces such that both eth0 and wlan0 are in the same subnet.. – Trashin Jul 06 '20 at 09:10
  • @Trashin Yes, it is possible to bridge eth0 and wlan0 and connect with both to the internet. You should create a new question about this. Using/etc/network/interfaces on Raspberry Pi OS is deprecated. You should not use it anymore. You should merge your both accounts 'Trashinaand Trashin and then accept the answer. Only accepting an answer will finish the question and it will not pop up again and again for years and annoing us. – Ingo Jul 06 '20 at 17:53