ICMP Echo Reply が返ってこれば「xxxx is alive」、返ってこなければ「xxx is unreachable」と表示されます。
KKIntt@jackson:~$ fping 172.16.26.1
172.16.26.1 is alive
KKInt@jackson:~$ fping 172.16.26.5
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
172.16.26.5 is unreachable
もちろん、IPアドレスだけでなく、ホスト名を指定することもできます。
KKInt@jackson:~$ fping www.yahoo.co.jp
www.yahoo.co.jp is alive
宛先の複数指定
単純に、ICMP Echo Request を送信したい宛先を並べて指定します。
KKInt@jackson:~$ fping 172.16.26.1 172.16.26.2 172.16.26.4
172.16.26.1 is alive
172.16.26.2 is alive
172.16.26.4 is alive
KKInt@jackson:~$ fping -g 172.16.26.1 172.16.26.5
172.16.26.1 is alive
172.16.26.2 is alive
172.16.26.4 is alive
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.3
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.3
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.3
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.3
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
172.16.26.3 is unreachable
172.16.26.5 is unreachable
KKInt@jackson:~$ fping -g 172.16.26.0/29
172.16.26.1 is alive
172.16.26.2 is alive
172.16.26.4 is alive
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.6
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.6
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.6
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.6
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.5
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.3
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.3
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.3
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.3
172.16.26.3 is unreachable
172.16.26.5 is unreachable
172.16.26.6 is unreachable
kanta@jackson:~$
KKInt@jackson:~$ fping -f ping-list
172.16.26.1 is alive
172.16.26.2 is alive
172.16.26.4 is alive
172.16.26.7 is alive
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.8
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.8
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.8
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.8
172.16.26.8 is unreachable
KKInt@jackson:~$ fping -f ping-list 2> /dev/null
172.16.26.1 is alive
172.16.26.2 is alive
172.16.26.4 is alive
172.16.26.7 is alive
172.16.26.8 is unreachable
alive なホストのみ表示
-a オプションを使用すると、ICMP Echo Replyを返す(Alive)ホストのみを表示することができます。
KKInt@jackson:~$ fping -f ping-list -s
172.16.26.1 is alive
172.16.26.2 is alive
172.16.26.4 is alive
172.16.26.7 is alive
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.8
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.8
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.8
ICMP Host Unreachable from 172.16.26.11 for ICMP Echo sent to 172.16.26.8
172.16.26.8 is unreachable
5 targets
4 alive
1 unreachable
0 unknown addresses
4 timeouts (waiting for response)
8 ICMP Echos sent
4 ICMP Echo Replies received
4 other ICMP received
0.207 ms (min round trip time)
0.229 ms (avg round trip time)
0.249 ms (max round trip time)
4.107 sec (elapsed real time)
kk@Jackson:/etc/iscsi$ ls -la
total 36
drwxr-xr-x 2 root root 4096 Feb 6 12:01 .
drwxr-xr-x 149 root root 12288 Feb 6 12:01 ..
-rw------- 1 root root 348 Feb 6 12:01 initiatorname.iscsi <<< このファイルを編集
-rw-r--r-- 1 root root 13334 Jan 19 2022 iscsid.conf
kk@Jackson:/etc/iscsi$
kk@Jackson:/etc/iscsi$ sido vim initiatorname.iscsi
iSCSI ターゲットとなるストレージ側で設定しているターゲット名(IQN)を指定します。
## DO NOT EDIT OR REMOVE THIS FILE!
## If you remove this file, the iSCSI daemon will not start.
## If you change the InitiatorName, existing access control lists
## may reject this initiator. The InitiatorName must be unique
## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames.
# InitiatorName=iqn.2004-10.com.ubuntu:01:c317f55f6df
InitiatorName=iqn.2004-04.com.qnap:ts-231k:iscsi.jonathan.45e748 <<< iSCSI ターゲットを指定
次に、同じフォルダーにある「iscsid.conf」ファイルを編集します。
kk@Jackson:/etc/iscsi$ ls -la
total 36
drwxr-xr-x 2 root root 4096 Feb 6 12:10 .
drwxr-xr-x 149 root root 12288 Feb 6 12:01 ..
-rw------- 1 root root 415 Feb 6 12:10 initiatorname.iscsi
-rw-r--r-- 1 root root 13334 Jan 19 2022 iscsid.conf <<< このファイルを編集
kk@Jackson:/etc/iscsi$
kk@Jackson:/etc/iscsi$ sido vim iscsid.conf
58行目から70行目にかけて設定をしていきます。
まず、CHAP 認証を有効にします。
次に、iSCSI ターゲット側で設定しているユーザー名とパスワードを指定します。
# *************
# CHAP Settings
# *************
# To enable CHAP authentication set node.session.auth.authmethod
# to CHAP. The default is None.
#node.session.auth.authmethod = CHAP
node.session.auth.authmethod = CHAP <<< コメントを外して有効化
# To configure which CHAP algorithms to enable set
# node.session.auth.chap_algs to a comma seperated list.
# The algorithms should be listen with most prefered first.
# Valid values are MD5, SHA1, SHA256, and SHA3-256.
# The default is MD5.
#node.session.auth.chap_algs = SHA3-256,SHA256,SHA1,MD5
# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
#node.session.auth.username = username
#node.session.auth.password = password
node.session.auth.username = kkint <<< ユーザー名を指定
node.session.auth.password = 1234567890abcde <<< パスワードを指定
iSCSI のデーモンを再起動して、設定変更を読み込ませます。
kk@Jackson:/etc/iscsi$ sudo systemctl restart iscsid open-iscsi
kk@Jackson:/etc/iscsi$ systemctl status iscsid open-iscsi.service
● iscsid.service - iSCSI initiator daemon (iscsid)
Loaded: loaded (/lib/systemd/system/iscsid.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2024-02-06 12:18:43 JST; 18s ago
TriggeredBy: ● iscsid.socket
Docs: man:iscsid(8)
Process: 808615 ExecStartPre=/lib/open-iscsi/startup-checks.sh (code=exited, status=0/SUCCESS)
Process: 808618 ExecStart=/sbin/iscsid (code=exited, status=0/SUCCESS)
Main PID: 808620 (iscsid)
Tasks: 2 (limit: 4488)
Memory: 4.4M
CPU: 42ms
CGroup: /system.slice/iscsid.service
├─808619 /sbin/iscsid
└─808620 /sbin/iscsid
Feb 06 12:18:43 Jackson systemd[1]: Starting iSCSI initiator daemon (iscsid)...
Feb 06 12:18:43 Jackson iscsid[808618]: iSCSI logger with pid=808619 started!
Feb 06 12:18:43 Jackson systemd[1]: Started iSCSI initiator daemon (iscsid).
Feb 06 12:18:44 Jackson iscsid[808619]: iSCSI daemon with pid=808620 started!
○ open-iscsi.service - Login to default iSCSI targets
Loaded: loaded (/lib/systemd/system/open-iscsi.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Tue 2024-02-06 12:18:43 JST; 18s ago
├─ ConditionDirectoryNotEmpty=|/etc/iscsi/nodes was not met
└─ ConditionDirectoryNotEmpty=|/sys/class/iscsi_session was not met
Docs: man:iscsiadm(8)
man:iscsid(8)
Feb 06 12:01:54 Jackson systemd[1]: Condition check resulted in Login to default iSCSI targets be>
Feb 06 12:18:43 Jackson systemd[1]: Condition check resulted in Login to default iSCSI targets be>
kk@Jackson:/etc/iscsi$
kkint@ubuntu:/etc$ cat /etc/crontab
/etc/crontab: system-wide crontab
Unlike any other crontab you don't have to run the `crontab'
command to install the new version when you edit this file
and files in /etc/cron.d. These files also have username fields,
that none of the other crontabs do.
SHELL=/bin/sh
You can also override PATH, but by default, newer versions inherit it from the environment
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
Example of job definition:
.---------------- minute (0 - 59)
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12) OR jan,feb,mar,apr …
| | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * user-name command to be executed
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
kkint@ubuntu:/etc$
IP アドレスが複数必要のない名前ベースのバーチャルホストの方が主流ですが、実際は、両方を混在させて使うケースもあります。
名前ベースのバーチャルホストの設定例
IP アドレスは同じで、複数のウェブサイト(ドメイン)を提供するのが特徴です。
# Ensure that Apache listens on port 80
Listen 80
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /www/kkint1
ServerName www.kkinternational.com
# Other directives here
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /www/kkint2
ServerName www.kkinternational.work
# Other directives here</VirtualHost>
TLS/SSL ハンドシェークに含まれていて、クライアント PC が、到達しようとしている ウェブサイトの正しい SSL 証明書を確認することができるようにします。
Server Name Indication(SNI、サーバー ネーム インディケーション、サーバ名表示)は、SSL/TLSの拡張仕様の一つである。SSLハンドシェイク時にクライアントがアクセスしたいホスト名を伝えることで、サーバ側がグローバルIPごとではなくホスト名によって異なる証明書を使い分けることを可能にする。
lsof(エルエスオーエフ)コマンドは”list open files”の意味であり、多くのUnix系オペレーティングシステムで、オープン中のファイルやそのファイルをオープンしているプロセスのリストを出力するコマンドである。このオープンソースのユーティリティは、パデュー大学コンピューティングセンターの元アソシエートディレクター、ビクター・A・アベルによって開発・サポートされた。lsofはいくつかのUnix系OSで動作し、サポートされている。