switch4g: completely re-writen
[tomato.git] / release / src / router / portmap / portmap.8
blob4c92cacea5ee86577237d739ed124de671de70bf
1 .\" Copyright (c) 1987 Sun Microsystems
2 .\" Copyright (c) 1990, 1991 The Regents of the University of California.
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\"    must display the following acknowledgement:
15 .\"     This product includes software developed by the University of
16 .\"     California, Berkeley and its contributors.
17 .\" 4. Neither the name of the University nor the names of its contributors
18 .\"    may be used to endorse or promote products derived from this software
19 .\"    without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\"     from: @(#)portmap.8     5.3 (Berkeley) 3/16/91
34 .\"     $Id: portmap.8,v 1.2 2004/04/03 09:30:21 herbert Exp $
35 .\"
36 .Dd Apr 20, 2007
37 .Dt PORTMAP 8
38 .Os BSD 4.3
39 .Sh NAME
40 .Nm portmap
41 .Nd
42 .Tn DARPA
43 port to
44 .Tn RPC
45 program number mapper
46 .Sh SYNOPSIS
47 .Nm portmap
48 .Op Fl d
49 .Op Fl f
50 .Op Fl t Ar dir
51 .Op Fl v
52 .Op Fl V
53 .Op Fl i Ar address
54 .Op Fl l
55 .Op Fl u Ar uid
56 .Op Fl g Ar gid
57 .Sh DESCRIPTION
58 .Nm Portmap
59 is a server that converts
60 .Tn RPC
61 program numbers into
62 .Tn DARPA
63 protocol port numbers.
64 It must be running in order to make
65 .Tn RPC
66 calls.
67 .Pp
68 When an
69 .Tn RPC
70 server is started, it will tell
71 .Nm portmap
72 what port number it is listening to, and what
73 .Tn RPC
74 program numbers it is prepared to serve.
75 When a client wishes to make an
76 .Tn RPC
77 call to a given program number,
78 it will first contact
79 .Nm portmap
80 on the server machine to determine
81 the port number where
82 .Tn RPC
83 packets should be sent.
84 .Pp
85 .Nm Portmap
86 must be started before any
87 .Tn RPC
88 servers are invoked.
89 .Pp
90 Normally
91 .Nm portmap
92 forks and dissociates itself from the terminal
93 like any other daemon.
94 .Nm Portmap
95 then logs errors using
96 .Xr syslog 3 .
97 .Pp
98 .Nm Portmap
99 records all current mapping in the file
100 .Nm /var/run/portmap_mapping
101 so that if it gets killed and restarted, it can reload the mapping for
102 currently active services.
104 Options available:
105 .Bl -tag -width Ds
106 .It Fl V
107 Display version number and exit.
108 .It Fl d
109 (debug) prevents
110 .Nm portmap
111 from running as a daemon,
112 and causes errors and debugging information
113 to be printed to the standard error output.
114 .It Fl f
115 (foreground) prevents
116 .Nm portmap
117 from running as a daemon,
118 and causes log messages
119 to be printed to the standard error output.
120 .It Fl t Ar dir
121 (chroot) tell
122 .Nm portmap
124 .Xr chroot 2
125 into
126 .Ar dir .
127 .Ar dir
128 should be empty, not writeable by the daemon user, and preferably on a
129 filesystem mounted read-only, noexec, nodev, and nosuid.
130 .It Fl u Ar uid
131 .It Fl g Ar gid
132 Set the user-id and group-id of the running process to those given,
133 rather than the compiled-in defaults of DAEMON_UID/DAEMON_GID.
134 .if 'RPCUSER'' .ig
135 If neither are set, then
136 .Nm portmap
137 will look up the user
138 .Nm RPCUSER
139 and use the uid and gid of that user.
141 .It Fl v
142 (verbose) run
143 .Nm portmap
144 in verbose mode.
145 .It Fl i Ar address
146 bind
147 .Nm portmap
148 to address. If you specify 127.0.0.1 it will bind to the loopback
149 interface only.
150 .It Fl l
151 bind
152 .Nm portmap
153 to the loop-back address 127.0.0.1.  This is a shorthand for
154 specifying 127.0.0.1 with -i.
157 This
158 .Nm portmap
159 version is protected by the
160 .Nm tcp_wrapper
161 library. You have to give the clients access to
162 .Nm portmap
163 if they should be allowed to use it.
164 .if 'USE_DNS'yes' .ig
165 To allow connects from clients of the network 192.168. you could use
166 the following line in /etc/hosts.allow:
168 portmap: 192.168.
170 In order to avoid deadlocks, the
171 .Nm portmap
172 program does not attempt to look up the remote host name or user name, nor will
173 it try to match NIS netgroups. As a consequence only network number patterns
174 (or IP addresses) will work for portmap access control, do not use hostnames.
175 Notice that localhost will always be allowed access to the portmapper.
177 You have to use the daemon name
178 .Nm portmap
179 for the daemon name (even if the binary has a different name). For the
180 client names you can only use the keyword ALL or IP addresses (NOT
181 host or domain names).
183 .if !'USE_DNS'yes' .ig
184 To allow connects from clients of
185 the .bar.com domain you could use the following line in /etc/hosts.allow:
187 portmap: .bar.com
189 You have to use the daemon name
190 .Nm portmap
191 for the daemon name (even if the binary has a different name). For the
192 client names you can use the keyword ALL, IP addresses, hostnames or domain
193 names. Using netgroup names will likely cause
194 .Nm portmap
195 to deadlock.
196 Note that localhost will always be allowed access to the portmapper.
199 For further information please have a look at the
200 .Xr tcpd 8 ,
201 .Xr hosts_allow 5
203 .Xr hosts_access 5
204 manual pages.
206 .Sh SEE ALSO
207 .Xr inetd.conf 5 ,
208 .Xr rpcinfo 8 ,
209 .Xr pmap_set 8 ,
210 .Xr pmap_dump 8 ,
211 .Xr inetd 8 ,
212 .Xr tcpd 8 ,
213 .Xr hosts_access 5 ,
214 .Xr hosts_options 5
215 .Sh HISTORY
218 command appeared in
219 .Bx 4.3
220 .Sh AUTHORS
221 This
222 manual page was changed by
223 .An Anibal Monsalve Salazar
224 for the Debian Project.