Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two NIC's that have access to my iSCSI network. I want to specify the initiator IP as well as the Target portal IP and create redundant links and use MPIO.

This is easily done using the Advanced settings in the iSCSI initiator GUI. However, I want to be able to specify the initiator IP using iscsicli.

I am pretty sure the answer is in one of the options for iscsicli persistentlogin where there are 15 "*'s" that represent different options. I am just not sure what * to replace with what.

share|improve this question
I figured out that you need to use this command: iscsicli addtargetportal 3260 ROOT\ISCSIPRT\0000_0 1 * * * * * * * * * * The 1 after ROOT\ISCSIPRT\0000_0 identifies the IP Address. If I specify 2, it will have a different source IP. However, I still need to find a way to programatically associate that number with an IP. It's not the Index that you see when you run netsh int ip sh int Getting closer! – Andy Schneider Sep 6 '09 at 20:34

The trick is set the "port number" parameter in the AddTargetPortal command in iscsicli.

However, the only way I was able to associate this port number with an actual IP address is using WMI. In order to figure this out, I used PowerShell

Function Get-IscsiPortNumber {

$query = "select portalinformation from msIsci_portalinfoclass"                                       
$portalInfo = get-wmiobject -namespace root\wmi -query $query
$eScriptBlock ={([Net.IPAddress]$_.ipaddr.IPV4Address).IPAddressToString}
$customLabel = @{Label="IpAddress"; expression = $eScriptBlock}
$portalInfo.portalInformation | select port,$customlabel


Once you track down the port number (let's say 2) you can use the following to add the target portal assuming the target has an ip of The port number comes after the initiator name, ROOT\ISCSIPRT\0000_0

iscsicli addtargetportal 3260 ROOT\ISCSIPRT\0000_0 2 * * * * * * * * * *
share|improve this answer

I don't have an answer but I want to try and encourage some additional input as I am also very interested in this. Have you exhausted the possibilities demonstrated in the comment by Fulgan in this technet thread.?

There is a specific discussion of the challenges related to your problem in this technet thread but there doesn't seem to be any resolution. The key parameter for the persistentlogin seems to be the fourth default (*) that the iSCSI documentation refers to as the port number.

I assume you have been trawling through the MS iSCSI Initiator documentation but if not you can find it here - it is quite detailed and has an explanation of each parameter unfortunately it doesn't seem to shed light on this particular problem.

share|improve this answer
@Helvick I have read that article and the userguide and thought I had the answer using the interface index as that fourth option, but it didn't take. – Andy Schneider Jul 20 '09 at 13:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.