ipheth device and iPhone tetheting
Daniel Morandini
danielmorandini at me.com
Fri Apr 17 10:00:37 UTC 2020
Hi folks,
Obtaining an Internet access from an iOS device connected via USB is currently quite a pain.
The flow is supposed to be something like:
1. load the ipheth module
2. plug in the iOS device with tethering enabled
3. a new ueN interface is created
4. dhclient ueN
and you should have a new gateway. At least this is what I expect, which is similar to what happens when connecting an Android device with tethering enabled, the only difference being you have to use the urndis module.
After step 3 instead the ipheth module is not capable of creating the interface, and you have to actually configure the device manually as explained in the ipheth(4) BUG note, using `usbconfig -d <unit>.<addr> 2 set_config 3`.
This triggers an authentication request on the iPhone, and after that the interface is eventually created, but the dhclient is not able to obtain a lease with it, "No DHCPOFFERS received”.
Digging around the web you’ll eventually find this guide [1] which, even though it is quite old (10 yrs now), points to the right direction: usbmuxd and libimobiledevice.
The usbmuxd is available as a port now, under comms/usbmuxd (not maintained though). Install, run the daemon, plug the phone again and you’ll get your interface. This time dhclient is able to obtain a lease, but you’ll not get internet out of that (at least, I’m not):
```
# ifconfig
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 0x1
inet 127.0.0.1 netmask 0xff000000
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80009<RXCSUM,VLAN_MTU,LINKSTATE>
ether b8:27:eb:ed:a1:c9
media: Ethernet autoselect (none)
status: no carrier
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
ue1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 7e:a1:ae:6a:11:1d
inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
```
```
# netstat -rn
Routing tables
Internet:
Destination Gateway Flags Netif Expire
0.0.0.0/8 link#3 U ue1
127.0.0.1 link#1 UH lo0
Internet6:
Destination Gateway Flags Netif Expire
::/96 ::1 UGRS lo0
::1 link#1 UH lo0
::ffff:0.0.0.0/96 ::1 UGRS lo0
fe80::/10 ::1 UGRS lo0
fe80::%lo0/64 link#1 U lo0
fe80::1%lo0 link#1 UHS lo0
ff02::/16 ::1 UGRS lo0
```
```
# uname -a
FreeBSD generic 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC arm
```
Long story short: do we want to work on this issue? I’m available for helping, but I need some guidance.
Greetings,
Daniel
[1] https://forums.freebsd.org/threads/howto-iphone-internet-connection-sharing-via-usb.19995/
More information about the freebsd-net
mailing list