From owner-freebsd-net@freebsd.org Fri Apr 17 10:00:37 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C69142B1852 for ; Fri, 17 Apr 2020 10:00:37 +0000 (UTC) (envelope-from danielmorandini@me.com) Received: from st43p00im-zteg10072001.me.com (st43p00im-zteg10072001.me.com [17.58.63.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 493Wn10SnCz4rtT for ; Fri, 17 Apr 2020 10:00:36 +0000 (UTC) (envelope-from danielmorandini@me.com) Received: from [172.20.10.2] (unknown [37.160.250.221]) by st43p00im-zteg10072001.me.com (Postfix) with ESMTPSA id 82BD3C05DF for ; Fri, 17 Apr 2020 10:00:34 +0000 (UTC) From: Daniel Morandini Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: ipheth device and iPhone tetheting Message-Id: Date: Fri, 17 Apr 2020 12:00:22 +0200 To: freebsd-net@freebsd.org X-Mailer: Apple Mail (2.3608.60.0.2.5) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-17_03:2020-04-17, 2020-04-17 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-2002250000 definitions=main-2004170079 X-Rspamd-Queue-Id: 493Wn10SnCz4rtT X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.60 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16]; FREEMAIL_FROM(0.00)[me.com]; TO_DN_NONE(0.00)[]; MV_CASE(0.50)[]; DKIM_TRACE(0.00)[me.com:+]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; RECEIVED_SPAMHAUS_PBL(0.00)[221.250.160.37.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; RCVD_IN_DNSWL_LOW(-0.10)[167.63.58.17.list.dnswl.org : 127.0.5.1]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:714, ipnet:17.58.63.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[me.com]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_LOW(-1.00)[me.com.dwl.dnswl.org : 127.0.5.1]; IP_SCORE(0.00)[ip: (-2.48), ipnet: 17.58.63.0/24(-1.72), asn: 714(-2.47), country: US(-0.05)]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2020 10:00:37 -0000 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 . 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=E2=80=9D. Digging around the web you=E2=80=99ll 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=E2=80=99ll get your interface. This time dhclient is able to obtain = a lease, but you=E2=80=99ll not get internet out of that (at least, = I=E2=80=99m not): ``` # ifconfig lo0: flags=3D8049 metric 0 mtu 16384 options=3D680003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 inet 127.0.0.1 netmask 0xff000000 groups: lo nd6 options=3D21 ue0: flags=3D8843 metric 0 mtu = 1500 options=3D80009 ether b8:27:eb:ed:a1:c9 media: Ethernet autoselect (none) status: no carrier nd6 options=3D29 ue1: flags=3D8843 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=3D29 ``` ``` # 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=E2=80=99m = available for helping, but I need some guidance. Greetings, Daniel [1] = https://forums.freebsd.org/threads/howto-iphone-internet-connection-sharin= g-via-usb.19995/