PHP Telnet connection from a router to another router

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manuitpro
    New Member
    • Dec 2009
    • 13

    PHP Telnet connection from a router to another router

    Hi,

    I have implemented a php script by which i can login to a router using fsockopen(), and i can run any cisco commands.

    But i have requiremnt login to a remote from from a central router for the out of band management.

    How can make a script by whch i can login to another cisco router (telnet) from an already logged in router.

    my script has a class and functions.

    Thanks
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Besides the down right frightening aspect of controlling your router through a (yet to be determined unsecure) php application, there is no way to do this in PHP. It's nothing that PHP should do, just physically speaking: when you log into that first router, you interact with /it/ and only it through PHP.

    That router can have other commands that may allow PHP to call the second router, but this not likely.

    I'm no networking expect, but can't you allow the traffic for the second router connection go through the first one. i.e. opening ports, defining routes?

    My 0.02,



    Dan

    Comment

    • manuitpro
      New Member
      • Dec 2009
      • 13

      #3
      Thanks for ur reply

      To pass a command to router, php requires a connection variable ($this->_connection = @fsockopen($thi s->_hostname, 23, $errno, $errstr, $this->_timeout), I can connect to second router by using telnet command from first router and reaches up to the login prompt of second router. Now how do I use connection variable to pass commands to second router, if i use @fsockopen for second router, the source of connection is my webserver it is not sourcing from first router.
      I just need to know is there any way to make @fsockopen source as a specified connection variable which is already exists rather than web server.

      Thank u

      Comment

      Working...