Bug 1016151

Summary: Provide example command to forward to specific ports in section 8.3.1
Product: OpenShift Container Platform Reporter: dchia
Component: DocumentationAssignee: brice <bfallonf>
Status: CLOSED CURRENTRELEASE QA Contact: ecs-bugs
Severity: medium Docs Contact:
Priority: medium    
Version: 1.2.0CC: baulakh, bfallonf, dchia, jokerman, libra-onpremise-devel, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-21 05:46:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description dchia 2013-10-07 15:35:06 UTC
Description of problem: In the user guide in section 8.3.1 [1] customer would appreciate seeing a technical elaboration on the following statement:

"If you need to forward only specific ports, you need to use the ssh command with the -L option. Refer to the ssh manual page for details."

An example command would be nice.

[1] https://access.redhat.com/site/documentation/en-US/OpenShift_Enterprise/1/html-single/User_Guide/index.html#sect-OpenShift-User_Guide-Port_Forwarding

Comment 4 brice 2014-02-05 00:01:50 UTC
Received confirmation via email that the right information has been added from Phil Festoso:

"Hi Brice,

The added example for ssh -L reads clearly and provides the requested information."



Although, information has changed since last updated:

"Specific ports are forwarded with the following command, where the local port and the remote port must be specified, respectively:

$ ssh -L local_port:host:remote_port

Example 9.14. Forwarding Specific Ports

$ ssh -L 8080:localhost:8080


This example allocates a socket to listen to the local port host 8080. When a connection to this port is made, a secure channel forwards the connection to the remote host port 8080."

Comment 6 Miciah Dashiel Butler Masters 2014-02-05 00:44:59 UTC
The phrase "remote host" is unclear in the description, and that command will not work without specifying the host to which the ssh connection will be established (it fails immediately as given).  For example, you can use the following:

    $ ssh -L 8080:localhost:8080 70277280b8534c8a9fc76d2734393dfa.com

You're missing what I call the "via_host" argument in the following general form:

    $ ssh -L local_port:dest_host:dest_port via_host

The above command creates a new SSH session, with an SSH process on the local system and another SSH process on the remote system "via_host," which will do the following:

• The local SSH process will open local_port on the local host and listen for connections to that port.

• At the same time, the local SSH process will open an SSH connection to via_host (which is what causes the remote system "via_host" to start the remote SSH process).

• Whenever the local SSH process receives a connection to local_port, it will forward the connection to the remote SSH process running on "via_host."

• When the remote SSH process on via_host receives one of these connections from the local SSH process, the remote SSH process on via_host will open a connection to dest_port on dest_host and forward packets to and from dest_port.

So packets go localhost:local_port <-> via_host <-> dest_host:dest_port.

Note that in the general form, there are three hosts involved: The local host, the destination host, and the intermediate host ("via_host") through which connections will be routed.  For our purposes, dest_host and via_host are the same physical host (because we specify localhost for the dest_host, so via_host is connecting to itself; the point of reference for "dest_host" is "via_host").  However, SSH requires that it be specified.

Does that make sense?

Comment 7 brice 2014-02-05 01:49:03 UTC
Added Miciah's information from above. Section now reads:

"Specific ports are forwarded with the following command. Specify the local port and remote port as required, as well as the gear ID, and application and domain name of the remote port:

$ ssh -L local_port:host:remote_port gear_ID.com

Example 9.14. Forwarding Specific Ports

$ ssh -L 8080:localhost:8080 70277280b8534c8a9fc76d2734393dfa.com"

Should work now!