Ubuntu 22.04.5安装基础系统更新后USB共享网络(USB Tethering)故障求助
Hey there, sorry to hear you're stuck with this USB tethering mess after system updates—total bummer when that's your only shot at getting internet on your computer! Let's walk through some hands-on troubleshooting steps that often fix these post-update glitches:
Check your USB tethering interface status
Fire up the terminal and runip link showto list all network interfaces. Keep an eye out for one with a name likeenp0s20f0u1(usually has auin it to mark it as a USB-connected interface). If it showsDOWN, enable it manually withsudo ip link set <your-usb-interface-name> up.Force a DHCP IP refresh
System updates can sometimes break the DHCP client's ability to grab an IP from your phone. Runsudo dhclient <your-usb-interface-name>to force a new IP assignment, then check if you got a valid address withip a—you're looking for something in ranges like 192.168.42.x or 192.168.12.x, which are common for phone tethering setups.Double-check firewall settings
Updates occasionally reset firewall rules without warning. Temporarily disable UFW to test withsudo ufw disable—if your internet starts working right away, you'll need to whitelist traffic on the USB interface. Re-enable UFW after testing, then runsudo ufw allow in on <your-usb-interface-name>andsudo ufw allow out on <your-usb-interface-name>to lock that in.Restart critical network/USB services
Post-update, services like NetworkManager or udev might not have restarted properly and are causing hiccups. Try running these commands one after another:sudo systemctl restart udev sudo systemctl restart NetworkManagerWait 10-15 seconds, then toggle USB tethering on your phone again to see if it sticks.
Check kernel modules for USB tethering
Most Android USB tethering relies on therndis_hostkernel module. Runlsmod | grep rndis—if you get no output at all, the module might not be loaded. Try loading it manually withsudo modprobe rndis_host, then re-enable USB sharing on your phone.Reset the physical USB connection
Sometimes the simplest fixes work best. Turn off USB tethering on your phone, unplug the USB cable, wait a full 10 seconds, plug it back in, and re-enable tethering. This can help Ubuntu re-recognize the device with the updated system libraries from your recent updates.
If none of these steps do the trick, digging into system logs might reveal the root issue. Try journalctl -xe | grep NetworkManager to see if NetworkManager is throwing errors related to the USB interface, or dmesg | grep usb to check for USB device recognition problems.
备注:内容来源于stack exchange,提问作者Ziet Sevii

