Re: USB tethering between FreeBSD and mobile phone (Debian OS)
- Reply: Alexander Burke : "Re: USB tethering between FreeBSD and mobile phone (Debian OS)"
- Reply: Odhiambo Washington : "Re: USB tethering between FreeBSD and mobile phone (Debian OS)"
- In reply to: Matthias Apitz : "Re: USB tethering between FreeBSD and mobile phone (Debian OS)"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 15 Nov 2023 05:44:28 UTC
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.