testing iSCSI on OS X 10.6
| Posted in Germany | Posted on Saturday, August 21, 2010
Lets have a bit different blog entry today. The day started with full-on nerd stuff on gamescomm fair in cologne. 4 Huge halls presenting the latest and the greatest new games to come. Some really nice ones but way too many people to enjoy all that the fair could offer.
Once I got back to home I decided to explore a topic that had bugged be for a while: Can I connect my Mac via iSCSI to one of my Linux servers and how secure that connection would be.
The basic concept is that you need to have a target (aka server) and an initiator (client) for the connection. To get started with the setup I needed to explore the server part for starters. I had a Fedore Core 12 server at use so the target part was quite easy to build. I added RPMFusion to my repositories and installed iSCSItargets and kmod-iscsitargets to my system. I had some problems since my kernel version didn't match the availale packages so I ended up getting the packages from the project page and compiling them by hand. After getting the basics in place I created a small disk image for the setup using "dd if=/dev/zero of=/storage/lun1.img bs=1024k count=20000" and since I have an OS X initializing that for hfs+ using "mkfs.hfsplus -v test /storage/lun1.img ". Next step was to edit /etc/ietd.conf to get the LUN available via iSCSI. Important part was to create a Target setting with both IncomingUser and OutgoingUser in place so that the server and the client would need to authenticate agains each other. After this I only deeded to start the service "/etc/init.d/iscsi-target start" and I was ready from the server side
The Client side was a bit more tricky. Disk Utility does not have selection to manage iSCSI disks for some reason so I needed 3rd party software. GlobalSAN was a nice tool to do the job. Download, install and reboot and I was on my way. Go to System Preferences, GlobalSAN iSCSI and add portal with the address of your target server. In few moments I had a list of available targets. Selected the one I wanted to connect and went to Authentication settings to set the User and Target credentials. The drive appeared as mounted iSCSI device on my desktop.
The next problem was to secure the connection. Normally your iSCSI connections are on dedicated production network in your controlled datacenter but my setup was over the internet and as iSCSI does not have any transport encryption (that I know) available I needed to list my options. 1) have ipsec tunnel for the connection to encrypt the traffic 2) create an encrypted partition. Since I work usually via various vpn connections the ipsec was going to cause some problems, hence I chose to create an encrypted volume using TrueCrypt. I created the volume and mounted that as HFS+ to my mac. Traffic was now encrypted, the connection needed authentication and I even installed tripwire on the server to see local modifications on the test file so in the end I think I'm in quite good condition with the connection.
Problems that I will for sure have is on extending the volume and securing it from server failures. But as an experiment providing me deeper understanding of the technology I think I reached my goal!