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>