Junos OS

Expand all | Collapse all

how to edit config in shell with vi?

Jump to Best Answer
  • 1.  how to edit config in shell with vi?

    Posted 07-03-2018 01:27

    Hi,

     

    my search somehow does not turn up any results.

    my new company has juniper firewalls, firewall clusters and switches ( i am used to BSD firewalls like pfsense ). i can get around this juniper-in-between-config-layer quite well on the firewalls in the jweb with just using the cli editor, but now i have to edit the config on a switch. 

    where is the config in the file system when i want to edit it with vi?

    i found articles about using cli and all that show-set thing, but it already stops being helpful when i want to add a list of clients, because the articles always say "add list" and then they add one client. no mention how to add more, like seperate them with space, comma, semikolon?

    so i just want to edit the config like i do with the jweb cli editor. just edit it, confirm and commit.

    how to do that? do i have to unzip /config/juniper.conf.1.gz, unzip it, edit it, zip it, and commit it somehow?



  • 2.  RE: how to edit config in shell with vi?
    Best Answer

     
    Posted 07-03-2018 03:07

    Junos is not designed to edit configs directly that way.  You need to do a candidate config and commit from inside Junos at least.  So I think this process would work.

     

    Extract and edit the running config as you mention but save it as an uncompressed file

    Enter the cli

    enter configuraiton mode

    load override /path/file

    close and commit

     

    https://www.juniper.net/documentation/en_US/junos/topics/task/configuration/junos-software-configuration-file-loading.html