xref: /openbsd/usr.sbin/iscsictl/iscsi.conf.5 (revision 76d0caae)
1.\" $OpenBSD: iscsi.conf.5,v 1.4 2020/04/23 21:28:09 jmc Exp $
2.\"
3.\" Copyright (c) 2012 Claudio Jeker <claudio@openbsd.org>
4.\" Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
5.\" Copyright (c) 2002 Daniel Hartmeier <dhartmei@openbsd.org>
6.\"
7.\" Permission to use, copy, modify, and distribute this software for any
8.\" purpose with or without fee is hereby granted, provided that the above
9.\" copyright notice and this permission notice appear in all copies.
10.\"
11.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18.\"
19.Dd $Mdocdate: April 23 2020 $
20.Dt ISCSI.CONF 5
21.Os
22.Sh NAME
23.Nm iscsi.conf
24.Nd ISCSI daemon configuration file
25.Sh DESCRIPTION
26The
27.Xr iscsid 8
28daemon implements the Internet Small Computer Systems Interface as described
29in RFC 3720.
30.Pp
31The
32.Nm
33configuration file is divided into the following main sections:
34.Bl -tag -width xxxx
35.It Sy Macros
36User-defined variables may be defined and used later, simplifying the
37configuration file.
38.It Sy Global Configuration
39Global settings for
40.Xr iscsid 8 .
41.It Sy Target Configuration
42Target-specific parameters.
43.El
44.Pp
45With the exception of macros,
46the sections should be grouped and appear in
47.Nm
48in the order shown above.
49.Pp
50The current line can be extended over multiple lines using a backslash
51.Pq Sq \e .
52Comments can be put anywhere in the file using a hash mark
53.Pq Sq # ,
54and extend to the end of the current line.
55Care should be taken when commenting out multi-line text:
56the comment is effective until the end of the entire block.
57.Pp
58Argument names not beginning with a letter, digit, or underscore
59must be quoted.
60.Pp
61Additional configuration files can be included with the
62.Ic include
63keyword, for example:
64.Bd -literal -offset indent
65include "/etc/iscsi-target.conf"
66.Ed
67.Sh MACROS
68Macros can be defined that will later be expanded in context.
69Macro names must start with a letter, digit, or underscore,
70and may contain any of those characters.
71Macro names may not be reserved words (for example,
72.Ic target ,
73or
74.Ic port ) .
75Macros are not expanded inside quotes.
76.Pp
77For example:
78.Bd -literal -offset indent
79target1="1.2.3.4"
80target "disk1" {
81        targetaddr $target1
82}
83.Ed
84.Sh GLOBAL CONFIGURATION
85There are a few settings that affect the operation of the
86.Xr iscsid 8
87daemon globally.
88.Pp
89.Bl -tag -width Ds -compact
90.It Xo
91.Ic isid
92.Pq Ic oui Ns | Ns Ic en Ns | Ns Ic rand
93.Ar base qual
94.Xc
95The Initiator Session ID
96.Ic isid
97specifies the initiator part of the Session Identifier.
98It is set during startup of
99.Xr iscsid 8
100and is used for session reinstatement.
101By default a random
102.Ic isid
103is generated on startup.
104The random
105.Ic rand
106form has a 24-bit random number as
107.Ar base
108and a 16-bit
109.Ar qual
110qualifier.
111The
112.Ic oui
113format uses a 22-bit
114.Ar base
115OUI and a 24-bit
116.Ar qual
117qualifier.
118The IANA enterprise number format
119.Ic en
120uses the 24-bit enterprise number in
121.Ar base
122and a 16-bit
123.Ar qual
124qualifier.
125.El
126.Sh TARGET CONFIGURATION
127.Xr iscsid 8
128establishes TCP connections to iSCSI targets.
129Each target is specified by a
130.Em target
131section, which allows properties to be set specifically for that target:
132.Bd -literal -offset indent
133target disk1 {
134	targetaddr 10.0.0.2
135	targetname "iqn.1994-04.org.netbsd.iscsi-target:target:0"
136}
137.Ed
138.Pp
139There are several target properties:
140.Bl -tag -width Ds
141.It Op Ic disabled Ns | Ns Ic enabled
142No session will be established to the target if
143.Ic disabled
144is set.
145The default value is
146.Ic enabled .
147.It Op Ic discovery Ns | Ns Ic normal
148Define the type of session that will be established.
149It is possible to initiate a special
150.Ic discovery
151session to a target to enumerate the available volumes.
152.It Xo
153.Ic initiatoraddr Ar addr
154.Op Ic inet Ns | Ns Ic inet6
155.Xc
156When
157.Xr iscsid 8
158initiates the TCP connection to the target system, it normally does not
159bind to a specific IP address and port.
160If an
161.Ic initiatoraddr
162is given,
163it binds to this address first.
164.It Ic initiatorname Ar string
165Specify the
166.Ic initiatorname
167used to connect to the remote target.
168The
169.Ic initiatorname
170can be used to restrict access to a target.
171If not given
172.Xr iscsid 8
173will use
174.Em iqn.1995-11.org.openbsd.iscsid
175as default.
176.It Xo
177.Ic targetaddr Ar addr
178.Op Ic inet Ns | Ns Ic inet6
179.Op Ic port Ar num
180.Xc
181Define the target IP address which
182.Xr iscsid 8
183should connect to.
184By default port 3260 will be used.
185.It Ic targetname Ar string
186The
187.Ic targetname
188specifies which LUN or disk should be requested by
189.Xr iscsid 8 .
190It is possible to enumerate remote systems with a
191.Ic discovery
192session.
193.El
194.Sh FILES
195.Bl -tag -width "/etc/iscsi.confXXX" -compact
196.It Pa /etc/iscsi.conf
197.Xr iscsid 8
198configuration file.
199.El
200.Sh SEE ALSO
201.Xr tcp 4 ,
202.Xr iscsictl 8 ,
203.Xr iscsid 8 ,
204.Xr rc.conf.local 8
205.Sh HISTORY
206The
207.Nm
208file format first appeared in
209.Ox 4.9 .
210