How to configure iSCSI service on FreeNAS with Windows server 2012 iSCSI Initiator?

Today we will look at how to configure iSCSI service on FreeNAS.

FreeNAS is a free and open-source software network-attached storage (NAS) system based on FreeBSD  system. FreeNAS supports Windows, OS X and Unix clients and various virtualization hosts such as XenServer and VMware.FreeNAS supports the OpenZFS files system which provides data integrity checking to prevent data corruption, enable point in time snapshotting, replication and several levels of redundancy including striping, mirroring, striped mirrors (RAID 1+0), and three levels of RAID-Z.

To configure iSCSI service on FreeNAS, please follow steps below:

1.Login to FreeNAS web administration:

0Iscsiconfigure

2.Shortly i want show you some basic configuration below, You can set your own hostname,DNS and etc:

1Iscsiconfigure 2Iscsiconfigure 4Iscsiconfigure

3.Then go to  Storage->Volumes and click on Volume Manager , type Volume Name and click + to add available disk and click Add Volume:

5Iscsiconfigure 6Iscsiconfigure

4.You can set permission to that volume  by clicking Permission (2):

7Iscsiconfigure

8Iscsiconfigure

5.  To configure iSCSI navigate to Sharing->Block(iSCSI)->Target Global Configuration and accept or modify Base Name and click Save:

9Iscsiconfigure

6. To setup authorized access click Add Authorized access and type User name and secret key and click OK:

10Iscsiconfigure

7. To allow Initiators  Go to the menu Initiators > Add Initiator and click OK:

24freenasnfs

8. Click Portal->Add Portal  and select iSCSI IP and port:

25freenasnfs

9.When an iSCSI Initiator connects to an iSCSI server it connects to a Target. To create a Target click Targets and Add Target. Enter a Target Name and set all setting alike as picture below:  

26freenasnfs

10. To create volume for iSCSI  click Create zvol volume and type name for volume and size and click Add zvol:

27freenasnfs

11.To add a device extent, go to Sharing > Block ISCSI > Extents > Add Extent:

28freenasnfs

12. Type Extent name and click ok:

29freenasnfs

13.After the Extent created, the next step is the Target-Extent association. Click Associated Targets and Add Extent to Target and select Target and Extent from the list:

30freenasnfs

14. To start service iSCSI click Services menu and launch the iSCSI service:

31freenasnfs

15. That’s all for FreeNas server. Now log on to Windows server 2012(or other) and Open the iSCSI Initiator. Specify the IP address used during the Portal configuration and click Quick Connect:

32freenasnfs

16. As we see target Inactive. To active target we need to authenticate target and initiator, So click Done:

33freenasnfs

17.Select Target and click Connect:

34freenasnfs

18. Click Advanced :

35freenasnfs

19. Enable CHAP log on and type name and target secret which we define on freenas server and click OK:

36freenasnfs

20. So target is connected. Now we can enable and use iSCSI storage from Disk managment:

37freenasnfs