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


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

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


  1. The same can be accomplished by adding entries to your targets.allow in the form of “ALL”, for example. So ALL targets will only be discoverable on the 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:


Leave a comment

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