# Android USB tethering not working



## vinod.pn (Jun 15, 2021)

I'm not able to ping any IP from ue0 interface, but I'm able to ping just the IP of my phone. Any help on this is much appreciated.

*Setup details:*
FreeBSD 13.0-RELEASE
phone: Moto Z play and Vivo Pro 7

*What I have done:*

I have loaded if_urndis kernel module
ran `dhclient ue0`
ran `ifconfig ue0 up`
*Some details from commands:*

```
# kldstat
Id Refs Address                Size Name
1   57 0xffffffff80200000  1f11ef8 kernel
2    1 0xffffffff82610000   10b310 nvidia-modeset.ko
3    1 0xffffffff82800000  1e83468 nvidia.ko
4    2 0xffffffff8271c000    388f8 linux.ko
5    3 0xffffffff82755000     db70 linux_common.ko
6    1 0xffffffff82763000     3378 acpi_wmi.ko
7    1 0xffffffff82767000     3250 ichsmb.ko
8    1 0xffffffff8276b000     2180 smbus.ko
9    1 0xffffffff8276e000     2340 uhid.ko
10    1 0xffffffff82771000     4350 ums.ko
11    1 0xffffffff82776000     3380 usbhid.ko
12    1 0xffffffff8277a000     31f8 hidbus.ko
13    1 0xffffffff8277e000     3320 wmt.ko
14    1 0xffffffff82782000     62c8 vkbd.ko
15    1 0xffffffff82789000     2a08 mac_ntpd.ko
18    1 0xffffffff8278c000     3380 if_urndis.ko
19    1 0xffffffff82790000     3178 uether.ko
```


```
# ifconfig
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
    ether 2c:56:dc:3f:02:54
    inet 192.168.0.14 netmask 0xffffff00 broadcast 192.168.0.255
    media: Ethernet autoselect (100baseTX <full-duplex>)
    status: active
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
    inet 127.0.0.1 netmask 0xff000000
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether ca:e8:28:c4:4a:26
    inet 192.168.42.48 netmask 0xffffff00 broadcast 192.168.42.255
    nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
```


----------



## aragats (Jun 15, 2021)

You should provide the output of `netstat -rn`.


----------



## Geezer (Jun 16, 2021)

vinod.pn said:


> ran `dhclient ue0`
> ran `ifconfig ue0 up`





vinod.pn said:


> # ifconfig
> re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
> ether 2c:56:dc:3f:02:54
> inet 192.168.0.14 netmask 0xffffff00 broadcast 192.168.0.255



Where does that IP come from? Does your android have a dhcp server? Mine does not.

Also, did you change the default route to the IP of your android?


----------



## vinod.pn (Jun 16, 2021)

aragats said:


> You should provide the output of `netstat -rn`.


Thanks for telling this, i saw that default route was still pointing to  my other ehernet interface which i had turned down. I added the default route on my freebsd to my phone's IP , now i have internet connectivity over USB tether. Thanks.


----------



## vinod.pn (Jun 16, 2021)

Geezer said:


> Where does that IP come from? Does your android have a dhcp server? Mine does not.
> 
> Also, did you change the default route to the IP of your android?


I added the route and now its all good. Thanks.
btw, re0 interface is my ethernet interface and not the USB tethered one.


----------

