I've used cisco DevNet Sandbox. I'm facing errors while using napalm module python. And while I try to authenticate with the correct credentials it always tells me Authentication failed. So can I use Gns3 Api on python to overcome this issue regarding Cisco DevNet labs.
import napalm
import json
# CSR1000V
cisco_sandbox = {
"hostname": " sandbox-iosxe-recomm-1.cisco.com",
"port": 22,
"username": "developer",
"password": " C1sco12345",
}
NXOS = "nxos"
IOS = "ios"
NXOS_SSH = "nxos_ssh"
driver = napalm.get_network_driver(IOS)
if driver:
connection = driver(
hostname=cisco_sandbox["hostname"],
username=cisco_sandbox["username"],
password=cisco_sandbox["password"]
)
else:
connection = driver(
hostname=cisco_sandbox["hostname"],
username=cisco_sandbox["username"],
password=cisco_sandbox["password"],
optional_args={"port": cisco_sandbox["port"]}
)
connection.open()
print(f"----- Connecting {cisco_sandbox['hostname']} on port {cisco_sandbox['port']}")
print(
f"----- Device Facts:\n\t{json.dumps(connection.get_facts(), indent=4)}")
connection.close()