开始之前需要打开两个虚拟机,一个当Server端,一个当Client端。
一、首先在SERVER
端操作。
1、
[root@localhost /]# yum -y install targetd targetcli
2、重启target服务。
[root@localhost /]# systemctl start target
3、启用target服务。
[root@localhost /]# systemctl enable target
Created symlink from /etc/systemd/system/multi-user.target.wants/target.service to /usr/lib/systemd/system/target.service.
4、查看target服务此时的状态。
[root@localhost /]# systemctl status target
● target.service - Restore LIO kernel target configuration
Loaded: loaded (/usr/lib/systemd/system/target.service; enabled; vendor preset: disabled)
Active: active (exited) since 四 2022-04-28 20:16:45 CST; 3min 22s ago
Main PID: 70281 (code=exited, status=0/SUCCESS)
4月 28 20:16:45 localhost.localdomain systemd[1]: Starting Restore LIO kerne...
4月 28 20:16:45 localhost.localdomain target[70281]: No saved config file at...
4月 28 20:16:45 localhost.localdomain systemd[1]: Started Restore LIO kernel...
Hint: Some lines were ellipsized, use -l to show in full.
二、设置防火墙。
1、添加tcp端口号
[root@localhost /]# firewall-cmd --add-port=3260/tcp --permanent
success