Make iscsitarget listen on specific address

I set up iscsitarget on one of my Ubuntu Lucid boxes and it seemed to work. I let one of my VMware ESX hosts scan it, and it sure enough found my LUN, but via two paths.

Turned out that because the host running iscsitarget has two NICs, the ESX host sees two paths. Not exactly what I wanted, because one NIC sits on the internet, the other on the dedicated iSCSI network.

Unfortunately it is not possible to configure ietd to listen to a specific address by editing any of the configuration files (/etc/default/iscsitarget and /etc/ietd.conf), you have to hack the init script to be able to do this…

Edit /etc/init.d/iscsitarget and go to the function ietd_start(), then change this line:

start-stop-daemon --start --exec $DAEMON --quiet --oknodo

to:

start-stop-daemon --start --exec $DAEMON --quiet --oknodo -- --address 10.10.1.1

(or whatever IP you want to have it listen to).

4 thoughts on “Make iscsitarget listen on specific address”

  1. The same can be accomplished by adding entries to your targets.allow in the form of “ALL 10.10.1.0/24″, for example. So ALL targets will only be discoverable on the 10.10.1.0/24 subnet and not on any others.

  2. In Debian Wheezy, you can acomplish this editing /etc/default/iscsitarget:

    ISCSITARGET_OPTIONS=”–address10.10.1.1 “

  3. @frock81 – I found a typo in your entry. It should be:

    ISCSITARGET_OPTIONS=”–address 10.10.1.1″

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Captcha
Enter the letters you see above.
(Sorry it is so long, but spammers actually type these as well.... give it your best shot if you really want to comment)