-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to connect to device through proxy #47
Comments
Hi, it looks like you are combining two different methods - CLI Proxy and SSH Tunnel. The SSH Tunnel uses a server that is defined rather than a device. I suggest you do the following to use a device proxy instead: Here are the differences: |
@danielgraziano thanks for replying. |
@vitodino just to double check - is the routers hostname actually 'router1'? Or is that just an example? The reason I'm asking is the hostname and the name in your datafile must match otherwise it will hang after connecting |
Hi @danielgraziano , sorry for my late response. I hadn't got the time to test the script again. it's working now by using the exact hostname on the testbed. Thanks a lot for your help! |
I tried to connect to a router via a jumphost by following the guideline here:
https://pubhub.devnetcloud.com/media/unicon/docs/user_guide/proxy.html
Here's my script:
from genie.testbed import load
from pyats.topology import loader
tb = load('testbed2.yaml')
pe1 = tb.devices['router1']
pe1.connect()
pe1.execute('show version')
Here's the testbed file:
testbed:
name: JUMPHOST_TESTBED
devices:
linux1:
os: linux
type: linux
credentials:
default:
username: aaaa
password: bbbb
connections:
console:
protocol: ssh
ip: y.y.y.y
port: 2222
router1:
os: iosxr
type: router
credentials:
default:
username: aaaa
password: bbbb
connections:
default:
protocol: telnet
ip: x.x.x.x
port: 23
sshtunnel:
host: linux1
I can connect to the router, but not able to execute any command after.
The text was updated successfully, but these errors were encountered: