Solved No route to host using USB Tethering (rc.conf DHCP ifconfig not setting up ue0)

PLEASE IGNORE THIS !
This post was made late in the night in the middle of frenzied network troubleshooting. I was not thinking stright. It is not possible to configure DHCP for ue0 on bootup, and given the nature of USB Tethering, it is not useful even if it did exist. You will always have the delay needed to go to the phone's GUI and enable tethering. Then your phone will talk to the kernel . And of course, you won't need this all the time, so it makes no sense to wait 30 seconds while ifconfig waits for an non existant ue0.

TL;DR :

So basically it seems as though we aren't able to setup ue0 for ifconfig_ue0="DHCP" during boot. But, simply doing a sudo dhclient ue0 lets it work. Why, and what can be done to fix this ?

DETAILS :

Android 11 , Security patch level June 1 2021 , Kernel 4.14.113-21183318, Samsung Mxx phone.
Nomad BSD 130R-20210508 , i.e., FreeBSD 13.0-RELEASE-p3.

Code:
$ping 1.1.1.1
ping: sendto: No route to host
$ifconfig
em0: flags=8863<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=481249b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LRO,WOL_MAGIC,VLAN_HWFILTER,NOMAP>
        ether 20:c6:eb:08:9e:a5
        inet6 fe80::22c6:ebff:fe08:9ea5%em0 prefixlen 64 scopeid 0x1
        media: Ethernet autoselect
        status: no carrier
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,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=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 02:36:1c:0f:18:74
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL
$netstat -r
Routing tables

Internet:
Destination        Gateway            Flags     Netif Expire
localhost          link#2             UH          lo0

Internet6:
Destination        Gateway            Flags     Netif Expire
::/96              localhost          UGRS        lo0
localhost          link#2             UHS         lo0
::ffff:0.0.0.0/96  localhost          UGRS        lo0
fe80::/10          localhost          UGRS        lo0
fe80::%em0/64      link#1             U           em0
fe80::22c6:ebff:fe link#1             UHS         lo0
fe80::%lo0/64      link#2             U           lo0
fe80::1%lo0        link#2             UHS         lo0
ff02::/16          localhost          UGRS        lo0

Relevant parts of /etc/rc.conf :
Code:
ifconfig_em0="DHCP"
ifconfig_em0_ipv6="inet6 accept_rtadv"
ifconfig_ue0="DHCP"

Relevant parts of dmesg :
Code:
ugen0.2: <SAMSUNG SAMSUNGAndroid> at usbus
lo0: link state changed to UP
...
urndis0 on uhub1
urndis0: <RNDIS Communications Control> on usbus0
ue0: <USB Ethernet> on urndis0
ue0: Ethernet address: 02:36:1c:0f:18:7

Relevant parts of bootup messages : Waiting 30s for the default router interface........... (it waits for quite long).
 
Last edited by a moderator:
No. Not unless you have got a dhcp server running on your android. Have not got one on mine.

Find out what IP address your android uses from the settings, and ifconfig ue0 another address on the same /24. Set the default route to be the IP of the android.
 
Back
Top