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