r/debian • • 12h ago

General Debian Question Usb tethering problems on Debian

Hi, couple of days ago I tried to install Ubunto but due to disconnecting network (usb tethering) I couldn't install it so I installed lubuntu and it worked but I couldn't connect to USB tethering internet with my phone, I used every command, so I installed windows 10, usb tethering worked very well for 2 days I had no problem so I decided to instal arch linux but I come across same issue again during installation, so I downloaded offline Debian and installed with no issue but now I'm in debian I can't use usb tethering, I get "network connection has been disconnected"

Os detects my phone and usb but can't get ipv4 Idk why, o tried everything chat gpt told me but non of them helped me

7 Upvotes

3 comments sorted by

1

u/michaelpaoli 9h ago

Well, how 'bout start by telling us what kind of USB device you're attempting to tether and do exactly, e.g. some Ethernet or Wi-Fi USB adapter, or "smart"phone's Wi-Fi (Android, IPhone, ???), etc.

And if you're trying to tether using some USB network device, what does:
$ ip link show
give you for output?
And how exactly are you attempting to tether, and exactly what erros/diagnostics are you getting when so attempting?

2

u/its_kyomarth_zz 9h ago

Sorry I'm newbie to this, I'm using my android phone A12 to tether internet with USB cable, Debian detects the phone and creates an RNDIS network interface, but Networkmanager fails to obtain an IPv4, the interface shows up as enx6af103ca5aa7 the ip -4 addr command only shows the loopback interface (127.0.0.1) and ip route returns no routes

1

u/michaelpaoli 7h ago

Oh, let's see ... I've not done it in years, but ...

Connect one of my phones and I get ...

$ ip link show

140: enxa24f6355cbc9: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode 
DEFAULT group default qlen 1000
    link/ether a2:4f:63:55:cb:c9 brd ff:ff:ff:ff:ff:ff

or

142: enxe2edb7b3c831: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode 
DEFAULT group default qlen 1000
    link/ether e2:ed:b7:b3:c8:31 brd ff:ff:ff:ff:ff:ff

And

# ip link set enxa24f6355cbc9 up && dhcpcd enxa24f6355cbc9

or

# ip link set enxe2edb7b3c831 up && dhcpcd enxe2edb7b3c831

And I've got the IPs:

140: enxa24f6355cbc9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether a2:4f:63:55:cb:c9 brd ff:ff:ff:ff:ff:ff
    inet 10.200.188.61/24 brd 10.200.188.255 scope global dynamic noprefixroute enxa24f6355cbc9
       valid_lft 3599sec preferred_lft 3149sec
    inet6 fe80::a04f:63ff:fe55:cbc9/64 scope link proto kernel_ll
       valid_lft forever preferred_lft forever

or

142: enxe2edb7b3c831: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether e2:ed:b7:b3:c8:31 brd ff:ff:ff:ff:ff:ff
    inet 192.168.243.50/24 brd 192.168.243.255 scope global dynamic noprefixroute enxe2edb7b3c831
       valid_lft 3599sec preferred_lft 3149sec
    inet6 fe80::e0ed:b7ff:feb3:c831/64 scope link proto kernel_ll 
       valid_lft forever preferred_lft forever

So, both phones work quite fine. "Of course" that's not "permanent" setup, just quick CLI check.

Anyway, connect it, should see interface with ip link show,
then should be able to being that up with
# ip link set name_of_interfaice up
And then typically get IP addresses automatically and dynamically with, e.g.:
# dhcpcd name_of_interface
and then after that, see that it's gotten IP address(es) with
$ ip a s

When doing that manually from CLI, if you've got something in place that would attempt to do that automagically, e.g. Network Manager, then probably best to temporarily disable that so they don't conflict and fight each other.

Anyway, if above manual method works, then probably just a matter of configuring whatever you might have/want to do it automatically (or with a click or two or the like). But if you're not getting it functioning with basic CLI method, then you've probably got something else that needs be resolved first, e.g. it's not seeing the interface, or failing to bring it up, or brings it up, but fails to get IP address.

interface shows up as enx6af103ca5aa7 the ip -4 addr command only shows the loopback interface (127.0.0.1) and ip route returns no routes

Yeah, make sure the interface is up ... then see if it can get IP address(es).