Create set commands from configuration file?


#1

is it possible to create a file of set commands from a configuration file?


#2

try “commands” command.

http://vyos.net/wiki/1.1.0/release_notes
Please check New feature.

show interfaces tunnel | commands 
set tunnel tun0 encapsulation 'gre'
set tunnel tun0 local-ip '10.46.1.242'
set tunnel tun0 remote-ip '10.91.19.1'

#3

recent Vyos removed ‘commands’ command in op mode, now only available in config mode.

configure
show | commands | grep '^set interfaces tunnel'
exit

#4

So a simple

show configuration commands

or

show configuration commands | match config-sync

does not work in Vy? I’m coming from Vyatta and EdgeOS and have not set up a test machine with Vy yet.


#5

show configuration commands works just fine. you can also run | match


#6

Is there any way to reverse this process?
I mean that I have file with all commands and I want to generate ready config file.


#7

I can’t remember exactly offhand, but I think the config file is stored in /opt/vyatta/config/config.boot?

its in there somewhere.

I have a script that just echos a ‘show configuration’ to a text file and stores it on tftp server


#8

Instead of creating a script for that, these are config commands that’ll do it automatically:
set system task-scheduler task BACKUPCONFIG executable arguments ‘-l /config/config.boot -r /NetworkConfigs/$HOSTNAME-date +\%Y\%m\%d\%H\%M.cfg -p 10.31.76.1’
set system task-scheduler task BACKUPCONFIG executable path ‘/usr/bin/tftp’
set system task-scheduler task BACKUPCONFIG interval ‘6h’


#9

I want to do this in external Linux machine, I want to store all options of all routers on SQL and then generate ready config files for routers to update config on it. I’m looking for a tool or method to make properly made configuration files for VyOS, outside of VyOS system - on external central server.


#10

Hello,
use


#11

Thanks
krajuskar@gmail.com


#12

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.