Posted on November 1, 2020 12:47 am
 |  Asked by Andreas Agrafiotis
 |  93 views
1
0
Print Friendly, PDF & Email

Hello,

My management interface is in the mgmt vrf. I have writtel a very simple python script, where I have defined

switch = Server(“https://test:test@172.30.0.124/command-api”)

When trying to run my script from Bash, it stucks and after awhile I get connection timeout:

socket.error: [Errno 110] Connection timed out

I suspect that the script cannot reach the mgmt vrf, because from Bash I cannot ping the Management IP. If this is the reason, is there a way to insert the vrf into the switch declaration?

Thanks

2
Posted by Tamas Plugor
Answered on November 1, 2020 12:52 am

You could run your python script in that VRF from bash with sudo ip netns exec ns-mgmt python example.py or instead of using IPs you could enable unix-socket and connect to it, e.g.:

 

switch = Server('unix:/var/run/command-api.sock')

Post your Answer

You must be logged in to post an answer.