A10 Thunder(vThunder、ACOS 5.2.0)の CLI は、Cisco の IOS に近いコマンド体系で、ネットワーク機器を触ったことがあれば迷わず使えます。この記事では、Thunder を運用するときによく使う CLI コマンドを、実際の出力と一緒にまとめます。
- CLI のモード(Exec/特権/設定)と移り方、設定の保存
- 出力の絞り込み(begin/include/exclude/section)と起動領域の切り替え
- 基本設定(ホスト名、パスワード、DNS、時刻)のコマンド
- 状態確認(バージョン、CPU、メモリ、インタフェース、ルーティング、ログ)と診断のコマンド
- 再起動・停止、設定の比較、コマンドの定期実行
基本操作
Thunder の CLI には、Exec モード、特権モード、設定モードの3つのモードがあります。モードごとに実行できるコマンドが違い、プロンプトの記号で今どのモードにいるかがわかります。
Exec モード
CLI にログインするときの既定のユーザ名は admin、パスワードは a10 です。ログインすると Exec モードになり、プロンプトが > になります。
既定のパスワードのまま運用するのは危険なので、後で説明する admin コマンドで変更してください。A10 のセキュリティ強化ガイド(ACOS Security Hardening Guide)では、新しいバージョンでは初回ログイン時に既定のパスワード a10 の変更が求められると説明されています。
vThunder
vThunder>
Exec モードでは、show による参照や ping などの確認はできますが、設定は変更できません。Exec モードを抜けるときは exit を入力します。
vThunder
vThunder>exit
Are you sure to quit (N/Y)?:Y
特権モード(enable)
Exec モードで enable を入力すると特権モードに移り、プロンプトが # になります。特権モードでは、Exec モードのコマンドに加えて、reboot や shutdown、設定の保存などが実行できます。特権モードに入るときのパスワードは、既定では空(Enter を押すだけ)です。
vThunder
vThunder>enable
Password:
vThunder#
特権モードを抜けるときは exit を入力します。
vThunder
vThunder#exit
vThunder>
設定モード(configure terminal)
特権モードでも設定は変更できません。設定を変えるときは、特権モードで configure terminal を入力して設定モードに移ります。
vThunder
vThunder#configure terminal
vThunder(config)#
設定モードを抜けるときは exit を入力します。
vThunder
vThunder(config)#exit
vThunder#
設定保存(write memory)
設定モードで変えた内容は、すぐに動作に反映されますが、そのままでは再起動すると消えます。次の起動時に読み込まれる startup-config に保存するには、特権モードで write memory を入力します。
vThunder
vThunder# write memory Building configuration... Write configuration to default primary startup-config [OK] vThunder#
ページング無効化(terminal length 0)
既定では、出力が長いと1画面ごとに表示が止まり、キーを押してページを送る必要があります。ページングを止めるには、特権モードで terminal length 0 を入力します。
vThunder
vThunder#terminal length 0
特権モードで入力した terminal length 0 は、そのセッションだけに効き、ログアウトすると元に戻ります。いつでもページングを止めておきたい場合は、設定モードで terminal length 0 を入力します。running-config に terminal length 0 が入り、保存すれば再起動後も残ります。
vThunder
vThunder(config)#terminal length 0 vThunder(config)#show running-config !Current configuration: 892 bytes !Configuration last updated at 13:08:06 GMT Mon Nov 29 2021 !Configuration last saved at 13:09:24 GMT Mon Nov 29 2021 !64-bit Advanced Core OS (ACOS) version 5.2.0, build 155 (Aug-10-2020,14:34)/ ! no terminal auto-size terminal idle-timeout 60 terminal length 0 ! vlan 10 untagged ethernet 1 router-interface ve 10 !
ページングを元に戻すには、no terminal length を入力します。設定モードで入れた設定を消す場合は、設定モードで同じコマンドを入力します。
vThunder
vThunder# no terminal length
| コマンド | 入力するモード | 効く範囲 |
|---|---|---|
| terminal length 0 | 特権モード | 今のセッションだけ |
| terminal length 0 | 設定モード | 設定として残る(保存すれば再起動後も) |
| no terminal length | 入力したのと同じモード | 既定(24 行)に戻す |
出力を条件によりフィルタ(begin/include/exclude/section)
コマンドの後ろにパイプ(|)と条件を付けると、出力を条件に合う行だけに絞り込めます。show running-config を例に、4つの条件を使ってみます。
| 条件 | 表示される行 |
|---|---|
| | begin 文字列 | 文字列を含む最初の行から最後まで |
| | include 文字列 | 文字列を含む行だけ |
| | exclude 文字列 | 文字列を含む行を除いたすべて |
| | section 文字列 | 文字列を含む行と、その配下(字下げされた行) |
条件の文字列から表示する(begin)
show running-config の出力を、「vlan」を含む行から表示します。
vThunder
vThunder#show running-config | begin vlan
vlan 10
untagged ethernet 1
router-interface ve 10
!
vlan 200
untagged ethernet 2
router-interface ve 200
!
!
web-service gui-timeout-policy idle 60
!
条件の文字列を含む行(include)
show running-config の出力から、「pool」を含む行だけを表示します。
vThunder
vThunder# show running-config | include pool
ip nat pool snat_pool_group_member1 10.0.200.13 10.0.200.13 netmask /24
ip nat pool snat_pool_group_member2 10.0.200.15 10.0.200.15 netmask /24
ip nat pool snat_pool_group_member3 10.0.200.17 10.0.200.17 netmask /24
ip nat pool-group snat_pool_group1
member snat_pool_group_member1
member snat_pool_group_member2
member snat_pool_group_member3
条件の文字列を含む行を除く(exclude)
show running-config の出力から、「vlan」を含む行を除いて表示します。vlan 10 の行は消えますが、その配下の行は残っています。
vThunder
vThunder# show running-config | exclude vlan
!Current configuration: 873 bytes
!Configuration last updated at 13:18:12 GMT Mon Nov 29 2021
!Configuration last saved at 13:09:24 GMT Mon Nov 29 2021
!64-bit Advanced Core OS (ACOS) version 5.2.0, build 155 (Aug-10-2020,14:34)
!
no terminal auto-size
terminal idle-timeout 60
!
untagged ethernet 1
router-interface ve 10
!
untagged ethernet 2
router-interface ve 200
!
!
条件の文字列を含むセクション(section)
show running-config の出力から、「slb server」を含むセクションを、配下の設定も含めて表示します。
vThunder
vThunder#show running-config | section slb server
slb server Web-01 10.0.200.100
health-check custom_ping
port 80 tcp
health-check hc_http
slb server Web-02 10.0.200.173
port 80 tcp
起動領域(bootimage)
Thunder のハードディスクには、primary と secondary の2つの領域があり、それぞれに OS イメージと startup-config を持っています。どちらの領域から起動しているかは、show bootimage で確認できます。
vThunder
vThunder#show bootimage
(* = Default)
Version
-----------------------------------------------
Hard Disk primary 5.2.0.155 (*)
Hard Disk secondary 5.2.0.155
(*) が付いているのが、今の起動に使われている領域です。この例では primary から起動しています。この状態で write memory を実行すると、primary の startup-config に保存されます。
vThunder
vThunder#write memory
Building configuration...
Write configuration to default primary startup-config
[OK]
保存先の領域を指定したい場合は、write memory の後ろに primary か secondary を付けます。
vThunder
vThunder# write memory primary Building configuration... Write configuration to default primary startup-config [OK] vThunder#write memory secondary Building configuration... Write configuration to default secondary startup-config [OK] vThunder#
次の起動に使う領域は、設定モードの bootimage hd で指定します。
vThunder
vThunder(config)#bootimage hd ?
pri Primary image
sec Secondary image
secondary から起動するようにするには、bootimage hd sec を実行します。
vThunder
vThunder(config)#bootimage hd sec
Secondary image will be used if system is booted from hard disk
vThunder(config)#exit
再起動すると、secondary に (*) が付き、secondary から起動したことを確認できます。
vThunder
vThunder# reboot Proceed with reboot? [yes/no]: yes
vThunder
vThunder# show bootimage
(* = Default)
Version
-----------------------------------------------
Hard Disk primary 5.2.0.155
Hard Disk secondary 5.2.0.155 (*)
起動する領域を変えると、読み込まれる startup-config も変わります。切り替える前に、起動先の領域に必要な設定が保存されているか確認してください。2つの領域は、OS のバージョンアップ時に、もとのバージョンに戻せるよう片方を残しておく使い方ができます。
設定情報取得
設定情報取得(show running-config)
今動いている設定(running-config)を見るには、show running-config を実行します。
vThunder
vThunder#show running-config
!Current configuration: 873 bytes
!Configuration last updated at 13:18:12 GMT Mon Nov 29 2021
!Configuration last saved at 13:09:24 GMT Mon Nov 29 2021
!64-bit Advanced Core OS (ACOS) version 5.2.0, build 155 (Aug-10-2020,14:34)
!
no terminal auto-size
terminal idle-timeout 60
!
vlan 10
untagged ethernet 1
router-interface ve 10
!
デフォルト設定情報取得(with-default)
既定値のままの設定も含めて表示するには、with-default を付けます。既定値の行も出るので、出力はかなり長くなります(この例では 19388 bytes)。
vThunder
vThunder#show running-config with-default
!Current configuration: 19388 bytes
!Configuration last updated at 13:18:12 GMT Mon Nov 29 2021
!Configuration last saved at 13:09:24 GMT Mon Nov 29 2021
!64-bit Advanced Core OS (ACOS) version 5.2.0, build 155 (Aug-10-2020,14:34)
!
visibility
granularity 5
file metrics enable
reporting
session-logging disable
anomaly-detection
sensitivity low
disable
logging disable
port-scan-detection
threshold 10 60
ping-sweep-detection
threshold 10 60
packet-capture
capture-config
concurrent-captures-age 1
number-of-packets-per-conn 0
次回起動時の設定情報取得(show startup-config)
次の起動時に読み込まれる設定(startup-config)を見るには、show startup-config を実行します。
vThunder
vThunder#show startup-config
Show default startup-config
Building configuration...
!Current configuration: 2430 bytes
!Configuration last updated at 13:08:06 GMT Mon Nov 29 2021
!Configuration last saved at 13:09:24 GMT Mon Nov 29 2021
!64-bit Advanced Core OS (ACOS) version 5.2.0, build 155 (Aug-10-2020,14:34)
!
no terminal auto-size
terminal idle-timeout 60
terminal length 0
!
テクニカルサポート情報(show techsupport)
設定やログなど、障害調査に必要な情報をまとめて取得するには、show techsupport を実行します。メーカーのサポートに問い合わせるときに提出を求められることがあります。
vThunder
vThunder# show techsupport
============= Clock Info =============
*08:24:13 GMT Sun Nov 28 2021
============= Version Info =============
Thunder Series Unified Application Service Gateway vThunder
基本設定
ホスト名(hostname)
ホスト名を A10-1 に変える場合は、設定モードで次のように入力します。プロンプトもすぐに新しいホスト名に変わります。
vThunder
vThunder(config)# hostname A10-1
A10-1(config)#exit
A10-1#
パスワード設定
ログインユーザ(admin)のパスワード
ユーザ admin のパスワードを P@ssw0rd に変える場合は、設定モードで次のように入力します。
vThunder
vThunder(config)#admin admin password P@ssw0rd
Modify Admin User successful!
特権モードのパスワード(enable-password)
特権モードに入るときのパスワードを P@ssw0rd にする場合は、設定モードで次のように入力します。既定ではパスワードがないので、運用前に設定してください。
vThunder
vThunder(config)# enable-password P@ssw0rd
DNS 設定(ip dns primary/secondary)
Thunder が名前解決に使う DNS サーバを設定します。プライマリとセカンダリを指定できます。Google のパブリック DNS を使う場合は次のとおりです。
vThunder
vThunder(config)#ip dns primary 8.8.8.8 vThunder(config)#ip dns secondary 8.8.4.4
名前解決できるか、FQDN を指定して ping を実行して確かめます。
vThunder
vThunder# ping time.google.com
PING time.google.com (216.239.35.8) 56(84) bytes of data.
64 bytes from time3.google.com (216.239.35.8): icmp_seq=1 ttl=92 time=47.4 ms
64 bytes from time3.google.com (216.239.35.8): icmp_seq=2 ttl=92 time=41.9 ms
時刻同期(timezone/ntp server)
タイムゾーンを東京(夏時間なし)にし、Google のパブリック NTP と時刻を同期する場合は、次のように入力します。nodst は夏時間(Daylight Saving Time)を使わない指定です。
vThunder
vThunder(config)# timezone Asia/Tokyo nodst vThunder(config)# ntp server time.google.com vThunder(config-ntpsvr:time.google.com)# exit vThunder(config)#
機器情報(show version)
ACOS のバージョンやシリアル番号は、show version で確認できます。primary と secondary の各領域の OS のバージョンと、次に起動する領域(default)も表示されます。
vThunder
vThunder#show version ・・・ 64-bit Advanced Core OS (ACOS) version 5.2.0, build 155 (Aug-10-2020,14:34) ・・・ Serial Number: xxxxxxxxxxxxx ・・・ Hard Disk primary image version 5.2.0, build 155 Hard Disk secondary image (default) version 5.2.0, build 155
パフォーマンス情報
CPU 使用状況(show cpu)
CPU の使用率を、直近 1 秒、5 秒、10 秒、30 秒、60 秒の平均で表示します。Control は管理系の処理、Data はトラフィックの処理に使われる CPU です。
vThunder
vThunder#show cpu
Time: Nov-29-2021, 22:48
1Sec 5Sec 10Sec 30Sec 60Sec
-------------------------------------------------------------------------------
Control1 3% 5% 6% 6% 6%
Data1 0% 0% 0% 0% 0%
Data2 0% 0% 0% 0% 0%
I/O1 0% 0% 0% 0% 0%
メモリの使用状況(show memory system)
メモリの総量、使用量、空き、使用率を表示します。
vThunder
vThunder# show memory system
Total(KB) Used Free Usage
------------------------------------------------------------
Memory: 16383328 6837923 9545405 41.70%
ディスク使用状況(show disk)
ディスクの総量、使用量、空き、使用率を MB 単位で表示します。
vThunder
vThunder# show disk
Total(MB) Used(MB) Free(MB) Usage
---------------------------------------------------
40960 7774 33185 18%
ネットワーク情報
インタフェース情報(show interfaces)
すべてのインタフェースの状態(リンク、MAC アドレス、速度、デュプレックス、パケット数など)を見るには、show interfaces を入力します。
vThunder
vThunder# show interfaces Ethernet 1 is up, line protocol is up Hardware is up, Address is xxxx.xxxx.xxxx Internet address is 0.0.0.0, Subnet mask is 0.0.0.0 Configured Speed auto, Actual 10Gbit, Configured Duplex auto, Actual fdx Member of L2 Vlan 10, Port is Untagged Flow Control is disabled, IP MTU is 1500 bytes Port as Mirror disabled, Monitoring this Port disabled 94 packets input 8512 bytes Received 0 broadcasts, Received 0 multicasts, Received 94 unicasts 0 input errors 0 CRC 0 frame 0 runts 0 input giants 639 packets output 32314 bytes Transmitted 0 broadcasts, Transmitted 0 multicasts, Transmitted 639 unicasts 0 output errors 0 output giants 0 collisions 300 second input rate: 16 bits/sec, 0 packets/sec, 0% utilization 300 second output rate: 88 bits/sec, 0 packets/sec, 0% utilization ・ ・ ・
この構成では、IP アドレスは物理ポートではなく VLAN の仮想インタフェース(ve 10)に設定しているので、ethernet 1 の Internet address は 0.0.0.0 になっています。物理ポートは VLAN 10 の Untagged ポートとして動いています。
ARP テーブル(show arp)
ARP テーブルを見るには、show arp を入力します。管理ポート(Management)側で学習したエントリも表示されます。
vThunder
vThunder# show arp
Total arp entries: 3 Age time: 300 secs
IP Address MAC Address Type Age Interface Vlan
---------------------------------------------------------------------------
10.0.10.1 xxxx.xxxx.xxxx Dynamic 61 ethernet 1 10
10.0.100.1 xxxx.xxxx.xxxx Dynamic 61 Management 1
10.0.200.1 xxxx.xxxx.xxxx Dynamic 61 ethernet 2 200
ルーティングテーブル(show ip route)
ルーティングテーブルを見るには、show ip route を入力します。この例では、デフォルトルートのネクストホップが 10.0.10.1 で、10.0.10.0/24 と 10.0.200.0/24 が直接接続のネットワークです。
vThunder
vThunder# show ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
Gateway of last resort is 10.0.10.1 to network 0.0.0.0
S* 0.0.0.0/0 [250/0] via 10.0.10.1, ve 10, 00:18:58
C 10.0.10.0/24 is directly connected, ve 10, 00:48:14
C 10.0.200.0/24 is directly connected, ve 200, 00:48:21
ネットワーク診断(ping/traceroute)
ping は、既定ではデータ用のインタフェースから送信します。管理ポートから送信したい場合は、use-mgmt-port オプションを付けます。
vThunder
vThunder# ping 8.8.8.8 use-mgmt-port
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=105 time=2.63 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=105 time=2.68 ms
traceroute も ping と同じように use-mgmt-port を付けられます。
vThunder
vThunder# traceroute use-mgmt-port 8.8.8.8
traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
・
・
17 108.170.242.193 (108.170.242.193) 4.541 ms * *
18 dns.google (8.8.8.8) 1.553 ms 1.528 ms 2.228 ms
ヘルスチェックテスト(health-test)
サーバへのヘルスチェックが通るかどうかは、health-test で試せます。リアルサーバとして登録しなくても、IP アドレスを指定して試せるので、サーバを登録する前の確認にも使えます。
10.0.200.100 に ICMP のヘルスチェックを試します。応答があれば、node status が UP になります。
vThunder
vThunder# health-test 10.0.200.100 node status UP. ICMP Receive OK.
ICMP の応答がなければ、node status が DOWN になります。
vThunder
vThunder# health-test 10.0.200.101 node status DOWN. ICMP Receive Error.
設定済みのヘルスモニタを使って試すこともできます。ヘルスモニタ hc_http で 10.0.200.100 を試す場合は、monitorname にヘルスモニタの名前を指定します。
vThunder
vThunder# health-test 10.0.200.100 monitorname hc_http node status UP. HTTP Status Code OK.
ヘルスモニタ hc_http の設定は、【A10 Thunder】サーバ負荷分散ヘルスチェックと動作確認 5.2.0 を参照してください。
ログ情報(show log)
システムログは show log で表示します。新しいログが上に表示されます。
vThunder
vThunder# show log
Log Buffer: 30000
Nov 29 2021 22:41:27 Error [SYSTEM]:NTP server time.google.com is not reachable
Nov 29 2021 22:40:04 Notice [SYSTEM]:Timezone is set to JST
Nov 29 2021 13:15:44 Notice [SYSTEM]:A cli session for user "admin" from (伏せています) has been opened. Session ID assigned is 5.
Nov 29 2021 13:15:44 Info [SYSTEM]:set SSH_AUTH_SOCK
Nov 29 2021 13:15:41 Notice [SYSTEM]:Session ID 3 is now cl
再起動・停止
再起動(reboot/reload)
機器を再起動するときは、reboot を実行します。
vThunder
vThunder# reboot Proceed with reboot? [yes/no]: yes
reload は、機器全体ではなく ACOS のプロセスを再起動し、startup-config を読み込み直します。
vThunder
vThunder# reload Do you wish to proceed with reload? [yes/no]:yes
reboot も reload も、起動するときに startup-config を読み込みます。保存していない設定変更は消えるので、必要なら先に write memory で保存してください。
停止(shutdown)
機器を停止するには、shutdown を実行します。保存していない設定変更があると、停止の前に保存するかどうかを聞かれます。
vThunder
vThunder# shutdown
System configuration has been modified. Save? [yes/no]:yes
Building configuration...
Write configuration to default secondary startup-config
[OK]
Proceed with shutdown? [yes/no]:yes
設定比較(diff)
今動いている設定(running-config)と、起動時に読み込まれる設定(startup-config)は、diff で比べられます。保存し忘れた変更がないか確かめるときに便利です。
vThunder
vThunder# diff startup-config running-config
出力は左右2列で、左に startup-config、右に running-config だけにある行が表示されます。
この記事の画面は、実際の画面ではなく、検証時の画面から見るポイントを抜き出して描いたイメージです。バージョンによって、項目の並びや表記は変わります。
vThunder#diff startup-config running-config!Current configuration: 956 bytes (!Configuration last updated at 13:08:06 GMT Mon Nov 29 2021 (!Configuration last saved at 13:09:24 GMT Mon Nov 29 2021 (!64-bit Advanced Core OS (ACOS) version 5.2.0, build 155 (Aug (! (no terminal auto-size (terminal idle-timeout 60 (terminal length 0 (! (1 > ip dns primary 8.8.8.8 > ! > ip dns secondary 8.8.4.4 > !vlan 10 ( untagged ethernet 1 ( router-interface ve 10 (! (vlan 200 ( untagged ethernet 2 ( router-interface ve 200 (! (
| No. | 表示 | 意味 |
|---|---|---|
| 1 | > の行 | running-config にだけある行です。ここでは ip dns primary 8.8.8.8 と ip dns secondary 8.8.4.4 が、まだ startup-config に保存されていません。 |
| ― | ( の行 | 両方の設定にある同じ行です。左の列だけに表示されます。 |
コマンドの定期実行(repeat)
同じコマンドを決まった間隔で繰り返し実行するには、repeat を使います。間隔(秒)の後ろに実行するコマンドを書きます。次は、1 秒ごとに show memory system を実行する例です。
vThunder
vThunder# repeat 1 show memory system
Ctrl+C を押すまで、コマンドが繰り返し実行されます。
vThunder#repeat 1 show memory systemTotal(KB) Free Shared Buffers Cached Usage------------------------------------------------------------------16383328 9533917 0 82048 2072341 41.80%1Refreshing command every 1 seconds. (press ^C to quit) Elapsed Time: 00:00:00Total(KB) Free Shared Buffers Cached Usage------------------------------------------------------------------16383328 9533665 0 82056 2072349 41.80%Refreshing command every 1 seconds. (press ^C to quit) Elapsed Time: 00:00:01Total(KB) Free Shared Buffers Cached Usage------------------------------------------------------------------16383328 9533665 0 82100 2072349 41.80%Refreshing command every 1 seconds. (press ^C to quit) Elapsed Time: 00:00:02Total(KB) Free Shared Buffers Cached Usage------------------------------------------------------------------
| No. | 表示 | 意味 |
|---|---|---|
| 1 | Refreshing command every 1 seconds. | 1 秒ごとに実行し直していることを表します。Elapsed Time は実行を始めてからの経過時間です。止めるときは Ctrl+C(^C)を押します。 |
まとめ
| コマンド | 用途 |
|---|---|
| enable/configure terminal/exit | モードの移動 |
| write memory [primary|secondary] | 設定の保存 |
| terminal length 0 | ページングを止める |
| show … | begin/include/exclude/section | 出力の絞り込み |
| show bootimage/bootimage hd | 起動領域の確認と切り替え |
| show running-config [with-default] | 今の設定の表示 |
| show startup-config | 次回起動時の設定の表示 |
| show techsupport | サポート用の情報一式 |
| hostname/admin/enable-password | ホスト名とパスワード |
| ip dns/timezone/ntp server | DNS と時刻 |
| show version/cpu/memory system/disk | 機器とリソースの状態 |
| show interfaces/arp/ip route | ネットワークの状態 |
| ping/traceroute [use-mgmt-port] | 疎通の確認 |
| health-test | ヘルスチェックの試験 |
| show log | システムログ |
| reboot/reload/shutdown | 再起動と停止 |
| diff startup-config running-config | 保存していない変更の確認 |
| repeat 秒 コマンド | コマンドの定期実行 |
コメント