ISCSI Server

 

Server 端


tgtadm –lld iscsi –op new –mode target –tid 1 -T iqn.2015-08.test:test tgtadm –lld iscsi –op new –mode logicalunit –tid 1 –lun 1 -b /opt/tgtest tgtadm –lld iscsi –op bind –mode target –tid 1 -I 192.168.1.0/24 tgtadm –lld iscsi –op new –mode account –user test –password test tgtadm –lld iscsi –op show –mode account tgtadm –lld iscsi –op bind –mode account –tid 1 –user test tgtadm –lld iscsi –op show –mode target yum install iscsi-initiator-utils -y chkconfig iscsi on service iscsi restart iscsiadm –mode discoverydb –type sendtargets –portal 192.168.1.108 –discover iscsiadm –mode node –targetname iqn.2015-08.test:test –portal 192.168.1.108:3260 –login iscsiadm –mode node –targetname iqn.2015-08.test:test –portal 192.168.1.108:3260 –logout

客户端认证配置

vim /etc/iscsi/iscsid.conf


node.startup = automatic node.session.auth.authmethod = CHAP node.session.auth.username = test node.session.auth.password = test node.session.timeo.replacement_timeout = 20 example: <target iqn.2015-08.test:test> backing-store /opt/tgtest incominguser test test write-cache off </target>