Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Establishing an SSH Connection for a NETCONF Session and cRPD

Establishing an SSH Connection

SSH can be used to establish connections between a configuration management server and a device running Linux OS with cRPD. A configuration management server, as the name implies, is used to configure the device running Linux OS remotely. With SSH, the configuration management server initiates an SSH session with the device running Linux OS.

Enabling SSH

To enable SSH on a cRPD:

  1. Log in using the root to enable root access through SSH.
  2. In the /etc/ssh/sshd_config file, specify the following setting:

    root@crpd01:/usr/bin# vi /etc/ssh/sshd_config

  3. Restart the service.

    user@crpd01:/# service ssh restart

Port Forwarding Mechanism

To map a host port to a container port:

Run the following command to map a port on the host with a port on container.

user@crpd01:/usr/bin# docker run -d --name crpd02 -p 8034:22 crpd:20.4R1.12

Connecting to a NETCONF Server on Container

  1. Log in to the container for crpd02.

    root@crpd01:/usr/bin# docker exec -it crpd02 bash

  2. Copy the IP address.

    root@6918f17c5851:/# ifconfig eth0

  3. Configure root-authentication, netconf and ssh, and commit the config

    set system root-authentication plain-text-password "<password>"

    set system services ssh root-login allow

    set system services netconf ssh port 8034

  4. Log in to the cRPD container using NETCONF:

    root@crpd01:/usr/bin ssh root@172.17.0.14 -p 8034 netconf

    The 8034 port on host is mapped to 22 port on container and opens an interactive shell session.