document IPv6 addresses
[freeradius.git] / man / man1 / radclient.1
1 .TH RADCLIENT 1 "28 February 2017" "" "FreeRADIUS Daemon"
2 .SH NAME
3 radclient - send packets to a RADIUS server, show reply
4 .SH SYNOPSIS
5 .B radclient
6 .RB [ \-4 ]
7 .RB [ \-6 ]
8 .RB [ \-c
9 .IR count ]
10 .RB [ \-d
11 .IR raddb_directory ]
12 .RB [ \-D
13 .IR dictionary_directory ]
14 .RB [ \-f
15 .IR file ]
16 .RB [ \-F ]
17 .RB [ \-h ]
18 .RB [ \-i
19 .IR id ]
20 .RB [ \-n
21 .IR num_requests_per_second ]
22 .RB [ \-p
23 .IR num_requests_in_parallel ]
24 .RB [ \-q ]
25 .RB [ \-r
26 .IR num_retries ]
27 .RB [ \-s ]
28 .RB [ \-S
29 .IR shared_secret_file ]
30 .RB [ \-t
31 .IR timeout ]
32 .RB [ \-v ]
33 .RB [ \-x ]
34 \fIserver {acct|auth|status|disconnect|auto} secret\fP
35 .SH DESCRIPTION
36 \fBradclient\fP is a radius client program. It can send arbitrary radius
37 packets to a radius server, then shows the reply. It can be used to
38 test changes you made in the configuration of the radius server,
39 or it can be used to monitor if a radius server is up.
40 .PP
41 \fBradclient\fP reads radius attribute/value pairs from it standard
42 input, or from a file specified on the command line. It then encodes
43 these attribute/value pairs using the dictionary, and sends them
44 to the remote server.
45 .PP
46 The \fIUser-Password\fP and \fICHAP-Password\fP attributes are
47 automatically encrypted before the packet is sent to the server.
48
49 .SH OPTIONS
50
51 .IP \-4
52 Use IPv4 (default)
53 .IP \-6
54 Use IPv6
55 .IP \-c\ \fIcount\fP
56 Send each packet \fIcount\fP times.
57 .IP \-d\ \fIraddb_directory\fP
58 The directory that contains the user dictionary file. Defaults to
59 \fI/etc/raddb\fP.
60 .IP \-D\ \fIdictionary_directory\fP
61 The directory that contains the main dictionary file. Defaults to
62 \fI/usr/share/freeradius\fP.
63 .IP \-f\ \fIfile[:file]\fP
64 File to read the attribute/value pairs from. If this is not specified,
65 they are read from stdin.  This option can be specified multiple
66 times, in which case packets are sent in order by file, and within
67 each file, by first packet to last packet.  A blank line separates
68 logical packets within a file.  If a pair of files separated by a
69 colon is specified, the second file will be used to filter the
70 responses to requests from the first. The number of requests and
71 filters must be the same.  A summary of filter results will be displayed
72 if \-s is passed.
73 .IP \-F
74 Print the file name, packet number and reply code.
75 .IP \-h
76 Print usage help information.
77 .IP \-i\ \fIid\fP
78 Use \fIid\fP as the RADIUS request Id.
79 .IP \-n\ \fInum_requests_per_second\fP
80 Try to send \fInum_requests_per_second\fP, evenly spaced.  This option
81 allows you to slow down the rate at which radclient sends requests.
82 When not using \-n, the default is to send packets as quickly as
83 possible, with no inter-packet delays.
84
85 Due to limitations in radclient, this option does not accurately send
86 the requested number of packets per second.
87 .IP \-p\ \fInum_requests_in_parallel\fP
88 Send \fInum_requests_in_parallel\fP, without waiting for a response
89 for each one.  By default, radclient sends the first request it has
90 read, waits for the response, and once the response is received, sends
91 the second request in its list.  This option allows you to send many
92 requests at simultaneously.  Once \fInum_requests_in_parallel\fP are
93 sent, radclient waits for all of the responses to arrive (or for the
94 requests to time out), before sending any more packets.
95
96 This option permits you to discover the maximum load accepted by a
97 RADIUS server.
98 .IP "\-P\ \fIproto\fP"
99 Use \fIproto\fP transport protocol ("tcp" or "udp").
100 Only available if FreeRADIUS is compiled with TCP transport support.
101 .IP \-q
102 Go to quiet mode, and do not print out anything.
103 .IP \-r\ \fInum_retries\fP
104 Try to send each packet \fInum_retries\fP times, before giving up on
105 it.  The default is 10.
106 .IP \-s
107 Print out some summaries of packets sent and received.
108 .IP \-S\ \fIshared_secret_file\fP
109 Rather than reading the shared secret from the command-line (where it
110 can be seen by others on the local system), read it instead from
111 \fIshared_secret_file\fP.
112 .IP \-t\ \fItimeout\fP
113 Wait \fItimeout\fP seconds before deciding that the NAS has not
114 responded to a request, and re-sending the packet.  The default
115 timeout is 3.
116 .IP \-v
117 Print out version information.
118 .IP \-x
119 Print out debugging information.
120 .IP server[:port]
121 The hostname or IP address of the remote server. Optionally a UDP port
122 can be specified. If no UDP port is specified, it is looked up in
123 \fI/etc/services\fP. The service name looked for is \fBradacct\fP for
124 accounting packets, and \fBradius\fP for all other requests. If a
125 service is not found in \fI/etc/services\fP, 1813 and 1812 are used
126 respectively.
127
128 If a host name is specified, then radclient will do a DNS lookup, and
129 use the A record to find the IP address of the RADIUS server.  If
130 there is no A record, then radclient will look for an AAAA record.  If
131 there is no AAAA record, an error will be produced.
132
133 IPv6 addresses may be specified by surrounding it in square brackets.
134 For example, [2002:c000:0201:0:0:0:0:0], or with a port,
135 [2002:c000:0201:0:0:0:0:0]:18120.
136
137 The RADIUS attributes read by \fIradclient\fP can contain the special
138 attribute \fBPacket-Dst-IP-Address\fP.  If this attribute exists, then
139 that IP address is where the packet is sent, and the \fBserver\fP
140 specified on the command-line is ignored.
141
142 If the RADIUS attribute list always contains the
143 \fBPacket-Dst-IP-Address\fP attribute, then the \fBserver\fP parameter
144 can be given as \fB-\fP.
145
146 The RADIUS attributes read by \fIradclient\fP can contain the special
147 attribute \fBPacket-Dst-Port\fP.  If this attribute exists, then that
148 UDP port is where the packet is sent, and the \fB:port\fP specified
149 on the command-line is ignored.
150
151 .IP acct\ |\ auth\ |\ status\ |\ disconnect\ |\ auto
152 Use \fBauth\fP to send an authentication packet (Access-Request),
153 \fBacct\fP to send an accounting packet (Accounting-Request),
154 \fBstatus\fP to send an status packet (Status-Server), or
155 \fBdisconnect\fP to send a disconnection request. Instead of these
156 values, you can also use a decimal code here. For example, code 12 is
157 also \fBStatus-Server\fP.
158
159 The RADIUS attributes read by \fIradclient\fP can contain the special
160 attribute \fBPacket-Type\fP.  If this attribute exists, then that type
161 of packet is sent, and the \fItype\fP specified on the command-line
162 is ignored.
163
164 If the RADIUS attribute list always contains the
165 \fBPacket-Type\fP attribute, then the \fBtype\fP parameter can be
166 given as \fBauto\fP.
167
168 .IP secret
169 The shared secret for this client.  It needs to be defined on the
170 radius server side too, for the IP address you are sending the radius
171 packets from.
172
173 .SH EXAMPLE
174
175 A sample session that queries the remote server for
176 \fIStatus-Server\fP (not all servers support this, but FreeRADIUS has
177 configurable support for it).
178 .RS
179 .sp
180 .nf
181 .ne 3
182 $ echo "Message-Authenticator = 0x00" | radclient 192.0.2.42 status s3cr3t
183 Sending request to server 192.0.2.42, port 1812.
184 radrecv: Packet from host 192.0.2.42 code=2, id=140, length=54
185     Reply-Message = "FreeRADIUS up 21 days, 02:05"
186 .fi
187 .sp
188 .RE
189
190 .SH SEE ALSO
191 radiusd(8),
192 .SH AUTHORS
193 Miquel van Smoorenburg, miquels@cistron.nl.
194 Alan DeKok <aland@freeradius.org>