Re: USB tethering between FreeBSD and mobile phone (Debian OS)

From: Matthias Apitz <guru_at_unixarea.de>
Date: Tue, 14 Nov 2023 16:56:54 UTC
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

-- 
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.