7015852: Implementing a satellite avahi listener / responder to advertise iPrint printers

Click here to watch a video demonstrating how the Avahi listener solution works. Note, the same video also demonstrates the DNS-SD solution.

To setup a satellite Avahi server, perform the following:

1. Enable iPrint Printers for AirPrint

Go to the iPrint Appliance Management Console:

https://<IP or DNS>:9443

Choose “iPrint Appliance Configuration”

Choose “Printers” (left frame)

Ensure the printer (or printers) is enabled for Mobile and AirPrint.

2. Connect any Linux system to the wireless network. This may be done via a wireless interface, or connected on the same network / VLAN that the wireless network uplinks to down the line.

3. Ensure the Avahi package is installed

rpm -qa |grep avahi

4. Copy the printer service files from the iPrint appliance server’s /etc/avahi/services directory to the satellite Avahi server.

5. Restart the Avahi daemon on the satellite server

SuSE based Linux distributions:

rcavahi-daemon restart

Ubuntu based Linux distributions

sudo service avahi-daemon restart

Other Linux distributions

Refer to their documentation

The printers are now advertised on the network where the Avahi satellite server is attached. Please note that this process can be repeated as necessary as new printers are added. If a printer is removed, make sure to remove the service file from the satellite servers as well.

A more elegant solution would be to rsync the contents of /etc/avahi/services to each satellite server on a regular interval to ensure that all systems stay in sync.

A less elegant solution, but workable solution, to automate the copying of service files from the iPrint Appliance to the satellite Avahi listener machine is to use cron. You can configure cron to copy the service files at whatever interval (minute, day, week, etc) you desire. The steps to set this up are:

Within a terminal session (putty or otherwise):

  1. Execute the ssh keygen command
  • ssh-keygen -t rsa
    • Hit ENTER three times
  1. Execute the ssh copy id command
    • Syntax:
      • ssh-copy-id root@<IP address of satellite Linux machine>
    • Example:
      • ssh-copy-id root@172.16.3.9
    • You may need to type ‘yes’ and hit ENTER (if prompted)
    • Enter the root password of the satellite Linux machine
  2. Add the following line to the /etc/crontab file on the iPrint Appliance
    • Syntax:
      • */10 * * * * root scp /etc/avahi/services/* root@<IP address of satellite Linux machine>:/etc/avahi/services/
    • Example:
      • */10 * * * * root scp /etc/avahi/services/* root@172.16.3.9:/etc/avahi/services/
        • The update interval can be as frequent as you like. The above example copies the Avahi service files every 10 minutes.
  3. Restart cron
    • rccron restart

Related:

Leave a Reply