Initiator config

/etc/iscsi/initiatorname.iscsi

Enter name as per example below:

<code>InitiatorName=iqn.2004-04.com.qnap:ts-259:iscsi:nasportland:c5d1f7</code>

Discover target

# iscsiadm -m discovery -t sendtargets -p 192.168.1.104

Confirm status

# iscsiadm -m node -o show
# BEGIN RECORD 2.1.1
node.name = iqn.2004-04.com.qnap:ts-259:iscsi.nasportland.c5d1f7
.
.
node.discovery_address = 192.168.1.104
.
.
node.conn[0].address = 192.168.1.104
node.conn[0].port = 3260
.
.
# END RECORD

Login

# iscsiadm -m node --login
Logging in to [iface: default, target: iqn.2004-04.com.qnap:ts-259:iscsi.nasportland.c5d1f7, portal: 192.168.1.104,3260]
Logging in to [iface: default, target: iqn.2004-04.com.qnap:ts-259:iscsi.nasportland.c5d1f7, portal: 169.254.100.100,3260]
Login to [iface: default, target: iqn.2004-04.com.qnap:ts-259:iscsi.nasportland.c5d1f7, portal: 192.168.1.104,3260] successful.

Note the 169.254 address is autoassigned to eth2 on the NAS even though not connected and this is discovered by iscsiadm which then hangs trying to log in - annoying.

And this is how to get rid of the “ghost” node

# iscsiadm --mode node --targetname iqn.2004-04.com.qnap:ts-259:iscsi.nasportland.c5d1f7 --portal 169.254.100.100 -o delete

Confirm established session

# iscsiadm -m session -o show
tcp: [1] 192.168.1.104:3260,1 iqn.2004-04.com.qnap:ts-259:iscsi.nasportland.c5d1f7 (non-flash)