From nobody Tue Nov 14 06:09:03 2023 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4STwqC01JTz50XTj for ; Tue, 14 Nov 2023 06:09:11 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4STwqB244vz3M5X for ; Tue, 14 Nov 2023 06:09:10 +0000 (UTC) (envelope-from guru@unixarea.de) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of guru@unixarea.de designates 178.254.4.101 as permitted sender) smtp.mailfrom=guru@unixarea.de; dmarc=none Received: from [188.174.55.85] (helo=pureos) by ms-10.1blu.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r2mbi-00DoEd-3I for freebsd-questions@freebsd.org; Tue, 14 Nov 2023 07:09:06 +0100 Date: Tue, 14 Nov 2023 07:09:03 +0100 From: Matthias Apitz To: freebsd-questions@freebsd.org Subject: USB tethering between FreeBSD and mobile phone (Debian OS) Message-ID: Reply-To: Matthias Apitz Mail-Followup-To: freebsd-questions@freebsd.org List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: FreeBSD 14.0-CURRENT 1400094 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 188.174.55.85 X-Spamd-Result: default: False [-2.18 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; NEURAL_HAM_LONG(-0.59)[-0.587]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.50)[-0.496]; RWL_MAILSPIKE_EXCELLENT(-0.40)[178.254.4.101:from]; R_SPF_ALLOW(-0.20)[+ip4:178.254.4.101]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:42730, ipnet:178.254.0.0/19, country:DE]; MIME_TRACE(0.00)[0:+]; TO_DN_NONE(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_XOIP(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[unixarea.de]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; HAS_REPLYTO(0.00)[guru@unixarea.de] X-Rspamd-Queue-Id: 4STwqB244vz3M5X X-Spamd-Bar: -- Hello, When I connect my Debian mobile phone Purism L5 to my beloved FreeBSD laptop with an USB-C cable, on both ends exists (L5: usb0) or come up (FreeBSD: ue0) a network interface: mobile phone: ifconfig usb0 usb0: flags=4163 mtu 1500 ether 96:06:ad:58:63:9d txqueuelen 1000 (Ethernet) RX packets 448488 bytes 31739673 (30.2 MiB) RX errors 6 dropped 0 overruns 0 frame 0 TX packets 306592 bytes 3677180864 (3.4 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 FreeBSD 14.0-CURRENT: ifconfig ue0 ue0: flags=1008843 metric 0 mtu 1500 options=80000 ether 3e:07:40:6d:13:91 inet6 fe80::3c07:40ff:fe6d:1391%ue0 prefixlen 64 scopeid 0x3 media: Ethernet autoselect status: active nd6 options=23 but nothing else happens in the sense of DHCP; a dhcpclient seems to be started on FreeBSD for this interface ue0. I can use "ifconfig ue0 10.0.1.1" on FreeBSD and on the L5 "ifconfig 10.0.1.2" and can run fine "ssh purism@10.0.1.2" from FreeBSD to the L5. What could I do that the IP addrs get assigned automatically? In the past I did the same with an Ubuntu mobile the IP addr was assigned as 10.42.0.2 to FreeBSD and the phone has 10.42.0.1 which let me think that the DHCP service came from the mobile. When I do the same USB-C connection using my MacBook Pro, IP addresses get assigned automatically as: purism@pureos:~$ ifconfig usb0 usb0: flags=4163 mtu 1500 inet 192.168.33.2 netmask 255.255.255.0 broadcast 192.168.33.255 inet6 fe80::4d93:bdb7:ac4b:698 prefixlen 64 scopeid 0x20 ether 96:06:ad:58:63:9d txqueuelen 1000 (Ethernet) RX packets 1799784 bytes 111111162 (105.9 MiB) RX errors 18 dropped 0 overruns 0 frame 0 TX packets 548389 bytes 7352130824 (6.8 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ~ apitzm$ ifconfig en7 en7: flags=8863 mtu 1500 options=404 ether 3e:07:40:6d:13:91 inet6 fe80::18de:caef:aa2d:3bd6%en7 prefixlen 64 secured scopeid 0x13 inet 192.168.33.1 netmask 0xffffff00 broadcast 192.168.33.255 nd6 options=201 media: autoselect (100baseTX ) status: active This is because in the MacOS some DHCP services is started with #!/bin/sh # # start the DHCP server in MacOS # see also: # https://www.swissns.ch/site/2014/05/running-mac-os-xs-built-in-dhcp-server/ # config file: /etc/bootpd.plist # # guru@unixarea.de, March 2023 # start: # sudo /bin/launchctl load -w /System/Library/LaunchDaemons/bootps.plist -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub