#!/bin/tcsh
#
#	vi: set autoindent tabstop=4 shiftwidth=4 :
#
#	ini-m2
#
#	bring up a new initiator session
#	should be run on a machine whose initiator loads as host 2
#
./iscsi_manage init restore host=2 target=0
./iscsi_manage init set TargetName=iqn.2002-10.edu.unh.iol.iscsi.draft20-target:0 host=2 target=0
./iscsi_manage init set InitiatorName=iqn.1999-11.edu.unh.iol.iscsi.draft20-initiator host=2 target=0
./iscsi_manage init set InitiatorAlias=UNH-Draft20-Initiator host=2 target=0
#
# force initiator to offer security stage, even if it has no keys to send
#./iscsi_manage init force s host=2
#
# to turn on CHAP Authentication -- also need to define names and secrets (next)
#./iscsi_manage init set AuthMethod=CHAP,None host=2
#
# for the UNH reference target CHAP Authentication
#./iscsi_manage init force b t cl=256 lx="wild_cat_and_dog" ln=UNH-reference-Target px="UNH cowhampshire" pn=anonymous-user-of-UNH-reference-Target host=2
#
# for the UNH TARGET target.t script CHAP Authentication in both directions
#./iscsi_manage init force b t cl=256 lx="When will it begin?" ln=UNH-TESTOR-Target px="This should work now!" pn=anonymous-user-of-UNH-TESTOR-Target host=2
#
# for the UNH TARGET target.t script CHAP Authentication initiator only
#./iscsi_manage init force b cl=256 px="This should work now!" pn=anonymous-user-of-UNH-TESTOR-Target host=2
#
# to turn on SRP Authentication -- also need to define names and secrets (next)
#./iscsi_manage init set AuthMethod=SRP,None host=2
#
#./iscsi_manage init force b t host=2
#./iscsi_manage init force sx="old_man_of_the_mountain" host=2
#./iscsi_manage init force sn=UNH-IOL-user-name host=2
#
# uncomment only 1 of the following 5 lines to configure the SRP group
# larger groups take correspondingly longer to compute
#./iscsi_manage init force sg=SRP-768 host=2
#./iscsi_manage init force sg=SRP-1024 host=2
#./iscsi_manage init force sg=SRP-1280 host=2
#./iscsi_manage init force sg=SRP-1536 host=2
#./iscsi_manage init force sg=SRP-2048 host=2
#
#./iscsi_manage init set HeaderDigest=CRC32C,None host=2
#./iscsi_manage init set DataDigest=CRC32C,None host=2
#
./iscsi_manage init set MaxConnections=6 host=2 target=0
./iscsi_manage init set MaxOutstandingR2T=10 host=2
#
#### performance usually better the larger these numbers are
./iscsi_manage init set MaxRecvDataSegmentLength=4096 host=2
./iscsi_manage init set FirstBurstLength=16384 host=2
./iscsi_manage init set MaxBurstLength=16384 host=2
#./iscsi_manage init set MaxRecvDataSegmentLength=12288 host=2
#./iscsi_manage init set FirstBurstLength=16384 host=2
#./iscsi_manage init set MaxBurstLength=32768 host=2
#./iscsi_manage init set MaxRecvDataSegmentLength=16773120 host=2
#./iscsi_manage init set MaxBurstLength=16773120 host=2
#./iscsi_manage init set FirstBurstLength=16773120 host=2
#
#### performance usually better when all write data goes immediate/unsolicited
#### (which is the combination InitialR2T=No and ImmediateData=Yes)
./iscsi_manage init set InitialR2T=Yes host=2
./iscsi_manage init set ImmediateData=No host=2
#
#### performance usually better when everything goes in order
#./iscsi_manage init set DataPDUInOrder=No host=2
#./iscsi_manage init set DataSequenceInOrder=No host=2
#
#./iscsi_manage init set OFMarker=No host=2
#./iscsi_manage init set IFMarker=No host=2
#./iscsi_manage init set IFMarkInt=4096~32768 host=2
#./iscsi_manage init set OFMarkInt=4096~4096 host=2
#./iscsi_manage init set DefaultTime2Wait=10 host=2
#./iscsi_manage init set DefaultTime2Retain=6 host=2
#
./iscsi_manage init set ErrorRecoveryLevel=1 host=2
#
#	set the command retransmit interval to 4 seconds
#	(when ErrorRecoverLevel is greater than 0)
./iscsi_manage init force p=4 host=2
#
#	uncomment the following to enable initiator to send SNACKs to target
#	(when ErrorRecoverLevel is greater than 0)
./iscsi_manage init snack d=y host=2
./iscsi_manage init snack s=y host=2
#
#	uncomment the following to get a discovery session
#./iscsi_manage init set SessionType=Discovery host=2 target=0
#./iscsi_manage init setp SendTargets=All host=2 target=0
#
#	uncomment the following to try an X-extension key
#./iscsi_manage init set X-edu.unh.iol-extension-key-1=hello_over_there host=2
#
#	sch=1 to force round-robin scheduling if there are multiple connections
#	sch=2 to force lun-assigned-to_connection scheduling on multiple luns/conns
#		(when using sch=2, connections must be brought up before the luns)
./iscsi_manage init force sch=1 host=2
#
#	force nop pings to be sent to target every 10 seconds
#./iscsi_manage init force n=5 host=2

#	force flat-space lun addressing (default is peripheral device addressing)
#./iscsi_manage init force f host=2
#
#./iscsi_config up ip=127.0.0.1 host=2 lun=0 target=0
./iscsi_config up ip=tweety-gig port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=tweety port=5000 host=2 lun=0 target=0
#./iscsi_config up ip=192.1.1.17 port=5001 host=2 lun=0 target=0
#./iscsi_config up ip=\[fe80::2e0:29ff:fe6c:70dc\] port=5001 host=2 lun=0 target=0
#./iscsi_config up ip=\[fe80::207:e9ff:fe19:9c35\] port=5000 host=2 lun=0 target=0
#./iscsi_config up ip=\[2000::210:4bff:fe2b:b5ae\] port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=FEDC:BA98:7654:3210:FEDC:BA98:7654:3210 port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=1080:0:0:0:8:800:200C:4171 port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=3ffe:2a00:100:7031::1 port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=1080::8:800:200C:417A port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=::192.9.5.7 port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=::FFFF:129.144.52.38 port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=2010:836B:4179::836B:4179 port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=FF01::101 port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=::1 port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=:: port=3260 host=2 lun=0 target=0
#./iscsi_config up ip=FF09:: port=3260 host=2 lun=0 target=0
