From nobody Wed Nov 15 05:44:28 2023 X-Original-To: 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 4SVXDM6NX7z50w5T for ; Wed, 15 Nov 2023 05:44:35 +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 4SVXDL4lnVz4vVl for ; Wed, 15 Nov 2023 05:44:34 +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.60.234] (helo=c720-1400094.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1r38hS-00F0Eq-BP; Wed, 15 Nov 2023 06:44:30 +0100 Received: from c720-1400094.fritz.box (localhost [127.0.0.1]) by c720-1400094.unixarea.de (8.17.1/8.14.9) with ESMTP id 3AF5iTup002220; Wed, 15 Nov 2023 06:44:29 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by c720-1400094.fritz.box (8.17.1/8.14.9/Submit) id 3AF5iSY5002219; Wed, 15 Nov 2023 06:44:28 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: c720-1400094.fritz.box: guru set sender to guru@unixarea.de using -f Date: Wed, 15 Nov 2023 06:44:28 +0100 From: Matthias Apitz To: questions@freebsd.org Cc: Arthur Chance , Alexander Burke Subject: Re: USB tethering between FreeBSD and mobile phone (Debian OS) Message-ID: Reply-To: Matthias Apitz References: <65b7ecef-b189-4350-a246-3cab934151fd@alexburke.ca> <091f7b66-ce45-4cf4-a4a9-6cd1de66c09b@qeng-ho.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 In-Reply-To: X-Operating-System: FreeBSD 14.0-CURRENT r1400094 (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.60.234 X-Spamd-Result: default: False [-3.70 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; 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]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MLMMJ_DEST(0.00)[questions@freebsd.org]; HAS_REPLYTO(0.00)[guru@unixarea.de]; DMARC_NA(0.00)[unixarea.de]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; HAS_XOIP(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:42730, ipnet:178.254.0.0/19, country:DE]; RCPT_COUNT_THREE(0.00)[3]; HAS_XAW(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Queue-Id: 4SVXDL4lnVz4vVl X-Spamd-Bar: --- Just to end this thread: How to tether the mobile phone Purism Librem 5 with FreeBSD guru@unixarea.de, November 2023 The Purism Librem 5 (L5) runs PureOS, a Debian variant, but no DHCP server. When an USB-C cable connection between the laptop and the L5 is made, the NetworkManager in the L5 sees the carrier in the network interface 'usb0' and launches a DHCP client on the interface. All we have to do, or what can be done, is launching a DHCP server on the interface 'ue0'. Here is it's configuration. Build and install the port net/isc-dhcp44-server. We just use one of the existing example configuration from /usr/local/etc/dhcpd.conf: ... # A slightly different configuration for an internal subnet. subnet 10.5.5.0 netmask 255.255.255.224 { range 10.5.5.26 10.5.5.30; option domain-name-servers ns1.internal.example.org; option domain-name "internal.example.org"; option routers 10.5.5.1; option broadcast-address 10.5.5.31; default-lease-time 600; max-lease-time 7200; } ... Lines for /etc/rc.conf: ifconfig_ue0="inet 10.5.5.26 netmask 255.255.255.224" dhcpd_enable="YES" dhcpd_ifaces="ue0" And at the end we let devd(8) do its job when the USB-C connection is made with this configuration: /usr/local/etc/devd/l5.conf: notify 1 { match "system" "IFNET"; match "subsystem" "ue0"; match "type" "ATTACH"; action "/usr/local/etc/devd/l5.sh"; }; /usr/local/etc/devd/l5.sh: #!/bin/sh # ifconfig ue0 inet 10.5.5.26 netmask 255.255.255.224 /usr/local/etc/rc.d/isc-dhcpd restart Now you can run from the laptop ssh purism@10.5.5.27 and from there back: ssh guru@10.5.5.26 -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub I am not at war with Russia. Я не воюю с Россией. Ich bin nicht im Krieg mit Russland.