ISCSI.CONF(5) File Formats Manual ISCSI.CONF(5)

iscsi.confISCSI daemon configuration file

The iscsid(8) daemon implements the Internet Small Computer Systems Interface as described in RFC 3720.

The iscsi.conf configuration file is divided into the following main sections:

User-defined variables may be defined and used later, simplifying the configuration file.
Global settings for iscsid(8).
Target-specific parameters.

With the exception of macros, the sections should be grouped and appear in iscsi.conf in the order shown above.

The current line can be extended over multiple lines using a backslash (‘\’). Comments can be put anywhere in the file using a hash mark (‘#’), 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.

Argument names not beginning with a letter, digit, or underscore must be quoted.

Additional configuration files can be included with the include keyword, for example:

include "/etc/iscsi-target.conf"

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, target, or port). Macros are not expanded inside quotes.

For example:

target "disk1" {
        targetaddr $target1

There are a few settings that affect the operation of the iscsid(8) daemon globally.

(oui|en|rand) base qual
The Initiator Session ID isid specifies the initiator part of the Session Identifier. It is set during startup of iscsid(8) and is used for session reinstatement. By default a random isid is generated on startup. The random rand form has a 24-bit random number as base and a 16-bit qual qualifier. The oui format uses a 22-bit base OUI and a 24-bit qual qualifier. The IANA enterprise number format en uses the 24-bit enterprise number in base and a 16-bit qual qualifier.

iscsid(8) establishes TCP connections to iSCSI targets. Each target is specified by a section, which allows properties to be set specifically for that target:

target disk1 {
	targetname ""

There are several target properties:

No session will be established to the target if disabled is set. The default value is enabled.
Define the type of session that will be established. It is possible to initiate a special discovery session to a target to enumerate the available volumes.
addr [inet|inet6]
When iscsid(8) initiates the TCP connection to the target system, it normally does not bind to a specific IP address and port. If an initiatoraddr is given, it binds to this address first.
Specify the initiatorname used to connect to the remote target. The initiatorname can be used to restrict access to a target. If not given, iscsid(8) will use as default.
addr [inet|inet6] [port num]
Define the target IP address which iscsid(8) should connect to. By default port 3260 will be used.
The targetname specifies which LUN or disk should be requested by iscsid(8). It is possible to enumerate remote systems with a discovery session.

iscsid(8) configuration file.

tcp(4), iscsictl(8), iscsid(8), rc.conf.local(8)

The iscsi.conf file format first appeared in OpenBSD 4.9.

March 31, 2022 OpenBSD 7.5