This video is part of the Random Linux Stuff Playlist:
• Random Linux Stuff
============
You need root permissions...
=========
TARGET
#install the targetcli
yum install -y targetcli
#enter targetcli
targetcli
/backstores/fileio/ create lun /opt/lablun1.img 10000M
/iscsi create iqn.2024-01.nl.server-iscsi:server
/iscsi/iqn.2024-01.nl.server-iscsi:server/tpg1/acls create iqn.2024-01.nl.client-iscsi:client1
/iscsi/iqn.2024-01.nl.server-iscsi:server/tpg1/luns create /backstores/fileio/lun
/iscsi/iqn.2024-01.nl.server-iscsi:server/tpg1 set attribute authentication=1
/iscsi/iqn.2024-01.nl.server-iscsi:server/tpg1/acls/iqn.2024-01.nl.client-iscsi:client1 set auth userid=demo
/iscsi/iqn.2024-01.nl.server-iscsi:server/tpg1/acls/iqn.2024-01.nl.client-iscsi:client1 set auth password=badpassword
saveconfig
#enable and start the target service
systemctl enable target.service
systemctl status target.service
=========
=========
INITIATOR
#installing utils
yum install -y iscsi-initiator-utils
#enabling iscsid
systemctl enable iscsid --now
#echo modifying initiator name
#replace the current initiator line with this:
echo InitiatorName=iqn.2024-01.nl.client-iscsi:client1/etc/iscsi/initiatorname.iscsi
#restarting iscsid
systemctl restart iscsid.service
#adding auth to iscsid.conf
#add these lines to the bottom of the file
node.session.auth.authmethod = CHAP
node.session.auth.username = demo
node.session.auth.password = badpassword
#portal ip address this depends on your ip addresses....
iscsiadm --mode discoverydb --type sendtargets --portal 192.168.4.181 --discover
iscsiadm -m node --login
iscsiadm -m session -o show
#check for new lun with lsblk
lsblk
=======
Смотрите видео Linux iSCSI - target and initiator онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь uadmin 09 Декабрь 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 215 раз и оно понравилось 10 людям.