Well, I did it. I got CUPS working with my network Brother mono laser. It wasn't easy, so I took detailed notes and I've posted them here for any fellow sufferers to use:
Fresh install of FreeBSD using static IP (192.168.0.6):
uname -a
FreeBSD acer 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n263002-743516d51fa7: Thu May 18 07:36:18 UTC 2023 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/i386.i386/sys/GENERIC i386
Install CUPS and Avahi (about 30 minutes):
# pkg install cups cups-filters avahi nss_mdss
(Note: It might be better to use avahi-app)
Edit /etc/rc.conf
Add:
cupsd_enable="YES"
devfs_system_ruleset=desktop
dbus_enable="YES"
avahi_daemon_enable="YES"
Edit /etc/devfs.rules
Add:
add path 'lpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'unlpt*' mode 0660 group cups
Edit /etc/nsswitch.conf like this:
#
# nsswitch.conf(5) - name service switch configuration file
# $FreeBSD$
#
group: compat
group_compat: nis
hosts: mdns4_minimal [NOTFOUND=return] files dns
netgroup: compat
networks: files
passwd: compat
passwd_compat: nis
shells: files
services: compat
services_compat: nis
protocols: files
rpc: files
Modify cupsd.conf:
edit /usr/local/etc/cups/cupsd.conf
# Restrict access to the server...
<Location />
Order allow,deny
allow 192.168.0.*
# mg ^^^^
satisfy any
# mg ^^^^^
</Location>
# Restrict access to the admin pages...
<Location /admin>
Order allow,deny
allow 192.168.0.*
# mg ^^^^^^
</Location>
# Only listen for connections from the local machine.
# Listen localhost:631
Port 631
#mg ^^^
Restart
# shutdown -r now
Access web interface at 192.168.0.6:631
select printer maker - generic
select printer - PCL
Description: Brother HL-2150N series
Location: Local Printer
Driver: Generic PCL Laser Printer (grayscale)
Connection: dnssd://Brother%20HL-2150N%20series._pdl-datastream._tcp.local/
Defaults: job-sheets=none, none media=iso_a4_210x297mm sides=one-sided
Great success. Feel free to add improvements below.
Fresh install of FreeBSD using static IP (192.168.0.6):
uname -a
FreeBSD acer 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n263002-743516d51fa7: Thu May 18 07:36:18 UTC 2023 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/i386.i386/sys/GENERIC i386
Install CUPS and Avahi (about 30 minutes):
# pkg install cups cups-filters avahi nss_mdss
(Note: It might be better to use avahi-app)
Edit /etc/rc.conf
Add:
cupsd_enable="YES"
devfs_system_ruleset=desktop
dbus_enable="YES"
avahi_daemon_enable="YES"
Edit /etc/devfs.rules
Add:
add path 'lpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'unlpt*' mode 0660 group cups
Edit /etc/nsswitch.conf like this:
#
# nsswitch.conf(5) - name service switch configuration file
# $FreeBSD$
#
group: compat
group_compat: nis
hosts: mdns4_minimal [NOTFOUND=return] files dns
netgroup: compat
networks: files
passwd: compat
passwd_compat: nis
shells: files
services: compat
services_compat: nis
protocols: files
rpc: files
Modify cupsd.conf:
edit /usr/local/etc/cups/cupsd.conf
# Restrict access to the server...
<Location />
Order allow,deny
allow 192.168.0.*
# mg ^^^^
satisfy any
# mg ^^^^^
</Location>
# Restrict access to the admin pages...
<Location /admin>
Order allow,deny
allow 192.168.0.*
# mg ^^^^^^
</Location>
# Only listen for connections from the local machine.
# Listen localhost:631
Port 631
#mg ^^^
Restart
# shutdown -r now
Access web interface at 192.168.0.6:631
select printer maker - generic
select printer - PCL
Description: Brother HL-2150N series
Location: Local Printer
Driver: Generic PCL Laser Printer (grayscale)
Connection: dnssd://Brother%20HL-2150N%20series._pdl-datastream._tcp.local/
Defaults: job-sheets=none, none media=iso_a4_210x297mm sides=one-sided
Great success. Feel free to add improvements below.