Use Networked Printers and Scanners with HPLIP

HPLIP makes it a breeze to use networked printers and scanners with Linux.

 By Carla Schroder
Page 1 of 2
Print Article

In which we learn how to plug printers directly into and share scanners over the network.

HP vs. Samsung Smackdown

Not too long ago I treated myself to a HP 3050 multi-function laser printer with fax, scanner, and copier. I almost went with Samsung because it makes good machines, and all of its monochrome printers have Linux drivers. But they are closed, proprietary binary drivers which are bad enough on their own: big fat pains to install and upgrade. And then the news broke about the ingenious security holes and inexplicable permissions changes on key directories introduced by the amusingly awful installer for the Samsung drivers, and that was all she wrote. HP, on the other hand, supports good-quality, well-supported genuine FOSS drivers, HPLIP, which we introduced ourselves to last week.

A number of Samsung printers are supported by CUPS, but a lot of them aren't, and I want to send my hard-earned money to vendors who are serious about supporting Linux users. A common problem with multi-function printers is that some parts work in Linux, and some parts don't. Or you have to pull all the pieces together yourself, instead of having a nice unified management console like hp-toolbox. Game, set, and match to HP.

Networked Printers

The 3050 does not include an Ethernet interface (which is not a showstopper; it just means it has to be connected to a PC and shared over the network via CUPS) but many HP printers and all-in-one machines do. This is an excellent option for network printing, and is nice to administer on mixed networks. The printer gets its own IP address, and the HP toolbox will find all of your networked printers so you can manage them from your underground network administrator's lair.

Make the manual for your particular HP printer your first stop because it tells you everything. Mine is a 430-page PDF that covers models 3050, 3052, 3055, 3090, and 3092.

As is so often the case, there are a few speedbumps to getting all this network guff working. You need snmp and avahi-daemon running on your Master Linux Netadmin Workstation, and you need avahi-daemon on any Linux PC that you want to enable auto-discovery of networked printers on. These days most Linux distributions install and run avahi-daemon by default to enable Zeroconf services, even though there isn't much of anything for it to Zeroconf. (See Make Sense of SNMP/MRTG Alphabet Soup to learn how to enable snmp on your Linux hosts, and Run Zeroconf for Linux in a Snap for an introduction to enabling, testing, and using avahi-daemon.)

Mac OS X has the nicest Zeroconf setup and should "just work." Windows has its own weirdo auto-discovery protocol, and of course each iteration of Windows behaves a little differently, if it supports it at all. See your excellent printer manual for details.

You can configure everything on the printer's own control panel, but why do it the hard way when there are easier ways? Then you can manage your printer in several ways: from CUPS, from the printer's own embedded Web server (EWS), and from the hp-toolbox.

When you connect your printer to the network for the first time, the easy way is to already have a DHCP server running and the printer will get an IP address from that. It will look first for a DHCP or BOOTP server, and if you don't have either of those it will auto-generate its own link-local address, which comes from the 169.254/16 address range, which is the link-local (or Zeroconf) range. This has some advantages if your clients are all properly Zeroconfed. You don't need a DHCP server and address collisions are handled automatically.

You can give your printer a static IP address in the usual way via through DHCP, or use one of the HP control panels to configure it manually. If you use the printer control panel your address assignment won't survive a power cycle, so make sure you use hp-toolbox or EWS.

Sharing Scanners Over the Network

Sharing a scanner over the network has limited value, because most folks don't find it convenient to gallop great distances back and forth between their computers and scanners. But it's not so bad sharing a scanner between a few computers that are in reasonable proximity to each other, and then the person using the PC that the scanner is attached to gets pestered only a little instead of a lot.

The first step is making sure your scanner works for ordinary users and doesn't require root privileges. Linux's new best friend udev has turned device permissions into a New Fun Headache, so hopefully your distribution ships with a nice udev configuration that neither vexes nor annoys, but does the work for you. As, presumably, it is designed to do. On Ubuntu all you do is add local users to the scanner group. On other distributions who knows; see Manage Linux Hardware with udev for some pointers on making udev bow to your will.

This article was originally published on Aug 13, 2007
Get the Latest Scoop with Networking Update Newsletter