Spare Parts into Stratum 1 NTP Server with OpenBSD
Spare Parts into Stratum 1 NTP Server with OpenBSD
Over the long weekend, I built a stratum 1 NTP server using OpenBSD. I repurposed spare storage, RAM, and an old firewall into a functional system. The base of this setup is a Protectli FW2B running an Intel(R) Celeron(R) CPU J3060 @ 1.60GHz. I retrieved an old Protectli 120GB SSD from the spare parts bin and found 4 GB of RAM that worked in the chassis. OpenBSD 7.7 installs quickly, and within minutes, I had a fully operational system drawing about 16 watts of power. Select output from sysctl hw
shows the hardware:
hw.machine=amd64
hw.model=Intel(R) Celeron(R) CPU J3060 @ 1.60GHz
hw.ncpu=2
...
hw.diskcount=1
hw.sensors.cpu0.temp0=32.00 degC
hw.sensors.cpu0.frequency0=2500000000.00 Hz
hw.sensors.cpu1.frequency0=2500000000.00 Hz
...
hw.vendor=Protectli
hw.product=FW2B
hw.version=1.0
hw.physmem=4224737280
Experiment with GPS Using Spare Parts
A week prior, I tested an old BU-353S4 GPS receiver from GlobalSat, leftover from prior projects. I connected it to an old Pine64 Linux machine, also leftover. This GPS-only device failed to acquire a signal after an overnight attempt. While the location isn’t ideal, it has a mostly clear view of the sky. Tools like ubxtool
and gpsmon
indicated the receiver detected 12 satellites—enough for a fix. However, it still couldn’t establish a reliable connection. After experimenting with mounting options and more advanced antennas, I concluded that a newer, cheaper alternative would be better.
I ordered the BU-353N5 from GlobalSat for roughly $50, which arrived before the long weekend. Enabling GPS, GLONASS, Galileo, and Beidou yielded a reliable signal. The newer device, placed in the same location, clearly outperformed the 10-year-old hardware. I switched to this setup last weekend, as described above.
On OpenBSD, you don’t need gpsd
—everything required is built-in. The process is straightforward:
1. Plug in the USB GNSS receiver into a USB port. Confirm OpenBSD recognizes it:
doas usbdevs
067b:23a3 Prolific Technology Inc., USB-Serial Controller
2. Attach the tty to the nmea module:
doas ldattach nmea cua0
You should now see the GPS in sysctl hw.sensors.nmea0
:
hw.sensors.nmea0.indicator0=On (Signal), OK
hw.sensors.nmea0.timedelta0=-0.016030 secs (GPS autonomous), OK, Tue May 27 21:30:14.983
3. Add the GPS sensor to /etc/ntpd
:
echo "sensor nmea0 refid GPS weight 5 trusted" | doas tee -a /etc/ntpd.conf
4. Add the ldattach nmea
to /etc/ttys
:
echo "tyU0 \"/sbin/ldattach nmea\" unknown on softcar" | doas tee -a /etc/ttys
This will ensure the GPS feed to nmea survives rebooting.
5. Wait a few minutes. Check the ntp sensor status with ntpctl -sS
:
sensor
wt gd st next poll offset correction
nmea0 GPS
* 5 1 0 15s 15s 19.204ms 0.000ms
If you see some output like that, it's working. You now have a stratum 1 ntp server.
I’m not the first to do this, but I intentionally built it from first principles, relying only on man pages. OpenBSD’s documentation is exceptional. While I aimed to use only spare parts, the lack of a GPS signal cost $50 for a newer receiver. It works—ta-da!