Other iSCSI Syntax for multiple TargetAddresses in /etc/iscsi.conf

I am looking for the correct way to list multiple IP addresses in /etc/iscsi.conf

My storage server has both ipv4 (static) and ipv6 (ULA & GUA) assigned.

I'd like to set order of use to be:
1: IPV6 ULA
2: IPV6 GUA
3: IPV4 Static

That way:
- 1: If I am on my local network I can connect with IPV6 ULA.
- 2: If I am away from home the IPV6 GUA is used.
- 3: If I am home and my router that hands out IPV6 is down (which sometimes happens) and only my switch is up, I can still connect to my IPV4's static address.

---

Looking at the example provided in the handbook. (Handbook) Section: 30.12.2.2
Code:
t0 {
    TargetAddress   = 10.10.10.10
    TargetName      = iqn.2012-06.com.example:target0
    AuthMethod      = CHAP
    chapIName       = user
    chapSecret      = secretsecret
}

I don't see and example of how to list more than one IP as a TargetAddress.

---

I have tried a "space" and a "," between addresses, as well as multiple "TargetAddress = " entries.

Thanks for your time.
 
I'm not a specialist. Maybe this,
Code:
t0 {
    TargetAddress   = 10.10.10.10
    TargetName      = iqn.2012-06.com.example:target0
    AuthMethod      = CHAP
    chapIName       = user
    chapSecret      = secretsecret
}

t1 {
    TargetAddress   = 10.10.10.11
    TargetName      = iqn.2012-06.com.example:target1
    AuthMethod      = CHAP
    chapIName       = user
    chapSecret      = secretsecret
}
 
According to iscsi.conf() there's no way to set multiple IP addresses for target host.

You could try providing a hostname that resolves to multiple addresses, but my bet is, that this won't work reliably. You could also cobble together some shell script that sets the target address dynamically and reloads the ctld service.

Personally, I'd recommend looking at alternative technologies. ISCSI is probably not the best choice to use storage while you're on the go. At the end of the day, I don't know your particular use case, so obviously you might have your reasons.
 
Thanks for the suggestions.
It's not just "on the go" use cases.
For some reason; I get the impression iSCSI isn't well liked. I'm not sure why, it has been for the year I have been using it. More stable; less resource intensive; and a breeze to setup as it's baked right into FreeBSD.

I treat it and think about it as block level storage.
Being able to physically plug in drives to a chassis in my server cabinet. Then virtually plug them into whatever device I want over the network. Correct me if I'm wrong here, but I think that's kind of the point of the technology.

I'm not sure what other technology would fit this space without additional infrastructure.

I have had difficulty configuring SAMBA in the past; and just thinking about it makes my stomach churn.
-The benefit of this is; I can connect to a share with multiple computers at once.

NFS has similarly given me difficulties: since I have last tried, I have not been able to mount NFS shares in windows. I do believe there is support now for them, please correct me if I am misinformed.

I have found that windows works incredibly well connecting to a FreeBSD iSCSI network drive. I can leave the network and then come back or restart, and it just works. - The interesting thing is; in FreeBSD I have to export and then import the share again; if a computer leaves the network, or is restarted to get it to reconnect properly to the iSCSI resource. So anytime there is a server reboot I have to manually go in and export all my drives and reimport them. (zfs). If there is a fix to this, I would be happy to hear it.
 
According to iscsi.conf() there's no way to set multiple IP addresses for target host.

You could try providing a hostname that resolves to multiple addresses, but my bet is, that this won't work reliably. You could also cobble together some shell script that sets the target address dynamically and reloads the ctld service.

Personally, I'd recommend looking at alternative technologies. ISCSI is probably not the best choice to use storage while you're on the go. At the end of the day, I don't know your particular use case, so obviously you might have your reasons.
Thanks.
I didn't do hostnames because - I was skeptical on it's reliability.
I could put together a script that does this; I just didn't because I was looking for a more elegant/"correct" way of doing things - before I start hacking shell scripts.

There are possibly alternative technologies that may work better. I choose it for several reasons. 1. It's baked right in, no additional packages or libraries - less things to remember to install if I ever have to set up the server again. This means I can run the server as close to stock as possible. 2. It's not SAMBA. (Yes, it does have it's place - I just shudder to have it apart of mine. - This is just a personal preference.)

The use case is basically twofold - export several drives to a single laptop for use on the network. The drives don't need to be accessed by multiple people. Single host -> single target.
The 2nd use case is, to provide block storage to a server.
 
Back
Top