# istgt configuration file
#
# Please do not write parameters excluding ASCII.
# The parameter must be quoted if space or separator include.
#
# The section of PortalGroup, InitiatorGroup and LogicalUnit can be
# reloaded by sending SIGHUP to the istgt process.
#
# configuration syntax:
# spaces at head of line are deleted, other spaces are as separator
# starting with '#' is comment line, not evaluate
# ending with '\' is concatenating next line
# bracket key is section key grouping following keys
# group number of section key is used as tag number
# (group number might not be continuous value)
# 1st string is key may appear multiple times
# 2nd and more are value associated the key
# Comment key is placed for human readable like user interface
#
[Global]
  Comment "Global section"
  # node name (not include optional part)
  NodeBase "cb.rescue"

  # files
  PidFile /var/run/istgt.pid
  AuthFile /etc/istgt/auth.conf.cbrescue

  # directories
  # for removable media (virtual DVD/virtual Tape)
  MediaDirectory /var/istgt

  # syslog facility
  LogFacility "local7"

  # socket I/O timeout sec. (polling is infinity)
  Timeout 30
  # NOPIN sending interval sec.
  NopInInterval 20

  # authentication information for discovery session
  DiscoveryAuthMethod Auto
  #DiscoveryAuthGroup AuthGroup9999

  # reserved maximum connections and sessions
  # NOTE: iSCSI boot is 2 or more sessions required
  MaxSessions 16
  MaxConnections 4

  # maximum number of sending R2T in each connection
  # actual number is limited to QueueDepth and MaxCmdSN and ExpCmdSN
  # 0=disabled, 1-256=improves large writing
  MaxR2T 32

  # iSCSI initial parameters negotiate with initiators
  # NOTE: incorrect values might crash
  MaxOutstandingR2T 16
  DefaultTime2Wait 2
  DefaultTime2Retain 60
  FirstBurstLength 262144
  MaxBurstLength 1048576
  MaxRecvDataSegmentLength 262144

  # NOTE: not supported
  InitialR2T Yes
  ImmediateData Yes
  DataPDUInOrder Yes
  DataSequenceInOrder Yes
  ErrorRecoveryLevel 0

[UnitControl]
  Comment "Internal Logical Unit Controller"
  #AuthMethod Auto
  AuthMethod CHAP Mutual
  AuthGroup AuthGroup10000
  # this portal is only used as controller (by istgtcontrol)
  # if it's not necessary, no portal is valid
  #Portal UC1 [::1]:3261
  Portal UC1 0.0.0.0:3261
  # accept IP netmask
  #Netmask [::1]
  Netmask 0.0.0.0/24

# You should set IPs in /etc/rc.conf for physical I/F
[PortalGroup1]
  Comment "ANY IP"
  # Portal Label(not used) IP(IPv6 or IPv4):Port
  #Portal DA1 [2001:03e0:06cf:0003:021b:21ff:fe04:f405]:3260
  Portal DA1 0.0.0.0:3260

# wildcard address you may need if use DHCP
# DO NOT USE WITH OTHER PORTALS
#[PortalGroup1]
#  Comment "ANY IP"
#  # Portal Label(not used) IP(IPv6 or IPv4):Port
#  #Portal DA1 [::]:3260
#  Portal DA1 0.0.0.0:3260

[InitiatorGroup1]
  Comment "Initiator Group1"
  # name with ! deny login/discovery
  #InitiatorName "!iqn.1991-05.com.microsoft:moon"
  # spetified name allow login/discovery
  #InitiatorName "iqn.1991-05.com.microsoft:saturn"
  # special word "ALL" match all of initiators
  InitiatorName "ALL"
  Netmask IPADDRESS/24

# TargetName, Mapping, UnitType, LUN0 are minimum required
#[LogicalUnit1]
#  Comment "Hard Disk 1"
#  TargetName sda
#  TargetAlias "Data Disk1"
#  Mapping PortalGroup1 InitiatorGroup1
#  AuthMethod Auto
#  AuthGroup AuthGroup1
#  ReadOnly Yes
#  UseDigest Auto
#  UnitType Disk
#  LUN0 Storage /dev/sda Auto

#[LogicalUnit2]
#  Comment "Hard Disk 2"
#  TargetName sdb
#  TargetAlias "Data Disk2"
#  Mapping PortalGroup1 InitiatorGroup1
#  AuthMethod Auto
#  AuthGroup AuthGroup1
#  ReadOnly Yes
#  UseDigest Auto
#  UnitType Disk
#  LUN0 Storage /dev/sdb Auto



#  Comment "Pass-through Disk Sample"
#  TargetName pass-disk1
#  TargetAlias "Pass Through Disk1"
#  Mapping PortalGroup1 InitiatorGroup1
#  AuthMethod Auto
#  AuthGroup AuthGroup1
#  UnitType Pass
#  # DO NOT SPECIFY PARTITION, PASS-THROUGH USE ENTIRE LOGICAL UNIT
#  LUN0 Device /dev/da0
