Closed louies0623 closed 1 year ago
Can you please provide specifics: Android/iOS version? Do you see anything related to it when you type dmesg
?
Galaxy A70, android 11, No
I wonder whether we should set all of
if_urndis_load="YES"
if_cdce_load="YES"
if_ipheth_load="YES"
by default...
Haven't work.
Here is a Hardware Probe of someone who is using an Android phone connected via USB and using dhclient ue0
:
https://bsd-hardware.info/?probe=8ae819f673
Note the SOV41 RNDIS Communications Control RNDIS Ethernet Data
.
https://www.freebsd.org/cgi/man.cgi?query=urndis&sektion=4
So it seems we have at least some support for Android USB tethered phones.
Tried this, it works for me with an Android phone
sudo kldload /boot/kernel/if_urndis.ko
sudo dmesg | tail
should show ue0: <USB Ethernet> on urndis0
ifconfig ue0 up
dhclient ue0
At this point you should be connected.Note that this works not only for using cellular but also for using the Android device to access WLAN, which might come handy in situations where the WLAN hardware on your device is not supported by FreeBSD yet.
Now the question is, how can we automate all of this so that no commands need to be typed in by the user?
/boot/loader.conf
:
kld_list="<...> if_urndis if_cdce if_ipheth"
For all kernel modules that are not essential for mounting the root device use kld_list
, because
kld_list (str) A list of kernel modules to load right after the local disks are mounted. Loading modules at this point in the boot process is much faster than doing it via /boot/loader.conf for those modules not necessary for mounting local disk.
ue*
device shows up. Probably we can do this with devd(8)? Strangely, the default /etc/devd.conf
does not seem to handle these devices?Inspecting what udev does when a tethering device is attached with sudo service devd stop && sudo devd -d 2>&1 | grep Executing
, then switing on tethering on the Android device shows:
Executing '/etc/pccard_ether $'ue0' start'
Executing '/usr/libexec/hyperv/hyperv_vfattach $'ue0' 0'
So what is missing is sudo service dhclient quietstart ue0
. To change that, create /usr/local/etc/devd/android_tethering.conf
with the following content (tested):
# DHCP for USB Ethernet devices, e.g., Android phones with USB Tethering
notify 100 {
match "system" "ETHERNET";
match "subsystem" "(ue)[0-9]+";
match "type" "IFATTACH";
action "/usr/sbin/service dhclient quietstart $subsystem";
};
For iOS devices it may be more complicated, as it may be necessary to run usbmuxd(1) (from comms/usbmuxd): https://man.freebsd.org/cgi/man.cgi?query=if_ipheth&sektion=4.
When the mobile phone is connected to the computer with usb tethering, it does not working the computer to connect to the network.