xref: /freebsd/usr.sbin/ctld/ctl.conf.5 (revision 5b511473999a1d0145635fcc9d922601f34b670b)
1009ea47eSEdward Tomasz Napierala.\" Copyright (c) 2012 The FreeBSD Foundation
2db7bf2baSAlexander Motin.\" Copyright (c) 2015 Alexander Motin <mav@FreeBSD.org>
3009ea47eSEdward Tomasz Napierala.\" All rights reserved.
4009ea47eSEdward Tomasz Napierala.\"
5009ea47eSEdward Tomasz Napierala.\" This software was developed by Edward Tomasz Napierala under sponsorship
6009ea47eSEdward Tomasz Napierala.\" from the FreeBSD Foundation.
7009ea47eSEdward Tomasz Napierala.\"
8009ea47eSEdward Tomasz Napierala.\" Redistribution and use in source and binary forms, with or without
9009ea47eSEdward Tomasz Napierala.\" modification, are permitted provided that the following conditions
10009ea47eSEdward Tomasz Napierala.\" are met:
11009ea47eSEdward Tomasz Napierala.\" 1. Redistributions of source code must retain the above copyright
12009ea47eSEdward Tomasz Napierala.\"    notice, this list of conditions and the following disclaimer.
13009ea47eSEdward Tomasz Napierala.\" 2. Redistributions in binary form must reproduce the above copyright
14009ea47eSEdward Tomasz Napierala.\"    notice, this list of conditions and the following disclaimer in the
15009ea47eSEdward Tomasz Napierala.\"    documentation and/or other materials provided with the distribution.
16009ea47eSEdward Tomasz Napierala.\"
17009ea47eSEdward Tomasz Napierala.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
18009ea47eSEdward Tomasz Napierala.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19009ea47eSEdward Tomasz Napierala.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20009ea47eSEdward Tomasz Napierala.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
21009ea47eSEdward Tomasz Napierala.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22009ea47eSEdward Tomasz Napierala.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23009ea47eSEdward Tomasz Napierala.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24009ea47eSEdward Tomasz Napierala.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25009ea47eSEdward Tomasz Napierala.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26009ea47eSEdward Tomasz Napierala.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27009ea47eSEdward Tomasz Napierala.\" SUCH DAMAGE.
28009ea47eSEdward Tomasz Napierala.\"
29b797cc83SJohn Baldwin.Dd February 26, 2025
30009ea47eSEdward Tomasz Napierala.Dt CTL.CONF 5
31009ea47eSEdward Tomasz Napierala.Os
32009ea47eSEdward Tomasz Napierala.Sh NAME
33009ea47eSEdward Tomasz Napierala.Nm ctl.conf
34009ea47eSEdward Tomasz Napierala.Nd CAM Target Layer / iSCSI target daemon configuration file
35009ea47eSEdward Tomasz Napierala.Sh DESCRIPTION
36009ea47eSEdward Tomasz NapieralaThe
37009ea47eSEdward Tomasz Napierala.Nm
38009ea47eSEdward Tomasz Napieralaconfiguration file is used by the
39009ea47eSEdward Tomasz Napierala.Xr ctld 8
40009ea47eSEdward Tomasz Napieraladaemon.
41009ea47eSEdward Tomasz NapieralaLines starting with
42009ea47eSEdward Tomasz Napierala.Ql #
43c63d8c3bSEdward Tomasz Napieralaare interpreted as comments.
44009ea47eSEdward Tomasz NapieralaThe general syntax of the
45009ea47eSEdward Tomasz Napierala.Nm
46009ea47eSEdward Tomasz Napieralafile is:
47009ea47eSEdward Tomasz Napierala.Bd -literal -offset indent
48d1e933edSAllan Jude.No pidfile Ar path
49009ea47eSEdward Tomasz Napierala
50d1e933edSAllan Jude.No auth-group Ar name No {
51d1e933edSAllan Jude.Dl chap Ar user Ar secret
52d1e933edSAllan Jude.Dl ...
53009ea47eSEdward Tomasz Napierala}
54009ea47eSEdward Tomasz Napierala
55d1e933edSAllan Jude.No portal-group Ar name No {
56d1e933edSAllan Jude.Dl listen Ar address
573a6accd5SEdward Tomasz Napierala.\".Dl listen-iser Ar address
58d1e933edSAllan Jude.Dl discovery-auth-group Ar name
59d1e933edSAllan Jude.Dl ...
60009ea47eSEdward Tomasz Napierala}
61009ea47eSEdward Tomasz Napierala
62d1e933edSAllan Jude.No target Ar name {
63d1e933edSAllan Jude.Dl auth-group Ar name
6410b5297fSEdward Tomasz Napierala.Dl portal-group Ar name
65d1e933edSAllan Jude.Dl lun Ar number No {
66d1e933edSAllan Jude.Dl 	path Ar path
67d1e933edSAllan Jude.Dl }
68d1e933edSAllan Jude.Dl ...
69009ea47eSEdward Tomasz Napierala}
70009ea47eSEdward Tomasz Napierala.Ed
71d1e933edSAllan Jude.Ss Global Context
72009ea47eSEdward Tomasz Napierala.Bl -tag -width indent
73d1e933edSAllan Jude.It Ic auth-group Ar name
74d1e933edSAllan JudeCreate an
75d1e933edSAllan Jude.Sy auth-group
76d1e933edSAllan Judeconfiguration context,
77ce20734fSAllan Judedefining a new auth-group,
78009ea47eSEdward Tomasz Napieralawhich can then be assigned to any number of targets.
79d1e933edSAllan Jude.It Ic debug Ar level
80d1e933edSAllan JudeThe debug verbosity level.
81009ea47eSEdward Tomasz NapieralaThe default is 0.
82d1e933edSAllan Jude.It Ic maxproc Ar number
83d1e933edSAllan JudeThe limit for concurrently running child processes handling
84009ea47eSEdward Tomasz Napieralaincoming connections.
85009ea47eSEdward Tomasz NapieralaThe default is 30.
86d1e933edSAllan JudeA setting of 0 disables the limit.
87d1e933edSAllan Jude.It Ic pidfile Ar path
88d1e933edSAllan JudeThe path to the pidfile.
89009ea47eSEdward Tomasz NapieralaThe default is
90009ea47eSEdward Tomasz Napierala.Pa /var/run/ctld.pid .
91d1e933edSAllan Jude.It Ic portal-group Ar name
92d1e933edSAllan JudeCreate a
93d1e933edSAllan Jude.Sy portal-group
94d1e933edSAllan Judeconfiguration context,
954f66b233SEdward Tomasz Napieraladefining a new portal-group,
96009ea47eSEdward Tomasz Napieralawhich can then be assigned to any number of targets.
97920c6cbaSAlexander Motin.It Ic lun Ar name
98920c6cbaSAlexander MotinCreate a
99920c6cbaSAlexander Motin.Sy lun
100d3219654SEdward Tomasz Napieralaconfiguration context, defining a LUN to be exported by any number of targets.
101d1e933edSAllan Jude.It Ic target Ar name
102d1e933edSAllan JudeCreate a
103d1e933edSAllan Jude.Sy target
104d3219654SEdward Tomasz Napieralaconfiguration context, which can optionally contain one or more
105d1e933edSAllan Jude.Sy lun
106d1e933edSAllan Judecontexts.
107d1e933edSAllan Jude.It Ic timeout Ar seconds
108d1e933edSAllan JudeThe timeout for login sessions, after which the connection
109009ea47eSEdward Tomasz Napieralawill be forcibly terminated.
110009ea47eSEdward Tomasz NapieralaThe default is 60.
111d1e933edSAllan JudeA setting of 0 disables the timeout.
112829603e2SAlexander Motin.It Ic isns-server Ar address
113829603e2SAlexander MotinAn IPv4 or IPv6 address and optionally port of iSNS server to register on.
114829603e2SAlexander Motin.It Ic isns-period Ar seconds
115829603e2SAlexander MotiniSNS registration period.
116829603e2SAlexander MotinRegistered Network Entity not updated during this period will be unregistered.
117be6527d5SEdward Tomasz NapieralaThe default is 900.
118829603e2SAlexander Motin.It Ic isns-timeout Ar seconds
119829603e2SAlexander MotinTimeout for iSNS requests.
120be6527d5SEdward Tomasz NapieralaThe default is 5.
121009ea47eSEdward Tomasz Napierala.El
122d1e933edSAllan Jude.Ss auth-group Context
123009ea47eSEdward Tomasz Napierala.Bl -tag -width indent
124d1e933edSAllan Jude.It Ic auth-type Ar type
125d1e933edSAllan JudeSets the authentication type.
126d1e933edSAllan JudeType can be either
127d1e933edSAllan Jude.Qq Ar none ,
128d1e933edSAllan Jude.Qq Ar deny ,
129d1e933edSAllan Jude.Qq Ar chap ,
130d1e933edSAllan Judeor
131d1e933edSAllan Jude.Qq Ar chap-mutual .
132a8a5af86SWarren BlockIn most cases it is not necessary to set the type using this clause;
133d1e933edSAllan Judeit is usually used to disable authentication for a given
134d1e933edSAllan Jude.Sy auth-group .
135d1e933edSAllan Jude.It Ic chap Ar user Ar secret
136d1e933edSAllan JudeA set of CHAP authentication credentials.
137d1e933edSAllan JudeNote that for any
138d1e933edSAllan Jude.Sy auth-group ,
139d1e933edSAllan Judethe configuration may only contain either
140d1e933edSAllan Jude.Sy chap
141d1e933edSAllan Judeor
142d1e933edSAllan Jude.Sy chap-mutual
143d1e933edSAllan Judeentries; it is an error to mix them.
144d1e933edSAllan Jude.It Ic chap-mutual Ar user Ar secret Ar mutualuser Ar mutualsecret
145d1e933edSAllan JudeA set of mutual CHAP authentication credentials.
146d1e933edSAllan JudeNote that for any
147d1e933edSAllan Jude.Sy auth-group ,
148d1e933edSAllan Judethe configuration may only contain either
149d1e933edSAllan Jude.Sy chap
150d1e933edSAllan Judeor
151d1e933edSAllan Jude.Sy chap-mutual
152d1e933edSAllan Judeentries; it is an error to mix them.
153d1e933edSAllan Jude.It Ic initiator-name Ar initiator-name
154d1e933edSAllan JudeAn iSCSI initiator name.
155d1e933edSAllan JudeOnly initiators with a name matching one of the defined
156d1e933edSAllan Judenames will be allowed to connect.
1578cb2e958SEdward Tomasz NapieralaIf not defined, there will be no restrictions based on initiator
1588cb2e958SEdward Tomasz Napieralaname.
159d1e933edSAllan Jude.It Ic initiator-portal Ar address Ns Op / Ns Ar prefixlen
160d1e933edSAllan JudeAn iSCSI initiator portal: an IPv4 or IPv6 address, optionally
161d1e933edSAllan Judefollowed by a literal slash and a prefix length.
162d1e933edSAllan JudeOnly initiators with an address matching one of the defined
163d1e933edSAllan Judeaddresses will be allowed to connect.
1648cb2e958SEdward Tomasz NapieralaIf not defined, there will be no restrictions based on initiator
1658cb2e958SEdward Tomasz Napieralaaddress.
166009ea47eSEdward Tomasz Napierala.El
167d1e933edSAllan Jude.Ss portal-group Context
168009ea47eSEdward Tomasz Napierala.Bl -tag -width indent
169d1e933edSAllan Jude.It Ic discovery-auth-group Ar name
170d1e933edSAllan JudeAssign a previously defined authentication group to the portal group,
171009ea47eSEdward Tomasz Napieralato be used for target discovery.
1724af184b9SEdward Tomasz NapieralaBy default, portal groups are assigned predefined
173d1e933edSAllan Jude.Sy auth-group
174d1e933edSAllan Jude.Qq Ar default ,
175d1e933edSAllan Judewhich denies discovery.
176d1e933edSAllan JudeAnother predefined
177d1e933edSAllan Jude.Sy auth-group ,
178d1e933edSAllan Jude.Qq Ar no-authentication ,
179d1e933edSAllan Judemay be used
180ccb1f04dSEdward Tomasz Napieralato permit discovery without authentication.
18105374883SEdward Tomasz Napierala.It Ic discovery-filter Ar filter
18205374883SEdward Tomasz NapieralaDetermines which targets are returned during discovery.
18305374883SEdward Tomasz NapieralaFilter can be either
18405374883SEdward Tomasz Napierala.Qq Ar none ,
18505374883SEdward Tomasz Napierala.Qq Ar portal ,
18605374883SEdward Tomasz Napierala.Qq Ar portal-name ,
18705374883SEdward Tomasz Napieralaor
18805374883SEdward Tomasz Napierala.Qq Ar portal-name-auth .
18905374883SEdward Tomasz NapieralaWhen set to
19005374883SEdward Tomasz Napierala.Qq Ar none ,
19105374883SEdward Tomasz Napieraladiscovery will return all targets assigned to that portal group.
19205374883SEdward Tomasz NapieralaWhen set to
19305374883SEdward Tomasz Napierala.Qq Ar portal ,
19405374883SEdward Tomasz Napieraladiscovery will not return targets that cannot be accessed by the
19505374883SEdward Tomasz Napieralainitiator because of their
19605374883SEdward Tomasz Napierala.Sy initiator-portal .
19705374883SEdward Tomasz NapieralaWhen set to
19805374883SEdward Tomasz Napierala.Qq Ar portal-name ,
19905374883SEdward Tomasz Napieralathe check will include both
20005374883SEdward Tomasz Napierala.Sy initiator-portal
20105374883SEdward Tomasz Napieralaand
20205374883SEdward Tomasz Napierala.Sy initiator-name .
20305374883SEdward Tomasz NapieralaWhen set to
20405374883SEdward Tomasz Napierala.Qq Ar portal-name-auth ,
20505374883SEdward Tomasz Napieralathe check will include
20605374883SEdward Tomasz Napierala.Sy initiator-portal ,
20705374883SEdward Tomasz Napierala.Sy initiator-name ,
2081195fe34SEdward Tomasz Napieralaand authentication credentials.
2091195fe34SEdward Tomasz NapieralaThe target is returned if it does not require CHAP authentication,
2101195fe34SEdward Tomasz Napieralaor if the CHAP user and secret used during discovery match those
2111195fe34SEdward Tomasz Napieralaused by the target.
21205374883SEdward Tomasz NapieralaNote that when using
21305374883SEdward Tomasz Napierala.Qq Ar portal-name-auth ,
21405374883SEdward Tomasz Napieralatargets that require CHAP authentication will only be returned if
21505374883SEdward Tomasz Napierala.Sy discovery-auth-group
21605374883SEdward Tomasz Napieralarequires CHAP.
21705374883SEdward Tomasz NapieralaThe default is
21805374883SEdward Tomasz Napierala.Qq Ar none .
219d1e933edSAllan Jude.It Ic listen Ar address
220d1e933edSAllan JudeAn IPv4 or IPv6 address and port to listen on for incoming connections.
2213a6accd5SEdward Tomasz Napierala.\".It Ic listen-iser Ar address
2223a6accd5SEdward Tomasz Napierala.\"An IPv4 or IPv6 address and port to listen on for incoming connections
2233a6accd5SEdward Tomasz Napierala.\"using iSER (iSCSI over RDMA) protocol.
224a9d78210SEdward Tomasz Napierala.It Ic offload Ar driver
225a9d78210SEdward Tomasz NapieralaDefine iSCSI hardware offload driver to use for this
226a9d78210SEdward Tomasz Napierala.Sy portal-group .
227ba4a30aeSEdward Tomasz NapieralaThe default is
228ba4a30aeSEdward Tomasz Napierala.Qq Ar none .
229398290f2SAlexander Motin.It Ic option Ar name Ar value
230398290f2SAlexander MotinThe CTL-specific port options passed to the kernel.
2318774c018SEdward Tomasz Napierala.It Ic redirect Ar address
2326dbdbf82SEdward Tomasz NapieralaIPv4 or IPv6 address to redirect initiators to.
2336dbdbf82SEdward Tomasz NapieralaWhen configured, all initiators attempting to connect to portal
2346dbdbf82SEdward Tomasz Napieralabelonging to this
2356dbdbf82SEdward Tomasz Napierala.Sy portal-group
2366dbdbf82SEdward Tomasz Napieralawill get redirected using "Target moved temporarily" login response.
2376dbdbf82SEdward Tomasz NapieralaRedirection happens before authentication and any
2386dbdbf82SEdward Tomasz Napierala.Sy initiator-name
2396dbdbf82SEdward Tomasz Napieralaor
2406dbdbf82SEdward Tomasz Napierala.Sy initiator-portal
2416dbdbf82SEdward Tomasz Napieralachecks are skipped.
242db7bf2baSAlexander Motin.It Ic tag Ar value
243db7bf2baSAlexander MotinUnique 16-bit tag value of this
244db7bf2baSAlexander Motin.Sy portal-group .
245db7bf2baSAlexander MotinIf not specified, the value is generated automatically.
246db7bf2baSAlexander Motin.It Ic foreign
247db7bf2baSAlexander MotinSpecifies that this
248db7bf2baSAlexander Motin.Sy portal-group
249db7bf2baSAlexander Motinis listened by some other host.
250db7bf2baSAlexander MotinThis host will announce it on discovery stage, but won't listen.
25164ffe6d4SRichard Scheffenegger.It Ic dscp Ar value
25264ffe6d4SRichard ScheffeneggerThe DiffServ Codepoint used for sending data. The DSCP can be
25364ffe6d4SRichard Scheffeneggerset to numeric, or hexadecimal values directly, as well as the
25464ffe6d4SRichard Scheffeneggerwell-defined
25564ffe6d4SRichard Scheffenegger.Qq Ar CSx
25664ffe6d4SRichard Scheffeneggerand
25764ffe6d4SRichard Scheffenegger.Qq Ar AFxx
25864ffe6d4SRichard Scheffeneggercodepoints.
259ea8f1280SRichard Scheffenegger.It Ic pcp Ar value
260ea8f1280SRichard ScheffeneggerThe 802.1Q Priority CodePoint used for sending packets.
261ea8f1280SRichard ScheffeneggerThe PCP can be set to a value in the range between
262ea8f1280SRichard Scheffenegger.Qq Ar 0
263ea8f1280SRichard Scheffeneggerto
264ea8f1280SRichard Scheffenegger.Qq Ar 7 .
265ea8f1280SRichard ScheffeneggerWhen omitted, the default for the outgoing interface is used.
266009ea47eSEdward Tomasz Napierala.El
267d1e933edSAllan Jude.Ss target Context
268009ea47eSEdward Tomasz Napierala.Bl -tag -width indent
269d1e933edSAllan Jude.It Ic alias Ar text
270d1e933edSAllan JudeAssign a human-readable description to the target.
271009ea47eSEdward Tomasz NapieralaThere is no default.
272d1e933edSAllan Jude.It Ic auth-group Ar name
273d1e933edSAllan JudeAssign a previously defined authentication group to the target.
274affb88f5SEdward Tomasz NapieralaBy default, targets that do not specify their own auth settings,
275d1e933edSAllan Judeusing clauses such as
276d1e933edSAllan Jude.Sy chap
277d1e933edSAllan Judeor
278d1e933edSAllan Jude.Sy initiator-name ,
279d1e933edSAllan Judeare assigned
280d1e933edSAllan Judepredefined
281d1e933edSAllan Jude.Sy auth-group
282d1e933edSAllan Jude.Qq Ar default ,
283d1e933edSAllan Judewhich denies all access.
284d1e933edSAllan JudeAnother predefined
285d1e933edSAllan Jude.Sy auth-group ,
286d1e933edSAllan Jude.Qq Ar no-authentication ,
287d1e933edSAllan Judemay be used to permit access
288009ea47eSEdward Tomasz Napieralawithout authentication.
289d3219654SEdward Tomasz NapieralaNote that this clause can be overridden using the second argument
290d3219654SEdward Tomasz Napieralato a
291d3219654SEdward Tomasz Napierala.Sy portal-group
292d3219654SEdward Tomasz Napieralaclause.
293d1e933edSAllan Jude.It Ic auth-type Ar type
294d1e933edSAllan JudeSets the authentication type.
295d1e933edSAllan JudeType can be either
296d1e933edSAllan Jude.Qq Ar none ,
297d1e933edSAllan Jude.Qq Ar deny ,
298d1e933edSAllan Jude.Qq Ar chap ,
299d1e933edSAllan Judeor
300d1e933edSAllan Jude.Qq Ar chap-mutual .
301a8a5af86SWarren BlockIn most cases it is not necessary to set the type using this clause;
302d1e933edSAllan Judeit is usually used to disable authentication for a given
303d1e933edSAllan Jude.Sy target .
304d1e933edSAllan JudeThis clause is mutually exclusive with
305d1e933edSAllan Jude.Sy auth-group ;
306d1e933edSAllan Judeone cannot use
307df9900fbSEdward Tomasz Napieralaboth in a single target.
308d1e933edSAllan Jude.It Ic chap Ar user Ar secret
309d1e933edSAllan JudeA set of CHAP authentication credentials.
310d1e933edSAllan JudeNote that targets must only use one of
311d1e933edSAllan Jude.Sy auth-group , chap , No or Sy chap-mutual ;
312d1e933edSAllan Judeit is a configuration error to mix multiple types in one target.
313d1e933edSAllan Jude.It Ic chap-mutual Ar user Ar secret Ar mutualuser Ar mutualsecret
314d1e933edSAllan JudeA set of mutual CHAP authentication credentials.
315d1e933edSAllan JudeNote that targets must only use one of
316d1e933edSAllan Jude.Sy auth-group , chap , No or Sy chap-mutual ;
317d1e933edSAllan Judeit is a configuration error to mix multiple types in one target.
318d1e933edSAllan Jude.It Ic initiator-name Ar initiator-name
319d1e933edSAllan JudeAn iSCSI initiator name.
320d1e933edSAllan JudeOnly initiators with a name matching one of the defined
321d1e933edSAllan Judenames will be allowed to connect.
3228cb2e958SEdward Tomasz NapieralaIf not defined, there will be no restrictions based on initiator
3238cb2e958SEdward Tomasz Napieralaname.
324d1e933edSAllan JudeThis clause is mutually exclusive with
325d1e933edSAllan Jude.Sy auth-group ;
326d1e933edSAllan Judeone cannot use
3278cb2e958SEdward Tomasz Napieralaboth in a single target.
328d1e933edSAllan Jude.It Ic initiator-portal Ar address Ns Op / Ns Ar prefixlen
329d1e933edSAllan JudeAn iSCSI initiator portal: an IPv4 or IPv6 address, optionally
330d1e933edSAllan Judefollowed by a literal slash and a prefix length.
331d1e933edSAllan JudeOnly initiators with an address matching one of the defined
332d1e933edSAllan Judeaddresses will be allowed to connect.
3338cb2e958SEdward Tomasz NapieralaIf not defined, there will be no restrictions based on initiator
3348cb2e958SEdward Tomasz Napieralaaddress.
335d1e933edSAllan JudeThis clause is mutually exclusive with
336d1e933edSAllan Jude.Sy auth-group ;
337d1e933edSAllan Judeone cannot use
3388cb2e958SEdward Tomasz Napieralaboth in a single target.
339d3219654SEdward Tomasz Napierala.Pp
340d3219654SEdward Tomasz NapieralaThe
341d3219654SEdward Tomasz Napierala.Sy auth-type ,
342d3219654SEdward Tomasz Napierala.Sy chap ,
343d3219654SEdward Tomasz Napierala.Sy chap-mutual ,
344d3219654SEdward Tomasz Napierala.Sy initiator-name ,
345d3219654SEdward Tomasz Napieralaand
346d3219654SEdward Tomasz Napierala.Sy initiator-portal
347d3219654SEdward Tomasz Napieralaclauses in the target context provide an alternative to assigning an
348d3219654SEdward Tomasz Napierala.Sy auth-group
349d3219654SEdward Tomasz Napieraladefined separately, useful in the common case of authentication settings
350d3219654SEdward Tomasz Napieralaspecific to a single target.
351d3219654SEdward Tomasz Napierala.It Ic portal-group Ar name Op Ar ag-name
352d1e933edSAllan JudeAssign a previously defined portal group to the target.
353d1e933edSAllan JudeThe default portal group is
354d1e933edSAllan Jude.Qq Ar default ,
355d1e933edSAllan Judewhich makes the target available
356009ea47eSEdward Tomasz Napieralaon TCP port 3260 on all configured IPv4 and IPv6 addresses.
357d3219654SEdward Tomasz NapieralaOptional second argument specifies
358d3219654SEdward Tomasz Napierala.Sy auth-group
359d3219654SEdward Tomasz Napieralafor connections to this specific portal group.
360d3219654SEdward Tomasz NapieralaIf second argument is not specified, target
361d3219654SEdward Tomasz Napierala.Sy auth-group
362d3219654SEdward Tomasz Napieralais used.
363057abcb0SAlexander Motin.It Ic port Ar name
364d83595b2SAlexander Motin.It Ic port Ar name/pp
365d83595b2SAlexander Motin.It Ic port Ar name/pp/vp
366d83595b2SAlexander MotinAssign specified CTL port (such as "isp0" or "isp2/1") to the target.
367d3219654SEdward Tomasz NapieralaThis is used to export the target through a specific physical - eg Fibre
368d3219654SEdward Tomasz NapieralaChannel - port, in addition to portal-groups configured for the target.
369d3219654SEdward Tomasz NapieralaUse
370d3219654SEdward Tomasz Napierala.Cm "ctladm portlist"
371d3219654SEdward Tomasz Napieralacommand to retrieve the list of available ports.
372d3219654SEdward Tomasz NapieralaOn startup
373d3219654SEdward Tomasz Napierala.Xr ctld 8
374d3219654SEdward Tomasz Napieralaconfigures LUN mapping and enables all assigned ports.
375057abcb0SAlexander MotinEach port can be assigned to only one target.
3768774c018SEdward Tomasz Napierala.It Ic redirect Ar address
3776dbdbf82SEdward Tomasz NapieralaIPv4 or IPv6 address to redirect initiators to.
3786dbdbf82SEdward Tomasz NapieralaWhen configured, all initiators attempting to connect to this target
3796dbdbf82SEdward Tomasz Napieralawill get redirected using "Target moved temporarily" login response.
3806dbdbf82SEdward Tomasz NapieralaRedirection happens after successful authentication.
381920c6cbaSAlexander Motin.It Ic lun Ar number Ar name
382920c6cbaSAlexander MotinExport previously defined
383920c6cbaSAlexander Motin.Sy lun
384920c6cbaSAlexander Motinby the parent target.
385d1e933edSAllan Jude.It Ic lun Ar number
386d1e933edSAllan JudeCreate a
387d1e933edSAllan Jude.Sy lun
388d1e933edSAllan Judeconfiguration context, defining a LUN exported by the parent target.
389d3219654SEdward Tomasz Napierala.Pp
390d3219654SEdward Tomasz NapieralaThis is an alternative to defining the LUN separately, useful in the common
391d3219654SEdward Tomasz Napieralacase of a LUN being exported by a single target.
392009ea47eSEdward Tomasz Napierala.El
393d1e933edSAllan Jude.Ss lun Context
394009ea47eSEdward Tomasz Napierala.Bl -tag -width indent
395d1e933edSAllan Jude.It Ic backend Ar block No | Ar ramdisk
396d1e933edSAllan JudeThe CTL backend to use for a given LUN.
397009ea47eSEdward Tomasz NapieralaValid choices are
398d1e933edSAllan Jude.Qq Ar block
399009ea47eSEdward Tomasz Napieralaand
400d1e933edSAllan Jude.Qq Ar ramdisk ;
401009ea47eSEdward Tomasz Napieralablock is used for LUNs backed
402c63d8c3bSEdward Tomasz Napieralaby files or disk device nodes; ramdisk is a bitsink device, used mostly for
403009ea47eSEdward Tomasz Napieralatesting.
404009ea47eSEdward Tomasz NapieralaThe default backend is block.
405d1e933edSAllan Jude.It Ic blocksize Ar size
406d1e933edSAllan JudeThe blocksize visible to the initiator.
407cf8f2fa2SAlexander MotinThe default blocksize is 512 for disks, and 2048 for CD/DVDs.
4083933f7b1SAlexander Motin.It Ic ctl-lun Ar lun_id
4093933f7b1SAlexander MotinGlobal numeric identifier to use for a given LUN inside CTL.
4103933f7b1SAlexander MotinBy default CTL allocates those IDs dynamically, but explicit specification
4113933f7b1SAlexander Motinmay be needed for consistency in HA configurations.
412d1e933edSAllan Jude.It Ic device-id Ar string
413d1e933edSAllan JudeThe SCSI Device Identification string presented to the initiator.
41491be33dcSAlexander Motin.It Ic device-type Ar type
41591be33dcSAlexander MotinSpecify the SCSI device type to use when creating the LUN.
41691be33dcSAlexander MotinCurrently CTL supports Direct Access (type 0), Processor (type 3)
41791be33dcSAlexander Motinand CD/DVD (type 5) LUNs.
418d1e933edSAllan Jude.It Ic option Ar name Ar value
419d1e933edSAllan JudeThe CTL-specific options passed to the kernel.
420d1e933edSAllan JudeAll CTL-specific options are documented in the
421d1e933edSAllan Jude.Sx OPTIONS
422d1e933edSAllan Judesection of
4234f66b233SEdward Tomasz Napierala.Xr ctladm 8 .
424d1e933edSAllan Jude.It Ic path Ar path
4256775608bSEdward Tomasz NapieralaThe path to the file, device node, or
4266775608bSEdward Tomasz Napierala.Xr zfs 8
4276775608bSEdward Tomasz Napieralavolume used to back the LUN.
4286775608bSEdward Tomasz NapieralaFor optimal performance, create the volume with the
4296775608bSEdward Tomasz Napierala.Qq Ar volmode=dev
4306775608bSEdward Tomasz Napieralaproperty set.
431d1e933edSAllan Jude.It Ic serial Ar string
432d1e933edSAllan JudeThe SCSI serial number presented to the initiator.
433d1e933edSAllan Jude.It Ic size Ar size
434915dcdb7SRobert WingThe LUN size, in bytes or by number with a suffix of
435915dcdb7SRobert Wing.Sy K , M , G , T
436915dcdb7SRobert Wing(for kilobytes, megabytes, gigabytes, or terabytes).
437915dcdb7SRobert WingWhen the configuration is in UCL format, use the suffix format
438915dcdb7SRobert Wing.Sy kKmMgG Ns | Ns Sy bB ,
439915dcdb7SRobert Wing(i.e., 4GB, 4gb, and 4Gb are all equivalent).
440009ea47eSEdward Tomasz Napierala.El
441009ea47eSEdward Tomasz Napierala.Sh FILES
442009ea47eSEdward Tomasz Napierala.Bl -tag -width ".Pa /etc/ctl.conf" -compact
443009ea47eSEdward Tomasz Napierala.It Pa /etc/ctl.conf
444009ea47eSEdward Tomasz NapieralaThe default location of the
445009ea47eSEdward Tomasz Napierala.Xr ctld 8
446009ea47eSEdward Tomasz Napieralaconfiguration file.
447009ea47eSEdward Tomasz Napierala.El
448009ea47eSEdward Tomasz Napierala.Sh EXAMPLES
449009ea47eSEdward Tomasz Napierala.Bd -literal
4503bea5b97SEdward Tomasz Napieralaauth-group ag0 {
451009ea47eSEdward Tomasz Napierala	chap-mutual "user" "secret" "mutualuser" "mutualsecret"
452009ea47eSEdward Tomasz Napierala	chap-mutual "user2" "secret2" "mutualuser" "mutualsecret"
453a5f9f526SEdward Tomasz Napierala	initiator-portal 192.168.1.1/16
454009ea47eSEdward Tomasz Napierala}
455009ea47eSEdward Tomasz Napierala
4563bea5b97SEdward Tomasz Napieralaauth-group ag1 {
4573bea5b97SEdward Tomasz Napierala	auth-type none
4583bea5b97SEdward Tomasz Napierala	initiator-name "iqn.2012-06.com.example:initiatorhost1"
4593bea5b97SEdward Tomasz Napierala	initiator-name "iqn.2012-06.com.example:initiatorhost2"
4603bea5b97SEdward Tomasz Napierala	initiator-portal 192.168.1.1/24
4613bea5b97SEdward Tomasz Napierala	initiator-portal [2001:db8::de:ef]
4623bea5b97SEdward Tomasz Napierala}
4633bea5b97SEdward Tomasz Napierala
4643bea5b97SEdward Tomasz Napieralaportal-group pg0 {
465009ea47eSEdward Tomasz Napierala	discovery-auth-group no-authentication
4663bea5b97SEdward Tomasz Napierala	listen 0.0.0.0:3260
4673bea5b97SEdward Tomasz Napierala	listen [::]:3260
4683bea5b97SEdward Tomasz Napierala	listen [fe80::be:ef]:3261
469009ea47eSEdward Tomasz Napierala}
470009ea47eSEdward Tomasz Napierala
471009ea47eSEdward Tomasz Napieralatarget iqn.2012-06.com.example:target0 {
472c63d8c3bSEdward Tomasz Napierala	alias "Example target"
473009ea47eSEdward Tomasz Napierala	auth-group no-authentication
474009ea47eSEdward Tomasz Napierala	lun 0 {
475a178d09eSEdward Tomasz Napierala		path /dev/zvol/tank/example_0
476009ea47eSEdward Tomasz Napierala		blocksize 4096
477009ea47eSEdward Tomasz Napierala		size 4G
478009ea47eSEdward Tomasz Napierala	}
479009ea47eSEdward Tomasz Napierala}
480009ea47eSEdward Tomasz Napierala
481920c6cbaSAlexander Motinlun example_1 {
4823bea5b97SEdward Tomasz Napierala	path /dev/zvol/tank/example_1
4833bac1be8SAlexander Motin	option naa 0x50015178f369f093
484009ea47eSEdward Tomasz Napierala}
485920c6cbaSAlexander Motin
486920c6cbaSAlexander Motintarget iqn.2012-06.com.example:target1 {
4873bea5b97SEdward Tomasz Napierala	auth-group ag0
4883bea5b97SEdward Tomasz Napierala	portal-group pg0
489920c6cbaSAlexander Motin	lun 0 example_1
490009ea47eSEdward Tomasz Napierala	lun 1 {
491920c6cbaSAlexander Motin		path /dev/zvol/tank/example_2
492d3219654SEdward Tomasz Napierala		option vendor "FreeBSD"
493009ea47eSEdward Tomasz Napierala	}
494009ea47eSEdward Tomasz Napierala}
4953bac1be8SAlexander Motin
4963bac1be8SAlexander Motintarget naa.50015178f369f092 {
4973bac1be8SAlexander Motin	port isp0
4983bac1be8SAlexander Motin	port isp1
4993bac1be8SAlexander Motin	lun 0 example_1
5003bac1be8SAlexander Motin}
501009ea47eSEdward Tomasz Napierala.Ed
5022b30a69dSEdward Tomasz Napierala.Pp
5032b30a69dSEdward Tomasz NapieralaAn equivalent configuration in UCL format, for use with
5042b30a69dSEdward Tomasz Napierala.Fl u :
5052b30a69dSEdward Tomasz Napierala.Bd -literal
5062b30a69dSEdward Tomasz Napieralaauth-group {
5072b30a69dSEdward Tomasz Napierala	ag0 {
5082b30a69dSEdward Tomasz Napierala		chap-mutual = [
5092b30a69dSEdward Tomasz Napierala			{
5102b30a69dSEdward Tomasz Napierala				user = "user"
5112b30a69dSEdward Tomasz Napierala				secret = "secretsecret"
5122b30a69dSEdward Tomasz Napierala				mutual-user = "mutualuser"
5132b30a69dSEdward Tomasz Napierala				mutual-secret = "mutualsecret"
5142b30a69dSEdward Tomasz Napierala			},
5152b30a69dSEdward Tomasz Napierala			{
5162b30a69dSEdward Tomasz Napierala				user = "user2"
5172b30a69dSEdward Tomasz Napierala				secret = "secret2secret2"
5182b30a69dSEdward Tomasz Napierala				mutual-user = "mutualuser"
5192b30a69dSEdward Tomasz Napierala				mutual-secret = "mutualsecret"
5202b30a69dSEdward Tomasz Napierala			}
5212b30a69dSEdward Tomasz Napierala		]
5222b30a69dSEdward Tomasz Napierala	}
5232b30a69dSEdward Tomasz Napierala
5242b30a69dSEdward Tomasz Napierala	ag1 {
5252b30a69dSEdward Tomasz Napierala		auth-type = none
5262b30a69dSEdward Tomasz Napierala		initiator-name = [
5272b30a69dSEdward Tomasz Napierala			"iqn.2012-06.com.example:initiatorhost1",
5282b30a69dSEdward Tomasz Napierala			"iqn.2012-06.com.example:initiatorhost2"
5292b30a69dSEdward Tomasz Napierala		]
5302b30a69dSEdward Tomasz Napierala		initiator-portal = [192.168.1.1/24, "[2001:db8::de:ef]"]
5312b30a69dSEdward Tomasz Napierala	}
5322b30a69dSEdward Tomasz Napierala}
5332b30a69dSEdward Tomasz Napierala
5342b30a69dSEdward Tomasz Napieralaportal-group {
5352b30a69dSEdward Tomasz Napierala	pg0 {
5362b30a69dSEdward Tomasz Napierala		discovery-auth-group = no-authentication
5372b30a69dSEdward Tomasz Napierala		listen = [
5382b30a69dSEdward Tomasz Napierala			0.0.0.0:3260,
5392b30a69dSEdward Tomasz Napierala			"[::]:3260",
5402b30a69dSEdward Tomasz Napierala			"[fe80::be:ef]:3261"
5412b30a69dSEdward Tomasz Napierala		]
5422b30a69dSEdward Tomasz Napierala	}
5432b30a69dSEdward Tomasz Napierala}
5442b30a69dSEdward Tomasz Napierala
5452b30a69dSEdward Tomasz Napieralalun {
5462b30a69dSEdward Tomasz Napierala	example_1 {
5472b30a69dSEdward Tomasz Napierala		path = /dev/zvol/tank/example_1
5482b30a69dSEdward Tomasz Napierala		options {
5492b30a69dSEdward Tomasz Napierala			naa = "0x50015178f369f093"
5502b30a69dSEdward Tomasz Napierala		}
5512b30a69dSEdward Tomasz Napierala	}
5522b30a69dSEdward Tomasz Napierala}
5532b30a69dSEdward Tomasz Napierala
5542b30a69dSEdward Tomasz Napieralatarget {
5552b30a69dSEdward Tomasz Napierala	"iqn.2012-06.com.example:target0" {
5562b30a69dSEdward Tomasz Napierala		alias = "Example target"
5572b30a69dSEdward Tomasz Napierala		auth-group = no-authentication
558*5b511473SJohn Baldwin		lun = {
559*5b511473SJohn Baldwin			0 {
560b797cc83SJohn Baldwin				path = /dev/zvol/tank/example_0
561b797cc83SJohn Baldwin				blocksize = 4096
562b797cc83SJohn Baldwin				size = 4GB
563b797cc83SJohn Baldwin			}
564*5b511473SJohn Baldwin		}
5652b30a69dSEdward Tomasz Napierala	}
5662b30a69dSEdward Tomasz Napierala
5672b30a69dSEdward Tomasz Napierala	"iqn.2012-06.com.example:target1" {
5682b30a69dSEdward Tomasz Napierala		auth-group = ag0
569e49db000SJohn Baldwin		portal-group = pg0
570*5b511473SJohn Baldwin		lun {
571*5b511473SJohn Baldwin			0 = example_1
572*5b511473SJohn Baldwin			1 {
573b797cc83SJohn Baldwin				path = /dev/zvol/tank/example_2
574b797cc83SJohn Baldwin				options {
575b797cc83SJohn Baldwin					vendor = "FreeBSD"
576b797cc83SJohn Baldwin				}
577b797cc83SJohn Baldwin			}
578*5b511473SJohn Baldwin		}
5792b30a69dSEdward Tomasz Napierala	}
5802b30a69dSEdward Tomasz Napierala
5812b30a69dSEdward Tomasz Napierala	naa.50015178f369f092 {
5822b30a69dSEdward Tomasz Napierala		port = isp0
583*5b511473SJohn Baldwin		lun {
584*5b511473SJohn Baldwin			0 = example_1
585*5b511473SJohn Baldwin		}
5862b30a69dSEdward Tomasz Napierala	}
5872b30a69dSEdward Tomasz Napierala}
5882b30a69dSEdward Tomasz Napierala.Ed
589009ea47eSEdward Tomasz Napierala.Sh SEE ALSO
590009ea47eSEdward Tomasz Napierala.Xr ctl 4 ,
591009ea47eSEdward Tomasz Napierala.Xr ctladm 8 ,
5926775608bSEdward Tomasz Napierala.Xr ctld 8 ,
5936775608bSEdward Tomasz Napierala.Xr zfs 8
594009ea47eSEdward Tomasz Napierala.Sh AUTHORS
595009ea47eSEdward Tomasz NapieralaThe
596009ea47eSEdward Tomasz Napierala.Nm
597009ea47eSEdward Tomasz Napieralaconfiguration file functionality for
598009ea47eSEdward Tomasz Napierala.Xr ctld 8
599009ea47eSEdward Tomasz Napieralawas developed by
60001c2b8acSBaptiste Daroussin.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
601009ea47eSEdward Tomasz Napieralaunder sponsorship from the FreeBSD Foundation.
602