Help us understand the problem. What is going on with this article?

vyosコマンドまとめ

More than 1 year has passed since last update.

vyos設定

vyosログイン

初期のvyosルータは以下のユーザ情報を入力し、ログインできる。

ユーザー:vyos
パスワード:vyos

設定モード、設定保存

設定モード

configure

設定モード解除

exit

設定保存

commit
save

設定確認

操作モードの場合はset以下のコマンドで確認できる。

$ show configuration

設定モードの場合は以下のコマンドで確認できる。

# run show configuration

IPアドレス設定

以下のコマンドでIPアドレスを設定する。IPアドレスはプレフィックス表記(xxx.xxx.xxx.xxx/xx)で記述する。

set interfaces ethernet eth0 address xxx.xxx.xxx.xxx/xx

ルーティングテーブルの設定

設定

set protocols static route xxx.xxx.xxx.xxx/xx <宛先IP> next-hop xxx.xxx.xxx.xxx/xx <送信先IP>

確認

操作モードの場合は以下のコマンドで確認できる。

$ show ip route

設定モードの場合は以下のコマンドで確認できる。

# run show ip route

NATの設定

L3スイッチはNATの設定が必要

NATの設定

set nat source rule 100 outbound-interface eth0
set nat source rule 100 source address xxx.xxx.xxx.xxx/xx<内部IP・送信元>
set nat source rule 100 translation address masquerade

NATの除外設定

set nat source rule 20 outbound-interface eth0
set nat source rule 20 source address xxx.xxx.xxx.xxx/xx <送信元IP>
set nat source rule 20 destination address xxx.xxx.xxx.xxx/xx <送信先IP>
set nat source rule 20 exclude

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away