creating FreeNAS 8 iSCSI target

I didn’t find an up-to-date tutorial on how to set up a FreeNAS 8 iSCSI target, so I took notes as I set one up. Figuring this out by brute force is fairly straightforward: just keep adding iSCSI stuff until you can actually discover iSCSI targets. But for those of you who value your time, here’s how you do it.

1) Go to services, enable iscsi. Under iSCSI, choose Target Global Configuration. In Discovery Auth Method choose CHAP. Leave all other settings unchanged

2) It seems that FreeNAS doesn’t yet let you export a whole drive via iSCSI; you must create an extent. Under iSCSI, select Extents, then Add Extent. Name your extent, give it a path, and set a size.

3) On the Target Global Configuration, on the “authentication” tab, create an iSCSI user and assign it a secret

4) You need an iSCSI Portal. Click the Portals tab. This is where you define the iSCSI target. The default is to listen for iSCSI connections on all IP addresses, on port 3260. If you have multiple IP addresses, and want separate portals for each, be more specific.

5) You must authorize initiators. Choose “Authorized Initiator,” then “Add Authorized Initiator.” List the IP subnet of your initiators under Authorized Network.

6) Go to the Targets tab. Add a target.

  • Give the target a name and and an alias.
  • The type will be “disk.”
  • flags read-write
  • portal group ID is the number of the portal (probably 1)
  • initiator group ID is the number of the authorized initiators you created (probably 1)
  • Set auth method to CHAP
  • authentication group number from the user you created (also probably 1)
  • 7) Under “Associated Targets,” attach the extent to the target.

    Now go to your iSCSI initiator and log in.

    To create new iSCSI targets, create a device extent, add a target for that extent, and attach the extent to the target.

    11 comments to creating FreeNAS 8 iSCSI target

    • John

      this tutorial sucks, at the first point it already fails. WHen u select chap it needs a Discovery Auth Group.

      so rewrite this turorial or delete your post.

    • John, my FreeNAS install doesn’t need or have a Discovery Auth Group. There’s an option to use one, but no requirement. I suspect you’ve changed something…

    • TheChap

      Bit harsh John…you are obviously looking for help if you had to read up on this article, therfore some manners wouldn’t go amiss…In any case, you could just select 1 from the box which appears under the ‘CHAP’ setting – the rest of the instructions are fine.

    • Rolf

      I have to agree with John so far (afterall this is very high on the google list, looking for “discovery auth group”):

      Using FreeNAS 8.0, when I select the Discovery Auth Method to CHAP, I’m requested to select a discovery auth group. But on the pull down menu, there is nothing to select, only the default setting, which won’t be accepted.

    • Jason

      Thank you very much! i have visited many many websites which did not give me a successful experience.
      just a few tutorial for Freenas 8, i recommend it for anyone who is using Freenas 8

    • Kahrann

      Thanks for the help on this problem.
      I only had some problem to discovering the Iscsi targets.
      Does anybody have an idea?

    • valefor

      just follow through the step first then get back to the first step,
      “choose Target Global Configuration. In Discovery Auth Method choose CHAP.”

      and you will see there is a 1 under discovery auth group for you to select.

    • allen

      Before you set the Target Global Configuration, go to Authentication -> Add iSCSI User.

      It will automatically add the Group ID (default 1).

      Input your user name that you wish to use.

      Create your Secret(s).

      If you are only using CHAP you don’t need Peer or Initiator Secret.

      Then go back to Target Global Config, and the Group will show up in the drop down box.

    • allen

      Minor update – in the instructions above, do #3 BEFORE you do #1…

    • VIJAY

      Hello,

      I’m create iSCSI Target but it will not display in iSCSI initiator.
      I follow all steps for creating iSCSI disk which you gives in this but its not working.

      Plz help me for the same….

      Thanks….

    • Dan

      This works great for me, searched a few other tutorials which didnt help me but followed this and was up and running in 10 minutes. Thanks Michael!