Switching

last person joined: 23 hours ago 

Ask questions and share experiences about EX and QFX portfolios and all switching solutions across your data center, campus, and branch locations.
  • 1.  Push a easy configuration change to a lot of switches?

    Posted 09-18-2014 00:15

    Hey Everyone, 

    I'm needing to set a pretty simple configuration change to over 100 ex2200 switches. Basically I want to have the switches report to our syslog server. So the command would be:

     

     

    set system syslog host sysloghostserver any alert

    I've been googling all night and see a lot of avenues, but none of them look quite right. I'd happily ssh into each switch and paste a command. But I'm not even sure how to do that. From what i understand once logged in I need to type cli and the configure and then paste the above command, then commit and quit. 

     

    It would be great if I could somehow string all that stuff together, but I can't seem to figure out how to switch modes in one command. Like on linux you can pipe commands together.

     

    Some of the stuff on this page looked promising, but total overkill for what i'm trying to accomplish. 

    http://rtoodtoo.net/category/junos/junos-automation/

     

    Does anyone have any suggestions? 

     



  • 2.  RE: Push a easy configuration change to a lot of switches?

    Posted 09-18-2014 01:36

    Only if you log in as root, would you need to enter cli, otherwise you would need to enter configure/edit to enter configuration mode. You can just copy th ecommand and paste in command. The method that would work also is scripting (Junos automation) or if you had Junos Space, you could push config to all in batch I think batch of 20 but it would be far easier 

    So if you log in as root

    root%cli

    root>configure

    root# 

    set system syslog host syslog host <ip-address> any alert
    root#commit an-quit
    root>exit
    root%exit


  • 3.  RE: Push a easy configuration change to a lot of switches?
    Best Answer

     
    Posted 09-18-2014 04:04

    Maybe this will help you, although is not the fastest way. Create a file in one central location of your network and from there connect to all devices and apply the configuration:

     

    lab@ubuntu:/home/pubftp$ ls -l | grep script
    -rwxrwxrwx 1 lab     lab             68 Sep 18 11:35 script.sh
    lab@ubuntu:/home/pubftp$ cat script.sh
    cli -c "edit;set interfaces ge-0/0/17 description TEST;commit;exit"
    lab@ubuntu:/home/pubftp$
    lab@ubuntu:/home/pubftp$ ssh root@172.30.145.153 'sh -s' < script.sh
    root@172.30.145.153's password:
    Entering configuration mode
    Users currently editing the configuration:
      root terminal u0 (pid 2874) on since 2014-09-18 12:51:23 CEST, idle 00:05:57
          {master:0}[edit]
    fpc0:
    configuration check succeeds
    fpc1:
    commit complete
    fpc0:
    commit complete
    Exiting configuration mode
    lab@ubuntu:/home/pubftp$

    {master:0}[edit]
    root@ex4200# show | compare rollback 1    
    [edit interfaces ge-0/0/17]
    +   description TEST;

    {master:0}[edit]
    root@ex4200#

     

     

     

    =====

    If this worked for you please flag my post as an "Accepted Solution" so others can benefit. A kudo would be cool if you think I earned it.



  • 4.  RE: Push a easy configuration change to a lot of switches?

    Posted 09-18-2014 16:18
    cli -c "edit;set interfaces ge-0/0/17 description TEST;commit;exit"

     This is exactly what i was looking for. Thanks so much! The part about putting it into a script and running it from ssh is brilliant and will make this even faster!



  • 5.  RE: Push a easy configuration change to a lot of switches?

    Posted 09-18-2014 12:01

    If you're game you might want to check out Jaide, a tool a few helpful folks have released.  I haven't used it myself but it looks like it was made with just your situation in mind:

     

    http://forums.juniper.net/t5/Junos-Automation-Scripting/Junos-Aide-Jaide-A-tool-for-manipulating-Junos-devices/td-p/254501



  • 6.  RE: Push a easy configuration change to a lot of switches?

    Posted 09-18-2014 16:39

    @B2 wrote:

    If you're game you might want to check out Jaide, a tool a few helpful folks have released.  I haven't used it myself but it looks like it was made with just your situation in mind:

     

    http://forums.juniper.net/t5/Junos-Automation-Scripting/Junos-Aide-Jaide-A-tool-for-manipulating-Junos-devices/td-p/254501


    Wow, what a great tool! Thanks for making me aware of this. It's gonna make my life so much easier!

     



  • 7.  RE: Push a easy configuration change to a lot of switches?

    Posted 09-20-2014 15:43

    Hi there,

     

    We're glad to hear that our tool will help you. We always appreciate any feedback, and let us know if you have any ideas you'd like to see added.