DX NetOps

Expand all | Collapse all

Passing custom SSH port value to configuration capture script in NCM

  • 1.  Passing custom SSH port value to configuration capture script in NCM

    Posted 04-09-2019 07:31 AM

    Hi

    I have several devices running SSH on custom port. "SSH port" field in device modeling information is updated with required value, information is available in the attribute "SshPortNumber"

    I need to pass this specific SSH port number information to NCM configuration capture script.
    Would it be possible to send value as additional script parameter or access as device attribute?

    Thanks and best regards

    Modestas



  • 2.  Re: Passing custom SSH port value to configuration capture script in NCM

    Broadcom Employee
    Posted 04-09-2019 01:45 PM

    There is not really any configuration in NCM to set SSH port number. There is no setting on NCM model, Device Families, or the scripts themselves. Assuming the device is configured to accept SSH connections on whatever port you choose, and there is no firewall blocking the port, setting the port number in Spectrum on device attribute SshPortNum 0x12c06 should be sufficient. 

     

    If you're seeing communication issues, then would recommend to run netstat to verify the port is open, and Sniffer Trace / Packet Capture to verify communication to the device on that port. 

     

    Regards, 

    Jay V



  • 3.  Re: Passing custom SSH port value to configuration capture script in NCM

    Broadcom Employee
    Posted 04-09-2019 01:46 PM

    As a side note, here is an IDEA post on using multiple SSH ports in NCM - not exactly the answer to your question, but figure this can get some exposure here: NCM - Multiple SSH ports 



  • 4.  Re: Passing custom SSH port value to configuration capture script in NCM

    Posted 04-09-2019 02:02 PM

    Hi Volja01

    There are no communication issues, port is open, I can reach device on custom SSH port and configuration retrieval script can connect on custom port when I modify target port by IP address within the script.

    Script written python and use netmiko library.
    I have also verified that that netmiko happily ignores specific values in SshPortNum 0x12c06 and attempts connection on port 2022 regardless SshPortNum value.

    I have considered dedicated device group with modified script but would prefer to keep devices in the same "SSH capable" group. Send SshPortNum value as an additional argument to the script would be preferred solution.

    BR

    Modestas



  • 5.  Re: Passing custom SSH port value to configuration capture script in NCM

    Broadcom Employee
    Posted 04-09-2019 02:16 PM

    "I have also verified that that netmiko happily ignores specific values in SshPortNum 0x12c06 and attempts connection on port 2022 regardless SshPortNum value."

     

    How did you verify this? 

     

    I would recommend a sniffer trace and to open a ticket with Support, and upload the sniffer trace to the ticket. 

     

    Regards, 

    Jay V