LoginSignup
4

More than 5 years have passed since last update.

VyOSの設定をコマンドでエクスポート→インポートする

Posted at

目的

設定ファイルの一部をコピーしたり、ループで回したい。

方法

エクスポート

操作モード(operational mode) 設定モード(configuration mode)どちらでもいい。
/opt/vyatta/sbin/vyatta-config-gen-sets.pl /config/config.boot

結果

set service dns forwarding cache-size '0'
set service dns forwarding listen-on 'eth0'
set service dns forwarding listen-on 'eth1'
...

インポート

適当にファイルを作成し、実行する。


#!/bin/vbash
source /opt/vyatta/etc/functions/script-template

set service dns forwarding cache-size '0'
set service dns forwarding listen-on 'eth0'
set service dns forwarding listen-on 'eth1'

commit; save

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4