cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
363
Views
3
Helpful
4
Replies

using pyats to send commands to a CML lab and parsing the output

thibaultm
Level 1
Level 1

I have a Win11 laptop with :
- VMWare Workstation pro 17
- CML 2.7 in a VM
- an ubuntu 22.04 VM with pyats full installed on it.

I would like to use pyats (on my ubuntu 22.04 VM) to send commands to a CML lab (in the CML VM)
and parse the result of those command.

I am not familiar with VMs etc. what would you recommend for me to accomplish that ?

N.B. I managed to use pyats to send commands to a GNS3 network simulation running on my
ubuntu VM and have them parsed by pyats.

I would like to use pyats to send commands to CML because the command I want to parse
is supported in CML (IOS17.12) but not in the version of my GNS3 network simulation.

1 Accepted Solution

Accepted Solutions

thibaultm
Level 1
Level 1

OK I'm sorry I didn't understand what you meant, but thanks to your reply I digged a little bit in CML doc,
and I moved forward.
I googled and I stumbled upon this post which gave me an idea :
https://learningnetwork.cisco.com/s/question/0D53i00000XR8E2CAL/how-to-achieve-external-connectivity-to-nodes-in-cml-20-via-http

In my lab I configured a routed port on each router with an IP in the subnet of my LAN.
I connected those interfaces to an unmanaged switch in my CML lab, then I connected an external connector
to a port of this unmanaged switch within the lab.
The external connector is configured to work in the bridged mode.

Now from my windows 11 PC I can now ping and telnet in each and every router of my lab, which is what I wanted to do.
I can ping my unbuntu VM and my CML VM from my windows PC.
and I can ping the CML VM from the ubuntu VM.

This morning I started everything from scratch and now I can ping and telnet the routers of my lab from my ubuntu VM in the same PC as the CML VM which is what I wanted.

The issue of not being able to ping yesterday was probably due to the fact that I forgot to start the unmanaged switch and the external connector, (I am more used to GNS3 where unmanaged switches do not need to be started).

Thanks a lot for the help and insipration !

View solution in original post

4 Replies 4

In your VMware Workstation, set your CML VM and your Ubuntu VM to use "bridged networking". This puts both VMs on the same network as your Win11 laptop, they can then communicate directly. Make sure both VMs have IP addresses in the same subnet. You might need to configure static IPs for the VMs.

In CML go to Devices > Node List and find the IP address of the node you want to connect to using pyats. Install pyATS as you did before and create your testbed file.

Hope this helps.

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Thanks it helps.

Now in fact I do not find Devices > Node List in CML
May be this is because I use CML 2.7 personal and IOL nodes (they do not run in separate VM each I think) ?
I have looked in every menu of CML I did not find anything that ressembles that.

No problem - make sure you have ISO image for the devices to be part of it.

https://developer.cisco.com/docs/modeling-labs/#!cml-installation-guide

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

thibaultm
Level 1
Level 1

OK I'm sorry I didn't understand what you meant, but thanks to your reply I digged a little bit in CML doc,
and I moved forward.
I googled and I stumbled upon this post which gave me an idea :
https://learningnetwork.cisco.com/s/question/0D53i00000XR8E2CAL/how-to-achieve-external-connectivity-to-nodes-in-cml-20-via-http

In my lab I configured a routed port on each router with an IP in the subnet of my LAN.
I connected those interfaces to an unmanaged switch in my CML lab, then I connected an external connector
to a port of this unmanaged switch within the lab.
The external connector is configured to work in the bridged mode.

Now from my windows 11 PC I can now ping and telnet in each and every router of my lab, which is what I wanted to do.
I can ping my unbuntu VM and my CML VM from my windows PC.
and I can ping the CML VM from the ubuntu VM.

This morning I started everything from scratch and now I can ping and telnet the routers of my lab from my ubuntu VM in the same PC as the CML VM which is what I wanted.

The issue of not being able to ping yesterday was probably due to the fact that I forgot to start the unmanaged switch and the external connector, (I am more used to GNS3 where unmanaged switches do not need to be started).

Thanks a lot for the help and insipration !