Welcome to the Slackware Documentation Project

¡Esta es una revisión vieja del documento!


En proceso de traducción. Victor

Impresora de escritorio compartida con CUPS

Usando CUPS, una impresora USB puede ser compartida en red por el sistema al que está conectada. SI bien la detección de impresoras completa requiere avahi, es posible configurar el uso compartido de impresora en Slackware 14.2 sin necesidad de instalar ningún software nuevo. En este caso, el servidor es la máquina a la que se conecta la impresora a través de USB, mientras que el cliente es cualquier máquina en red que quiera imprimir. Obviamente, todas las máquinas deben estar en la LAN, y la impresión directa a través de USB ya debería estar funcionando en el servidor.

Server configuration

CUPS needs to be enabled, so;

chmod +x /etc/rc.d/rc.cups

The CUPS daemon will then start on boot, and it can be restarted for testing purposes by issuing;

/etc/rc.d/rc.cups restart

You should be able to access the CUPS interface in your web browser at http://localhost:631/

If you are using AlienBob's firewall config you will want to add these two firewall rules (modifying the x's as appropriate for your LAN);
$IPT -A udp_inbound -p UDP -s x.x.x.0/24 --destination-port 631 -j ACCEPT
$IPT -A tcp_inbound -p TCP -s x.x.x.0/24 --destination-port 631 -j ACCEPT
The CUPS help tells you to enable sharing via;
cupsctl --share-printers

but be careful as this will clobber your /etc/cups/cupsd.conf

The simplest configuration requires that CUPS listen on the LAN (rather than just the default of localhost). Inside /etc/cups/cupsd.conf the minimum necessary changes to the Slack 14.2 default are;

#Listen localhost:631
Port 631

<Location/>       
  Order allow,deny
  Allow @LOCAL
</Location>

Your printer also needs to be set to shared. By default my HP LaserJet M402dn was shared, and you can check this in /etc/cups/printers.conf where there should be a line for your printer that says;

Shared Yes
printers.conf should not be edited while CUPS is running! You can stop it with;
/etc/rc.d/rc.cups stop

Sharing can also be enabled with the command;

lpadmin -p printer -o printer-is-shared=true

where 'printer' is the name of the CUPS printer (which can be found at CUPS printers). Note that this will not cause the printer to show as “Shared” on its CUPS page. E.g. my LaserJet says “HP_LaserJet_M402dn (Idle, Accepting Jobs, Not Shared, Server Default)”, however, this printer is in fact shared over the network. Adding the directive;

BrowseLocalProtocols dnssd

will cause the printer to show up as “Shared”, but I believe this is referring to printer browsing, and probably requires avahi. At any rate, it is not necessary for the simple sharing setup described in this guide.

Client configuration

Now that the server is configured, the client can be set up to print. I have only tested this on a Mac, which was as simple as opening the printer's IPP address in Safari (which then provides the option for adding the network printer). The printer's IPP address is nearly the same as the one found in CUPS (on the server). For example, on my CUPS server printer list, I have this link;

http://localhost:631/printers/HP_LaserJet_M402dn

For the IPP address, simply replace the protocol, hostname, and remove the port. E.g.;

ipp://darkstar/printers/HP_LaserJet_M402dn

or more generally

ipp://server_hostname/printers/cups_printer_name

I have no experience with configuring clients on other operating systems, so the addition of that information would be appreciated.

Troubleshooting

If you are having difficulty, you can check the CUPS error log at http://localhost:631/admin/log/error_log

Sources

* Originally written by drgibbon


En otros idiomas
Traducciones de esta página?:
QR Code
QR Code es:howtos:network_services:desktop_printer_sharing_cups (generated for current page)