I have hard time configuring juniper devices (default factory) through a console server (MRV).
Context:
I need to configure new factory default juniper EX/QFX switches.
The new devices connected with console port to Terminal server (MRV LX) asynchronous ports.
The TS (MRV) is reachable only by SSH and inside, asynchronous ports are associated to SSH and telnet sockets (ports) as shown below:
InReach:0 >show port async summ
Time: Sat, 09 Nov 2019 15:18:58 Euro
Port Port Name Access Speed TCP Port SSH port Device
1 device01 Remote 9600 2100 2122 /dev/ttyGN0
2 device02 Remote 9600 2200 2222 /dev/ttyGN1
3 device03 Remote 9600 2300 2322 /dev/ttyGN2
4 device04 Remote 9600 2400 2422 /dev/ttyGN3
...
11 device11 Remote 9600 3100 3122 /dev/ttyGN10
12 device21 Remote 9600 3200 3222 /dev/ttyGN11
...
Type a key to continue, q to quit
InReach:0 >
Knowing that I can SSH connect to the device socket as follow:
$ssh user@terminal_server -p 3122 <<<<<<<<<<<<<<< login to the ts (on the proper async port)
Welcome to the MRV Communications' LX Series Server
Port 11 Speed 9600
"ATTENTION:
...mod...
QFX1 (ttyu0)
login: <<<<<<<<<< login to the new QFX
Hi @ksator ,
Great stuff, keep it up.
I have hard time configuring juniper devices (default factory) through a console server (MRV).
Context:
I need to configure new factory default juniper EX/QFX switches.
The new devices connected with console port to Terminal server (MRV LX) asynchronous ports. The TS (MRV) is reachable only by SSH and inside, asynchronous ports are associated to SSH and telnet sockets (ports) as shown below:
Knowing that I can SSH connect to the device socket as follow:
Python Pyez: According to the Pyez docs:
https://www.juniper.net/documentation/en_US/junos-pyez/topics/task/program/junos-pyez-connection-methods.html
https://github.com/Juniper/py-junos-eznc/releases/tag/2.3.0
This can be done, by the below script :
Result:
Any ideas?