Friday, March 20, 2026

Setting up tftp-hpa on FreeBSD, 5 URLs to read

 Setting up tftp-hpa on FreeBSD,  5 urls to read

 

https://wiki.freebsd.org/PXE%3ATFTPd%20Setup 

https://eradman.com/posts/automated-freebsd-install.html 

 https://www.siberoloji.com/how-to-set-up-a-tftp-server-on-freebsd-operating-system/

https://www.siberoloji.com/how-to-implement-diskless-booting-on-freebsd-operating-system/ 

https://blog.prag.dev/using-freebsds-sysrc-and-serving-tftp-resources 

https://man.freebsd.org/cgi/man.cgi?query=tftpd&sektion=8&format=html   tftpd manual page

https://github.com/WillChamness/Dnsmasq-PXE   Setup DNSmasq for Ubuntu ; reference

iPXE boot for FreeBSD with an UEFI BIOS

https://www.tunbury.org/2025/05/06/freebsd-uefi/  tftp with freebsd uefi  /boot/loader.efi  file

 root@flf_FBSD_15_STABLE:~ # whereis tftpd
tftpd: /usr/libexec/tftpd /usr/share/man/man8/tftpd.8.gz /usr/src/libexec/tftpd
root@flf_FBSD_15_STABLE:~ # ls -l /usr/libexec/tf*
-r-xr-xr-x  1 root wheel 101552 Mar 17 18:41 /usr/libexec/tftp-proxy
-r-xr-xr-x  1 root wheel  39168 Mar 14 23:58 /usr/libexec/tftpd
root@flf_FBSD_15_STABLE:~ # ls -ld /usr/libexec/tf*
-r-xr-xr-x  1 root wheel 101552 Mar 17 18:41 /usr/libexec/tftp-proxy
-r-xr-xr-x  1 root wheel  39168 Mar 14 23:58 /usr/libexec/tftpd
root@flf_FBSD_15_STABLE:~ # tftpd
sh: tftpd: not found
root@flf_FBSD_15_STABLE:~ # echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
root@flf_FBSD_15_STABLE:~ # PATH=$PATH:/usr/libexec
root@flf_FBSD_15_STABLE:~ # echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin:/usr/libexec
root@flf_FBSD_15_STABLE:~ # tftpd --version
tftpd: illegal option -- -
tftpd: illegal option -- v
tftpd: illegal option -- e
tftpd: illegal option -- r
root@flf_FBSD_15_STABLE:~ # tftpd -version
tftpd: illegal option -- v
tftpd: illegal option -- e
tftpd: illegal option -- r

sudo service inetd start
sudo service inetd status
root@flf_FBSD_15_STABLE:~ # sudo service inetd start
Starting inetd.
root@flf_FBSD_15_STABLE:~ # sudo service inetd status
inetd is running as pid 74882.
root@flf_FBSD_15_STABLE:~ # 
 
#search for inetd pid 74882 using grep
root@flf_FBSD_15_STABLE:~ # ps aux | grep 74882
root 74882 0.0 0.0 14360 2836 - Is 00:58 0:00.00 /usr/sbin/inetd -wW -C 60
root 75590 0.0 0.0 14176 2676 2 S+ 01:03 0:00.00 grep 74882


root@flf_FBSD_15_STABLE:~ # ls -l /tftpboot
total 0
root@flf_FBSD_15_STABLE:~ # ls -la /tftpboot
total 9
drwxrwxrwx 2 root wheel 2 Mar 20 00:16 .
drwxr-xr-x 21 root wheel 24 Mar 20 00:16 ..
root@flf_FBSD_15_STABLE:~ # echo "This is a test file." > /tftpboot/testfile.txt
root@flf_FBSD_15_STABLE:~ #
root@flf_FBSD_15_STABLE:~ # ls -la /tftpboot
total 10
drwxrwxrwx 2 root wheel 3 Mar 20 01:07 .
drwxr-xr-x 21 root wheel 24 Mar 20 00:16 ..
-rw-r--r-- 1 root wheel 21 Mar 20 01:07 testfile.txt
root@flf_FBSD_15_STABLE:~ #
 
sudo ipfw add allow udp from any to any 69
root@flf_FBSD_15_STABLE:~ # sudo ipfw add allow udp from any to any 69
ipfw: getsockopt(IP_FW_XADD): Protocol not available
root@flf_FBSD_15_STABLE:~ # 

 

DRM-KMOD, checking what drm-kmod version is installed, what firmware files got loaded with dmesg

DRM-KMOD,  checking what drm-kmod version is installed, what firmware files got loaded with dmesg output

 
On FreeBSD, the active DRM kernel module is generally provided by the
drm-kmod meta-port, which installs drm-510-kmod (Linux 5.10) for FreeBSD 13/14, or drm-515-kmod / drm-61-kmod for newer versions. The specific module loaded is usually i915kms (Intel), amdgpu (AMD), or radeon.
How to check which is installed/loaded:
  • List installed DRM packages: pkg info | grep drm
  • Check currently loaded modules: kldstat | grep kms
Common DRM Module Drivers:
  • amdgpu: For AMD GPUs (HD7000 series and newer).
  • i915kms: For Intel integrated graphics (Sandy Bridge and newer).
  • radeon: For older AMD/ATI Radeon GPUs.
Commonly Used Meta-Ports:
  • graphics/drm-510-kmod (commonly used for 14.1)
  • graphics/drm-515-kmod (common on 14.2+)
  • graphics/drm-61-kmod (for latest kernels)
You can verify the active driver with sysctl dev.drm
 
root@flf_FBSD_15_STABLE:~ #  sysctl dev.drm
dev.drm.drm_debug_persist: 0
dev.drm.skip_ddb: 0
dev.drm.__drm_debug: 0
 
 
 
 
 
 
TFTP install
 

Step 2: Install the TFTP Server Software

FreeBSD provides a TFTP server implementation as part of the net/tftp-hpa package. This package includes both the TFTP server (tftpd) and client (tftp). To install it, use the pkg package manager:

sudo pkg install tftp-hpa 
root@flf_FBSD_15_STABLE:~ # sudo pkg install tftp-hpa
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
tftp-hpa: 5.2_3 [FreeBSD-ports]

Number of packages to be installed: 1

41 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching tftp-hpa-5.2_3: 100%    41 KiB  41.7 kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/1] Installing tftp-hpa-5.2_3...
[1/1] Extracting tftp-hpa-5.2_3: 100%
=====
Message from tftp-hpa-5.2_3:

--
===> NOTICE:

The tftp-hpa port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing
 

 

Once the installation is complete, verify that the package was installed correctly:

tftpd --version 
root@flf_FBSD_15_STABLE:~ # tftpd --version
sh: tftpd: not found
 
root@flf_FBSD_15_STABLE:~ # pkg info tftp-hpa
tftp-hpa-5.2_3
Name : tftp-hpa
Version : 5.2_3
Installed on : Thu Mar 19 23:45:08 2026 PDT
Origin : ftp/tftp-hpa
Architecture : FreeBSD:15:amd64
Prefix : /usr/local
Categories : ftp
Licenses : BSD4CLAUSE
Maintainer : ports@FreeBSD.org
WWW : UNKNOWN
Comment : Advanced TFTP server
Options :
DOCS : on
Shared Libs required:
libc.so.7
libwrap.so.6
Annotations :
FreeBSD_version: 1500068
build_timestamp: 2026-02-28T04:30:49+0000
built_by : poudriere-git-3.4.5-7-g21c69a49
port_checkout_unclean: no
port_git_hash : b64b73fd938d5b2788547d16ed6a76493acc9142
ports_top_checkout_unclean: no
ports_top_git_hash: df4f957ea181e02b372261e71f9067e9e37d7369
repo_type : binary
repository : FreeBSD-ports
Flat size : 86.6KiB
Description :
tftp-hpa is portable, BSD derived tftp server. It supports advanced
options such as blksize, blksize2, tsize, timeout, and utimeout.
It also supported rulebased security options.

Step 3: Configure the TFTP Server

The TFTP server on FreeBSD is typically managed by the inetd or xinetd super server, which handles network services. In this guide, we will use inetd, which is included in the FreeBSD base system.

3.1 Enable the inetd Service

First, enable the inetd service by editing the /etc/rc.conf file. You can do this using the sysrc command:

sudo sysrc inetd_enable="YES" 
root@flf_FBSD_15_STABLE:~ # sudo sysrc inetd_enable="YES"
inetd_enable: NO -> YES
 
 
 AUTOMATED Freebsd install https://eradman.com/posts/automated-freebsd-install.html 
root@flf_FBSD_15_STABLE:~ #  tftp-hpa --version
sh: tftp-hpa: not found
root@flf_FBSD_15_STABLE:~ # tftpd --version
sh: tftpd: not found
root@flf_FBSD_15_STABLE:~ # tftp --version
tftp: Name could not be resolved at this time
tftp>
tftp> help
Commands may be abbreviated. Commands are:

connect connect to remote tftp
mode set file transfer mode
put send file
get receive file
quit exit tftp
verbose toggle verbose mode
status show current status
binary set mode to octet
ascii set mode to netascii
rexmt set per-packet retransmission timeout[-]
timeout set total retransmission timeout
trace enable 'debug packet'[-]
debug enable verbose output
blocksize set blocksize[*]
blocksize2 set blocksize as a power of 2[**]
rollover rollover after 64K packets[**]
options enable or disable RFC2347 style options
help print help information
packetdrop artificial packetloss feature
windowsize set windowsize[*]
? print help information

[-] : You shouldn't use these ones anymore.
[*] : RFC2347 options support required.
[**] : Non-standard RFC2347 option.
tftp>
 



 
 
 

This command should display the version of the TFTP server software, confirming that the installation was successful.



 
 
 
 
 

Step 1: Update the FreeBSD System

sudo freebsd-update fetch
sudo freebsd-update install
sudo pkg update
sudo pkg upgrade

Step 2: Install the TFTP Server Software

sudo pkg install tftp-hpa