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