VyOSオペレーションメモ

目次

VyOS の基本

VyOSヴィオーエス の基本操作について、日常行う操作を中心にメモしておく。

CLI には モードが2種類

プロンプトモード作業
$Operational ModeLinux OS操作や設定表示
#Configration Mode設定変更・適用・保存

モードの切り換え

変更コマンド状態
Operational → Configurationconfigureプロンプトが # に変わる
Configration → Operationalexitプロンプトが $ に変わる

オペレーショナルモード 主なコマンド

コマンド動作備考
show configuration設定表示ツリー状表示
show configuration commands設定表示コマンド形式表示
show versionバージョン表示VyOS / ハードウェア等
show XXXその他状態表示show [TAB] でサブコマンド一覧
reboot再起動
configureコンフィグレーションモードへプロンプトが # に変わる

コンフィグレーション コマンド基本

コマンド動作備考
set XXX設定変更変更はペンディングされる
delete XXX特定の設定を削除変更はペンディングされる
show XXXX設定表示ペンディング中の設定を含め表示
commit変更を適用ペンディングされた設定をすべて適用
save保存スタートアップ設定に保存
run XXXXXオペレーショナル用コマンド XXXX を実行exitせずに実行できる
例) run show configuration commands
rollback NN個前の commit まで巻き戻すN=0~
run show system commit で N を一覧確認できる
exitオペレーショナルモードへ抜けるプロンプトが $ に変わる

VyOS アップグレード

Rolling Release 版のアップグレード手順: オペレーションモードで実行

アップデート前の確認

現在の VyOS バージョンの確認

show version

Version:          VyOS 1.4-rolling-202302080317
Release train:    current

Built by:         autobuild@vyos.net
Built on:         Wed 08 Feb 2023 03:17 UTC
Build UUID:       ce4d9361-2f83-44a1-88f4-488f1aa20f02
Build commit ID:  8cade9112a16ed

Architecture:     x86_64
Boot via:         installed image
System type:      VMware guest

Hardware vendor:  VMware, Inc.
Hardware model:   VMware Virtual Platform
Hardware S/N:     VMware-42 04 e6 47 10 ac 81 be-db c7 bc e8 e2 87 ba 2b
Hardware UUID:    47e60442-ac10-be81-dbc7-bce8e287ba2b

Copyright:        VyOS maintainers and contributors

現在の VyOS イメージバージョンを確認

show system image

The system currently has the following image(s) installed:

   1: 1.4-rolling-202302080317 (default boot) (running image)

最新版がリリースされているか、VyOS nightly builds のページで確認する。最新版 ISO ファイルの URL リンクをコピーして、下記の通りコマンドに貼り付ける。

途中で聞かれるのですべて [Enter]

add system image https://github.com/vyos/vyos-rolling-nightly-builds/releases/download/1.X-rolling-YYYYMMDDnnnn/vyos-1.X-rolling-YYYYMMDDnnnn-amd64.iso
Trying to fetch ISO file from https://github.com/vyos/vyos-rolling-nightly-builds/releases/download/1.X-rolling-YYYYMMDDnnnn/vyos-1.X-rolling-YYYYMMDDnnnn-amd64.iso...
Downloading...
The file is 434.000 MiB.
[############################################################################################################] 100%
Download complete.
Done.
Checking for digital signature file...
Downloading...
(中略)
Do you want to continue without signature check? (yes/no) [yes]
Checking SHA256 checksums of files on the ISO image... OK.
Done!
What would you like to name this image? [1.X-rolling-YYYYMMDDnnnn]:
OK.  This image will be named: 1.X-rolling-YYYYMMDDnnnn
Installing "1.X-rolling-YYYYMMDDnnnn" image.
Copying new release files...
Would you like to save the current configuration
directory and config file? (Yes/No) [Yes]:
Copying current configuration...
Would you like to save the SSH host keys from your
current configuration? (Yes/No) [Yes]:
Copying SSH keys...
Running post-install script...
Setting up grub configuration...
Done.

ダウンロードしたimage が準備されているか確認

show system image

The system currently has the following image(s) installed:

  1: 1.4-rolling-202302110748 (default boot)
  2: 1.4-rolling-202302080317 (running image)

再起動

$ reboot
Are you sure you want to reboot this system? [y/N] y

再起動完了後再度 ssh でコンソールに接続する。

起動後の VyOSバージョン、イメージの状態を確認

vyos@gd4rt01:~$ show version
Version:          VyOS 1.4-rolling-202302110748
Release train:    current

Built by:         autobuild@vyos.net
Built on:         Sat 11 Feb 2023 07:48 UTC
Build UUID:       f3c3ece9-fd81-44a7-835e-ddf75a0c11f9
Build commit ID:  6d90ea4912b158

Architecture:     x86_64
Boot via:         installed image
System type:      VMware guest

Hardware vendor:  VMware, Inc.
Hardware model:   VMware Virtual Platform
Hardware S/N:     VMware-42 04 e6 47 10 ac 81 be-db c7 bc e8 e2 87 ba 2b
Hardware UUID:    47e60442-ac10-be81-dbc7-bce8e287ba2b

Copyright:        VyOS maintainers and contributors

アップデート後の確認

IPsec 接続が定義されている場合は、アップデート後に IPsec 接続が復旧しているか確認する

show vpn ipsec sa 

旧バージョンの削除

動作確認ができたら、古いイメージを削除する。show system image コマンドで表示された、使用していない方の image 名を指定する。

vyos@gd4rt01:~$ delete system image 1.4-rolling-202302080317
Are you sure you want to delete the
"1.4-rolling-202302080317" image? (Yes/No) [No]: Yes
Deleting the "1.4-rolling-202302080317" image...
Done

削除後にイメージ一覧でも削除完了していることを確認する。

vyos@gd4rt01:~$ show system image
The system currently has the following image(s) installed:

   1: 1.4-rolling-202302110748 (default boot) (running image)

参考

公式ドキュメント