question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cant make connection with ubiquiti edge router

See original GitHub issue

Python version- 3.5.2 Netmiko version- 2.4.2 Paramiko version- 2.6.0

When attempting to make a connection with ubiquiti edgerouter lite i am receiving error

ValueError: Router prompt not found: 'jmc@McgigglesEPR:~$'

python script is:

#!/usr/bin/env python3

import json
from os import mkdir
from netmiko import *

with open('network.json', 'r') as f:
    boxes = json.load(f)


def get_configs():
    for k, v in boxes.items():
        nested_device = [v]
        for data in nested_device:
            device = nested_device[0]['device_type']
            if device == 'corertr' or device == 'epr':
                category = 'routers'
            else:
                category = 'switches'
            if device == 'cisco_ios':
                config = 'show run\n'
            else:
                config = 'show configuration\n'
            output_file = nested_device[0]['host'] + ' output.txt'
            full_dir = (category + '/' + output_file)
            try:
                with open(full_dir, 'w') as file:
                    command_list = ['terminal length 0\n', config]
                    for i in command_list:
                        connect = ConnectHandler(**data)
                        output = connect.send_command(i)
                        file.write(output + '\n')
            except FileNotFoundError:
                mkdir(category)
                with open(full_dir, 'w') as file:
                    command_list = ['terminal length 0\n', config]
                    for i in command_list:
                        connect = ConnectHandler(**data)
                        output = connect.send_command(i)
                        file.write(output + '\n')

        print(nested_device[0]['host'] + ' complete')


get_configs()

json is

{
 "epr":{
  "device_type": "ubiquiti_edge",
  "host": "epr",
  "username": "jmc",
  "password": "REDACTED",
  "verbose": "true"
 }

}

I found this issue (https://github.com/ktbyers/netmiko/issues/499) where it seems like the issue was resolved but i still cannot make it work.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aungeecommented, Jun 11, 2020

`from netmiko import ConnectHandler

ubnt = { ‘device_type’ : ‘vyatta_vyos’, ‘ip’ : ‘192.168.0.1’, ‘username’ : ‘ubnt’, ‘password’ : ‘ubnt’, } ` Works fine if you change the device_type to vyatta_vyos

1reaction
kroshiracommented, Sep 12, 2019

i ended up modifying ubiquiti_edge to inherit based off of the previously mentioned commit that got reverted. I am sure that it got reverted due to other issues it caused but it works for what i am using it for. i guess it would make more sense to test out just using the vyos type so that if it works i can keep it updated with any future releases of netmiko. thank you for all of the help you guys provided

Read more comments on GitHub >

github_iconTop Results From Across the Web

Newbie: Can't connect directly to EdgeRouter
First try:Pluged into port 1pluged junk router supplied by my ISP (with internet connection) into port 2network connections: wired connection disconnectedhttps ...
Read more >
Can't connect to Edgerouter X : r/Ubiquiti - Reddit
Hello, just got my Edgerouter X even after setting up the static ip I can't connect to 192.168. 1.1 (tried on 2 computers)...
Read more >
EdgeRouter Lite Quick Start Guide - Ubiquiti
cabling should be used for all wired Ethernet connections and should be grounded through the AC ... do not expose the EdgeRouter Lite...
Read more >
Edgerouter X First Time Setup - YouTube
In this video, I go over how to configure an Edgerouter -X for the first time. If you don't quite know how to...
Read more >
Cannot connect to the router settings page
I get a Ubiquiti EdgeRouter X, but I cannot connect to the router settings page, I tried to make factory reset but it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found