Junos OS

 View Only
last person joined: 10 hours ago 

Ask questions and share experiences about Junos OS.
  • 1.  how to convert juniper show configuration command output to show configuration display set

    Posted 09-12-2023 10:35

    is there any way we can convert show configuration output to show configuration | display set 



    ------------------------------
    HAFIZ MUAHMMAD HAROON NAZIR
    ------------------------------


  • 2.  RE: how to convert juniper show configuration command output to show configuration display set

    Posted 09-12-2023 12:55
    Hi Hafiz,

    You can use this piece of software by Said Van De Kludent to convert 'show configuration' to 'show configuration | display set'.

    Link: 

    Hope this helps.

    Ethan






  • 3.  RE: how to convert juniper show configuration command output to show configuration display set

    Posted 09-12-2023 17:03

    Hi Ethan 

    Thanks for the link but can you please tell how to use this.



    ------------------------------
    HAFIZ MUAHMMAD HAROON NAZIR
    ------------------------------



  • 4.  RE: how to convert juniper show configuration command output to show configuration display set

    Posted 09-12-2023 17:25

    I've not actually installed it myself yet so I'm not fully aware of the installation process just yet.

    I'll have a look at the installation guide tomorrow and try it out but it may be worth speaking to Said directly if your not sure on the process.


    You can try to reach out on LinkedIn or Twitter:

    https://linkedin.com/in/saidvandeklundert
    https://twitter.com/saidvandeklunde



    ------------------------------
    Ethan Jackson
    ------------------------------



  • 5.  RE: how to convert juniper show configuration command output to show configuration display set

     
    Posted 09-13-2023 02:48
    Edited by Ulf 09-13-2023 02:56

    Hi,

    you can always use any (similar) Juniper device and do:

    configure

    load override terminal

    (paste your config)

    <Crtl-D>

    show | display set

    rollback

    exit

    And if you don't have a device at hand, you can always use a vSRX.

    Regards

    Ulf




  • 6.  RE: how to convert juniper show configuration command output to show configuration display set

    Posted 09-13-2023 03:32
    Edited by ETH4N3T 09-13-2023 03:33

    So I tested out the configuration from my MAC. 

    I had to install rust by using this command: curl https://sh.rustup.rs -sSf | sh 

     - This also installs cargo which is used to run the script. 

    Once this was installed, I then had to install the JCC-CLI by using this command: cargo install jcc-cli

    Once created, you then vi/cat a file with the configuration you want, I chose this: 

    vpn-a

     instance-type vrf;

     interface ge-0/0/0.0;

     vrf-target target:65412:100;

     routing-options

       auto-export;

    }

    protocols

     bgp 

      group ce-a

      peer-as 65000;

     as-override;

     neighbor 10.0.21.2;

    And when running the JCC-CLI file against the script, this is the outcome: 

    ➜  ~ jcc-cli --file juniper_test.txt
    set vpn-a instance-type vrf
    set vpn-a interface ge-0/0/0.0
    set vpn-a vrf-target target:65412:100
    set vpn-a routing-options auto-export
    set vpn-a protocols bgp group ce-a peer-as 65000
    set vpn-a protocols bgp group ce-a as-override
    set vpn-a protocols bgp group ce-a neighbor 10.0.21.2

    HTH, 

    Ethan



    ------------------------------
    Ethan Jackson
    ------------------------------



  • 7.  RE: how to convert juniper show configuration command output to show configuration display set

    Posted 01-20-2024 10:15

    You can use a plethora of methods, if is a few configuration files, then using a router directly helps, just do a load terminal and put the configuration and commit, after you can do a show | display set in configuration mode.

    Another mechanism is using a tool, I have used in the past https://github.com/ckishimo/juniper_display_set. Here is an example from a local system that I did:

    1. Clone the repository: git clone https://github.com/ckishimo/juniper_display_set.git
    2.  Enter to the juniper_display_set directory
    3.  Execute the script by providing the input configuration file and redirecting the output to a new file:
    4. `python3 junos_converter.py --input ../sample_config.cfg > sample_config_set.set`

    If you check the new file, it will have the set config:

    > more sample_config_set.set
    set system host-name r4
    set system syslog user * any emergency
    set system syslog file messages any notice
    set system syslog file messages authorization info
    

    Elvin