Latest interface: 0.3.1
Latest system: 010
Installation
Install istgt from ports:
cd /usr/ports/net/istgt/
make install clean


Configuration
Now adjust configuration:
ee /usr/local/etc/istgt/istgt.conf
And replace the file with the following contents:
[Global]
Comment "Global section"
# node name (not include optional part)
NodeBase "vx.istgt"
# NodeBase "iqn.2007-09.jp.ne.peach.istgt"

# files
PidFile /var/run/istgt.pid
AuthFile /usr/local/etc/istgt/auth.conf
# NOT SUPPORTED
# MediaFile /usr/local/etc/istgt/media.conf
# LiveFile /usr/local/etc/istgt/istgt.live

# 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 32
MaxConnections 8

# iSCSI initial parameters negotiate with initiators
# NOTE: incorrect values might crash
FirstBurstLength 65536
MaxBurstLength 262144
MaxRecvDataSegmentLength 262144

[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 127.0.0.1:3261
# accept IP netmask
#Netmask [::1]
Netmask 127.0.0.1

# You should set IPs in /etc/rc.conf for physical I/F
[PortalGroup1]
Comment "T1 portal"
Portal DA1 10.0.0.10:3260
# for dhcp clients use 0.0.0.0 (max. 1 declaration!)
# Portal DA1 0.0.0.0:3260

[InitiatorGroup1]
Comment "V1 group"
# InitiatorName "iqn.1993-08.org.debian:01:16498f7229"
InitiatorName "vx1.ubuntu"
Netmask 10.0.0.0/24

[LogicalUnit1]
TargetName V1
Mapping PortalGroup1 InitiatorGroup1
AuthGroup AuthGroup1
UnitType Disk
QueueDepth 255
# QueueDepth 0
LUN0 Storage /dev/zvol/tank/zvol/V1 20GB


Authentication
Now edit the auth.conf file:
ee /usr/local/etc/istgt/auth.conf
And replace the file with the following contents:
[AuthGroup1]
Comment "VX1"
Auth "vx1.ubuntu" "vx1passwd"

# tag 9999 is defined as AuthGroup for Dicsovery in sample istgt.conf
[AuthGroup9999]
# Auth "*"
Auth "vx1.ubuntu" "vx1passwd"

# tag 10000 is defined as AuthGroup for UnitControl in sample istgt.conf
[AuthGroup10000]
Comment "Unit Controller's users"
Auth "testuser" "secret" "mutual user" "mutual secret"
Auth "ctluser" "test" "mutualuser" "mutualsecret"
Auth "onlysingle" "secret"

# end


Start the daemon
Now ensure that /etc/rc.conf has the istgt_enable="YES" set. You can start the daemon with the following command:
/usr/local/etc/rc.d/istgt start
If you change the configuration you need to restart the daemon:
/usr/local/etc/rc.d/istgt restart

Valid XHTML 1.1