From nobody Tue Nov 14 17:40:17 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 4SVD5Y0kNXz51cWV for ; Tue, 14 Nov 2023 17:37:37 +0000 (UTC) (envelope-from alex@alexburke.ca) Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [IPv6:2001:41d0:203:375::b4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4SVD5X5cZcz3W8K for ; Tue, 14 Nov 2023 17:37:36 +0000 (UTC) (envelope-from alex@alexburke.ca) Authentication-Results: mx1.freebsd.org; none Message-ID: <0fc4bf45-cec4-431f-9c23-5c53ec628a15@alexburke.ca> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alexburke.ca; s=key1; t=1699983446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c+Id+SW71Sb0rCu+31GOX85y4YF+sX0j2LKnA7y+kTI=; b=NZixBMTt16bw+DDoVWK5kiRIE6bYXzwnWndn1C1Px0IoLBD6GQoopOnuknNR6Pr/0RmzuW T3LSjt1QIO13+EBkt3ekJEYes0mbkQSDteGhzzc+hUA9TfCUfUxExHQ/U8qCSOgAXdpIBR 2Bb9sQpg6/SHi2BW4Hetkz4ax0YF3Mo= Date: Tue, 14 Nov 2023 18:40:17 +0100 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 Subject: Re: USB tethering between FreeBSD and mobile phone (Debian OS) Content-Language: fr, es-ES, ca, en-CA To: questions@freebsd.org Cc: Matthias Apitz References: <65b7ecef-b189-4350-a246-3cab934151fd@alexburke.ca> <091f7b66-ce45-4cf4-a4a9-6cd1de66c09b@qeng-ho.org> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Alexander Burke In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16276, ipnet:2001:41d0::/32, country:FR] X-Rspamd-Queue-Id: 4SVD5X5cZcz3W8K Hi again Matthias, When tethering a laptop to a mobile phone, the phone is generally the DHCP server and the laptop is the DHCP client. Is there a specific reason you want to run it the other way around, or have I misunderstood something? You said there is indeed a DHCP server running on the phone; have you tried what I suggested? Cheers, Alex On 2023-11-14 17:56, Matthias Apitz wrote: > El día martes, noviembre 14, 2023 a las 11:20:05a. m. -0100, Arthur Chance escribió: > >> On 14/11/2023 08:27, Alexander Burke wrote: >>> Hi Mathias, >>> >>> I added a single line in `/etc/rc.conf` to take care of this >>> automagically when I need to tether via USB to my Pixel running >>> GrapheneOS (which also produces a `ue0` interface on the FreeBSD side): >>> >>> ifconfig_ue0="up SYNCDHCP" >>> >>> IIRC, I found this solution here: >>> https://forums.freebsd.org/threads/wireless-setup-and-syncdhcp.41488/ >>> >>> I'm usually not tethering so it thus causes a slight delay at boot >>> because the interface isn't up at that point and boot is paused until >>> this times out, but it causes `dhclient` to remain running and fetch an >>> address whenever it does come up. >>> >>> It's possible this isn't the best way to do it; perhaps others can chime >>> in to improve further on this implementation. >> >> I've never used tethering so this is just a suggestion, but isn't this >> the sort of thing that ought to be handled by devfs with a conf file in >> /etc/devd. Have a rule that notices when ue0 attaches (and possibly on >> detaching as well) and Do The Right Thing at that point. > > I've checked the log file on the mobile phone in /var/log/syslog. The > phone's NetworkManager sees the carrier on usb0 and waits 45 secs for > DHCP requests being fulfilled. This way it works also fine with the > MacBook as laptop. There is running some DHCP server on interface en7 > and the mobile gets it IP addr from it. > > I will start my poudriere oven to compile the port net/isc-dhcp44-server. > > matthias >