[135580] in North American Network Operators' Group

home help back first fref pref prev next nref lref last post

Re: Upload config to juniper

daemon@ATHENA.MIT.EDU (John Adams)
Wed Jan 26 18:23:00 2011

In-Reply-To: <AANLkTinEpsHaVcro9io3gCpHeCKwpNHg9zBSAY+7oZKJ@mail.gmail.com>
Date: Wed, 26 Jan 2011 15:22:56 -0800
From: John Adams <jna@retina.net>
To: Florin Veres <florin@futurefreedom.ro>
Cc: nanog@nanog.org
Errors-To: nanog-bounces+nanog.discuss=bloom-picayune.mit.edu@nanog.org

I do this with pyexpect for blacklist updating. It works amazingly well.

One thing to remember when communicating with the JunOS device is that
if you fail to disable the CLI controls, communicating with the device
is very difficult.

I do something like:

  import pexpect
  child = pexpect.spawn ('ssh',
['-p','22','-o','StrictHostKeyChecking=no',"router ip address goes
here"], 2)

  child.sendline("set cli screen-length 0")
  child.sendline("set cli screen-width 0")

  < put your commands here to talk to the router >

-j


On Mon, Jan 24, 2011 at 5:39 AM, Florin Veres <florin@futurefreedom.ro> wrote:
> Hey guys,
>
> Do any of you have any idea if it's possible to upload configuration from a
> script (prefix-list updates in this case) to a JunOS device (MX)?
> For Cisco devices I'm doing it using rcp.
>
> Thanks,
> Florin
>


home help back first fref pref prev next nref lref last post