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


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@”)

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?


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 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.