VyOS は Linux をベースとしているため、Linux コマンドが使用できます。設定構文とコマンドライン・インターフェイスはJuniper社のJUNOSから派生しています。
詳しい内容はユーザーガイドを参照していただくとして、一通りVyOSを使えるだけの基本操作コマンドを紹介します。
|
|
終了、再起動
|
1. |
シャットダウン |
|
$ poweroff
|
|
VyOS をシャットダウンします。
|
|
vyos@vyos:~$ poweroff
Proceed with poweroff? (Yes/No) [No] y
Broadcast message from root@vyos (pts/0) (Sun Nov 8 11:27:18 2015):
The system is going down for system halt NOW!
|
|
|
2. |
再起動 |
|
$ reboot
|
|
VyOS を再起動します。
|
|
vyos@vyos:~$ reboot
Proceed with reboot? (Yes/No) [No] y
Broadcast message from root@vyos (pts/0) (Sun Nov 8 11:38:18 2015):
The system is going down for reboot NOW!
|
|
|
|
設定の確認
|
1. |
[edit] モードでない場合 |
|
$ show configs
|
|
VyOS の設定を表示します。
- 「↑」「↓」
表示内容のスクロール
- 「q」
設定表示の終了
|
|
vyos@vyos:~$ show config
interfaces {
ethernet eth0 {
address 172.16.0.1/24
description OUTSIDE
duplex auto
:
|
|
|
2. |
[edit] モードの場合 |
|
# show
全設定を表示する
# show interfaces
interfaces設定のみ表示する
|
|
VyOS の設定を表示します。
- 「↑」「↓」
表示内容のスクロール
- 「q」
設定表示の終了
|
|
[edit]
vyos@vyos# show interfaces
ethernet eth0 {
address 172.16.0.1/24
description OUTSIDE
duplex auto
hw-id 00:0c:29:d3:a3:9b
smp_affinity auto
speed auto
}
ethernet eth1 {
address 192.168.0.1/24
description INSIDE
duplex auto
hw-id 00:0c:29:d3:a3:a5
smp_affinity auto
speed auto
}
loopback lo {
}
|
|
|
|
設定の変更
|
1. |
編集モード |
|
$ configure
編集モードに入る
# exit
編集モードを抜ける
# exit discard
変更内容を破棄して編集モードを抜ける
|
|
設定の編集を行う場合には編集モードに入ります。
設定変更後、commit せずに編集モードを抜けることができませんが、discard を付けると変更内容を破棄して編集モードを抜けることができます。
|
|
vyos@vyos:~$ configure
[edit]
vyos@vyos# exit
exit
vyos@vyos:~$
|
|
|
2. |
設定の追加、変更 |
|
# set [項目] [キー] [値]
|
|
※設定追加、変更は commit を行うまで有効になりません。
- 項目
設定ファイルの{}で区切られている項目を指定
- キー
項目のキーを指定
- 値
項目に設定する値を指定
|
|
|
[edit]
vyos@vyos# set interfaces ethernet eth0 address 172.16.0.2/24
[edit]
vyos@vyos# show interface
ethernet eth0 {
address 172.16.0.1/24
+ address 172.16.0.2/24
description OUTSIDE
duplex auto
:
|
|
|
3. |
設定の削除 |
|
# delete [項目]
# delete [項目] [キー]
|
|
※設定削除は commit を行うまで有効になりません。
- 項目
設定ファイルの{}で区切られている項目を指定
- キー
項目のキーを指定
|
|
|
[edit]
vyos@vyos# delete nat destination rule 20 ← 項目を指定して削除
[edit]
vyos@vyos# show nat
destination {
- rule 20 {
- destination {
- port 2222
- }
- inbound-interface eth0
- protocol tcp
- translation {
- address 192.168.0.10
- port 80
- }
- }
}
[edit]
vyos@vyos# delete interface ethernet eth0 address ← 項目、キーを指定して削除
[edit]
vyos@vyos# show interface
ethernet eth0 {
- address 172.16.0.1/24
description OUTSIDE
duplex auto
:
|
|
|
4. |
設定の確定 |
|
# commit
|
|
変更した内容を確定します。
|
|
[edit]
vyos@vyos# commit
[edit]
vyos@vyos#
|
|
|
5. |
設定の保存 |
|
# save
|
|
変更した内容を保存します。
|
|
[edit]
vyos@vyos# save
Saving configuration to '/config/config.boot'...
Done
[edit]
vyos@vyos#
|
|
|