]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/sharing.html
Merge changes from CUPS 1.4svn-r8628.
[thirdparty/cups.git] / doc / help / sharing.html
CommitLineData
d2354e63
MS
1<html>
2<!-- SECTION: Getting Started -->
3<head>
4 <title>Printer Sharing</title>
178cb736
MS
5 <LINK REL="STYLESHEET" TYPE="text/css" HREF="../cups-printable.css">
6</HEAD>
7<BODY>
8
9<H1 CLASS="title">Printer Sharing</H1>
d2354e63
MS
10
11<p>This document discusses several ways to configure printer sharing.</p>
12
13<h2><a name="BASICS">The Basics</h2>
14
15<p>A "server" is any machine that communicates directly to a printer. A "client"
16is any machine that sends print jobs to a server for final printing. Clients can
17also be servers if they communicate directly with any printers of their own.</p>
18
19<p>By default, CUPS uses the Internet Printing Protocol (IPP) to send jobs from
20a client to a server. When printing to legacy print servers you may also use the
21Line Printer Daemon (LPD) when printing to older UNIX-based servers or Server
22Message Block (SMB) when printing to Windows<sup>&reg;</sup> servers.</p>
23
24<p>Clients can automatically discover and access shared printers via CUPS
25browsing, IPP, Service Location Protocol (SLP), and Lightweight Directory Access
26Protocol (LDAP). DNS Service Discovery (DNS-SD a.k.a. Bonjour<sup>&reg;</sup>)
27and SMB browsing can also be used to manually discover and access shared
28printers.</p>
29
30
31<h2><a name="SERVER_CONFIG">Configuring the Server</a></h2>
32
33<p>You must enable printer sharing on the server before clients can print
34through it. The simplest way to do this is to use the
35<a href="man-cupsctl.html">cupsctl(8)</a> command on the server:</p>
36
37<pre class="command">
38cupsctl --share-printers
39</pre>
40
41<p>By default, the above command will allow printing from other clients on the
42same subnet as your server. To allow printing from any subnet, use the following
43command instead:</p>
44
45<pre class="command">
46cupsctl --share-printers --remote-any
47</pre>
48
49<p>Next, you need to choose which protocols to use for printer sharing. The
50default is CUPS browsing and DNS-SD on Mac OS X and CUPS browsing alone on
51other platforms. To set the sharing protocols, run the <b>cupsctl</b> command
52to set the
53<a href="ref-cupsd-conf.html#BrowseLocalProtocols">BrowseLocalProtocols</a>
54value. For example, run the following command to allow shared printing via
55CUPS, DNS-SD, LPD, and SMB:</p>
56
57<pre class="command">
58cupsctl 'BrowseLocalProtocols="cups dnssd lpd smb"'
59</pre>
60
61
62<h2><a name="AUTO_CUPS">Automatic Configuration using CUPS Browsing</a></h2>
63
64<p>CUPS browsing works by periodically broadcasting information about printers
65that are being shared to client systems on the same subnet. Each client
66maintains its own list of shared printers, and when more than one server shares
67the same printer (or the same kind of printer) the client uses all of the
68servers and printers to provide high-availability and failsafe printing.</p>
69
70<p>To configure printers on the same subnet, <em>do nothing</em>. Each client
71should see the available printers within 30 seconds automatically. The printer
72and class lists are updated automatically as printers and servers are added or
73removed.</p>
74
75<blockquote><b>Note:</b>
76
77<p>Due to user interface changes in Mac OS X 10.5, CUPS shared printers will not
78automatically appear in the print dialog. Instead, you must first run the
79following command to enable CUPS browsing on your system:</p>
80
81<pre class="command">
82cupsctl BrowseRemoteProtocols=cups
83</pre>
84
85<p>Then choose each of the CUPS shared printers you want to see in the print
86dialog by adding them, either from the <var>Add Printer...</var> item in the
87print dialog or from the <var>Print &amp; Fax</var> preference pane in the
88<var>System Preferences</var> window.</p>
89
90</blockquote>
91
92<h3><a name="BROWSE_POLL">Seeing Printers on Other Subnets</a></h3>
93
94<p>You can automatically access printers on other subnets by adding
95<a href="ref-cupsd-conf.html#BrowsePoll"><code>BrowsePoll</code></a> lines
96to the <var>cupsd.conf</var> file on your local system. For a single
97server you can use the <b>cupsctl</b> command:</p>
98
99<pre class="command">
100cupsctl BrowsePoll=server:port
101</pre>
102
103<p>For multiple servers, use the CUPS web interface (http://localhost:631/admin)
104to edit the configuration file instead. Enter one <code>BrowsePoll</code> line
105per server at the bottom of the file, as follows:</p>
106
107<pre class="example">
108BrowsePoll server1:port
109BrowsePoll server2:port
110BrowsePoll server3:port
111</pre>
112
113<p>If you have more than one client on your subnet that wants to see the
114printers on those servers, add a
115<a href="ref-cupsd-conf.html#BrowseRelay"><code>BrowseRely</code></a> line
116to the <var>cupsd.conf</var> file on your local system using the <b>cupsctl</b>
117command:</p>
118
119<pre class="command">
120cupsctl 'BrowseRelay="127.0.0.1 @LOCAL"'
121</pre>
122
123<p>or CUPS web interface (again, at the bottom of the file):</p>
124
125<pre class="example">
126BrowseRelay 127.0.0.1 @LOCAL
127</pre>
128
129
130<h2><a name="AUTO_IPP">Automatic Configuration using IPP</a></h2>
131
132<p>CUPS can be configured to run without a local spooler and send all jobs to a
133single server. However, if that server goes down then all printing will be
134disabled. Use this configuration only as absolutely necessary.</p>
135
136<p>The default server is normally the local system ("localhost"). To override
137the default server create a file named <var>/etc/cups/client.conf</var> with a
138line as follows:</p>
139
140<pre class='example'>
141ServerName <em>server</em>
142</pre>
143
144<p>The <var>server</var> name can be the hostname or IP address of the default
145server. If the server is not using the default IPP port (631), you can add the
146port number at the end like this:</p>
147
148<pre class='example'>
149ServerName <em>server:port</em>
150</pre>
151
152<p>The default server can also be customized on a per-user basis. To set a
153user-specific server create a file named <var>~/.cups/client.conf</var> instead.
154The user <var>client.conf</var> file takes precedence over the system one.</p>
155
156<p>Finally, you can set the <code>CUPS_SERVER</code> environment variable to
157override the default server for a single process, for example:</p>
158
159<pre class='command'>
160CUPS_SERVER=server:port firefox http://www.cups.org
161</pre>
162
163<p>will run the Firefox web browser pointed to the specified server and
164port. The environment variable overrides both the user and system
165<var>client.conf</var> files, if any.</p>
166
167
168<h2><a name="MANUAL">Manual Configuration of Print Queues</a></h2>
169
170<p>The most tedious method of configuring client machines is to configure
171each remote queue by hand using the <a href="man-lpadmin.html">lpadmin(8)</a>
172command:</p>
173
174<pre class='command'>
175lpadmin -p <em>printer</em> -E -v ipp://<em>server</em>/printers/<em>printer</em>
176</pre>
177
178<p>The <var>printer</var> name is the name of the printer on the server machine.
179The <var>server</var> name is the hostname or IP address of the server machine.
180Repeat the <b>lpadmin</b> command for each remote printer you wish to use.</p>
181
182
183</body>
184</html>