SSH TCP Port Forwarding
This section describes the configuration model of SSH TCP port forwarding and provides examples of XML packets.
Data Model
The configuration model file matching SSH TCP port forwarding is huawei-ssh.yang.
Only the following switch models support this command:
S7703 (using MCUD), S7706 (using SRUHA1, SRUHX1, SRUH, and SRUE), S7712 (using SRUHA1, SRUHX1, SRUH, and SRUE), S7703 PoE (using MCUD), S7706 PoE (using SRUHA1, SRUHX1, SRUH, and SRUE)
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-ssh:tcp-port-forwarding/operator |
Configures a channel for TCP port forwarding. |
The value is of the enumerated type:
|
N/A |
/huawei-ssh:tcp-port-forwarding/forwarding-type |
Indicates the type of TCP port forwarding. |
The value is of the enumerated type: remote: Specify remote port forwarding. |
N/A |
/huawei-ssh:tcp-port-forwarding/remote/listening-port |
Indicates the listening port of a peer device. |
The value is an integer in the range from 0 to 65535. |
Ports 0 to 1023 are privileged ports. If the peer device cannot be listened to because of insufficient permission, the SSH channel fails to be established. |
/huawei-ssh:tcp-port-forwarding/remote/ip-address |
Indicates the destination IP address of packets in remote port forwarding mode. |
The value is in dotted decimal notation. |
These two objects are mutually exclusive, so only one of them can be delivered. |
/huawei-ssh:tcp-port-forwarding/remote/host-name |
Indicates the name of the destination host to which packets are forwarded in remote port forwarding mode. |
The value is a character string. |
|
/huawei-ssh:tcp-port-forwarding/remote/server-port |
Indicates the listening port number of the destination host to which packets are forwarded in remote port forwarding mode. |
The value is an integer in the range from 0 to 65535. |
N/A |
/huawei-ssh:tcp-port-forwarding/remote/ssh-server-name |
Indicates the destination host connected to the SSH client. |
The value is a character string. |
The commonly used format is user@xx.xx.xx.xx -p PortNumber, in which the user name of the SSH server, host IP address, and port number are specified. |
Configuring the SSH TCP Port Forwarding Function
This section describes how to configure the SSH TCP port forwarding function using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-ssh:tcp-port-forwarding/ |
Data Requirements
Item |
Data |
Description |
---|---|---|
Channel for TCP port forwarding |
create |
- |
Type of TCP port forwarding |
remote |
- |
IP address of the VRP protocol stack |
192.168.2.1 |
- |
Listening port number of the VRP protocol stack |
22 |
- |
Port number of the TCP port forwarding channel listened by the controller |
55811 |
- |
SSH server IP address on the iMaster NCE-Campus |
10.171.45.155 |
- |
SSH server port number on the iMaster NCE-Campus |
10022 |
|
User name used to log in to the SSH server on the iMaster NCE-Campus |
huawei |
Request Example
<?xml version="1.0" encoding="UTF-8"?> <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <tcp-port-forwarding xmlns="urn:huawei:params:xml:ns:yang:huawei-ssh"> <operator>create</operator> <forwarding-type>remote</forwarding-type> <remote> <listening-port>55811</listening-port> <ip-address>192.168.2.1</ip-address> <server-port>22</server-port> <ssh-server-name>huawei@10.171.45.155 -p 10022</ssh-server-name> </remote> </tcp-port-forwarding> </rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2ac0550f-49dc-11e7-b586-f0bc1781395f"> <result> <ok/> </result> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="cfc47140-49dc-11e7-8c66-f0bc1781395f"> <rpc-error> <error-message> Some unspecified error occurred. </error-message> </rpc-error> </rpc-reply>