The Pexpect overview

Let's take a look at how you would interact with the router if you were to Telnet into the device:

echou@ubuntu:~$ telnet 172.16.1.20Trying 172.16.1.20...Connected to 172.16.1.20.Escape character is '^]'.<skip>User Access VerificationUsername: ciscoPassword:

I used VIRL AutoNetkit to automatically generate initial configuration of the routers, which generated the default username of cisco, and the password of cisco. Notice the user is already in the privileged mode:

iosv-1#sh run | i ciscoenable password ciscousername cisco privilege 15 secret 5 $1$Wiwq$7xt2oE0P9ThdxFS02trFw. password cisco password ciscoiosv-1#

Also note that the auto config generated vty access for both telnet and SSH:

line vty 0 4 exec-timeout 720 ...

Get Mastering Python Networking now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.