Posts: 3
Threads: 1
Joined: Jun 2018
Jun-20-2018, 05:25 PM
(This post was last modified: Jun-20-2018, 05:25 PM by Nirosh123.)
Hello Guys
I want to run python script in PC to connect to a router which can be accessed via 2 jump server, and the command out put should come my PC ,below is the scenario.if it possible how to do it in Python.
PC-----> Server1------------>Server2-------->Router
Thanks in Advance
Posts: 3,458
Threads: 101
Joined: Sep 2016
SSH? Or, if all the machines are behind your firewall, telnet?
How would you do it without python?
Posts: 2,953
Threads: 48
Joined: Sep 2016
Jun-20-2018, 05:41 PM
(This post was last modified: Jun-20-2018, 05:42 PM by wavic.)
Welcome!
Just login to the desired server and run the command. If you can't reach it I doubt that you could manage the router ;) If I am net admin I won't allow such a thing.
Posts: 333
Threads: 4
Joined: Jun 2018
You'll have to port forwarding the data stream:
PC_IP:3000 <-> 3000:SERVER_1_IP:3001 <-> 3001:SERVER_2_IP:3000 <-> 3000:ROUTER_IP With port forwarding every data that arrives at port 3000 (just for example) will be forward to the port 3001 (example)
Posts: 3
Threads: 1
Joined: Jun 2018
Jun-21-2018, 11:05 AM
(This post was last modified: Jun-21-2018, 11:14 AM by Nirosh123.)
(Jun-20-2018, 05:25 PM)Nirosh123 Wrote: Hello Guys I want to run python script in PC to connect to a router which can be accessed via 2 jump server, and the command out put should come my PC ,below is the scenario.if it possible how to do it in Python. PC-----> Server1------------>Server2-------->Router Thanks in Advance
(Jun-20-2018, 05:39 PM)nilamo Wrote: SSH? Or, if all the machines are behind your firewall, telnet? How would you do it without python?
Thanks for your reply,
On servers I do it using SSH and on Routers few with SSH and few with Telnet
(Jun-20-2018, 05:41 PM)gontajones Wrote: You'll have to port forwarding the data stream: PC_IP:3000 <-> 3000:SERVER_1_IP:3001 <-> 3001:SERVER_2_IP:3000 <-> 3000:ROUTER_IP With port forwarding every data that arrives at port 3000 (just for example) will be forward to the port 3001 (example)
Thanks friend for your reply, do your have any good document to refer
Posts: 333
Threads: 4
Joined: Jun 2018
(Jun-21-2018, 11:05 AM)Nirosh123 Wrote: Thanks friend for your reply, do your have any good document to refer
Search for port forwarding for the OS of both servers and for the specific router model.
It is not a big deal. If the servers are running Linux, you can do it using "iptables".
Let us know about your progress.
Posts: 3
Threads: 1
Joined: Jun 2018
(Jun-21-2018, 11:32 AM)gontajones Wrote: (Jun-21-2018, 11:05 AM)Nirosh123 Wrote: Thanks friend for your reply, do your have any good document to refer Search for port forwarding for the OS of both servers and for the specific router model. It is not a big deal. If the servers are running Linux, you can do it using "iptables". Let us know about your progress.
Thank You, I will update you on thos
Posts: 3,458
Threads: 101
Joined: Sep 2016
(Jun-21-2018, 11:05 AM)Nirosh123 Wrote: (Jun-20-2018, 05:25 PM)Nirosh123 Wrote: Hello Guys I want to run python script in PC to connect to a router which can be accessed via 2 jump server, and the command out put should come my PC ,below is the scenario.if it possible how to do it in Python. PC-----> Server1------------>Server2-------->Router Thanks in Advance
(Jun-20-2018, 05:39 PM)nilamo Wrote: SSH? Or, if all the machines are behind your firewall, telnet? How would you do it without python?
Thanks for your reply,
On servers I do it using SSH and on Routers few with SSH and few with Telnet
Ok, then do it with python using ssh or telnet. The approach using python won't be any different from what you already do, you'll just be automating it.
|