Cause: Suddenly overnight telecommunications disturbance Dial IP Full change intranet address, so that even with the dynamic domain name, the binding is not a native IP, external inaccessible. Although the telephone to find the telecommunications reflect that can be changed back, but must first solve the immediate problem, access to the SVN repository on the intranet server.
Method: Because there is a cloud host on the public network, think can pass through it, as long as the intranet host first establish a connection with the cloud host, this can be used SSH remote forwarding function, the command is as follows:
Ssh-gn-r 3690:0.0.0.0:3690-o serveraliveinterval=60 [email protected]
As a result, the connection is established, but at this point the access to the cloud host port 3690 is not connected, go up to check the port status:
[[Email Protected]:~]netstat-ln-a inet
The output is as follows:
Active Internet connections (only servers)
Proto recv-q send-q Local address Foreign address state
TCP 0 0 127.0.0.1:3690 0.0.0.0:* LISTEN
TCP 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
......
Display 3690 while listening, but only valid on 127.0.0.1, cannot accept external connections.
But I've already added the-G parameter to the SSH manual saying this option will bind the port to the external IP so that the other machines can connect, but why is this invalid?
Google learns the Answer (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=228064):
Original-G is only valid for local forwarding, to make remote forwarding also use external IP, you must modify the Sshd_config on the remote host, increase
Gatewayports Yes
Then restart the SSH service.
Re-establish the forwarding and check the connection, found that the 0.0.0.0:3690 is listening, open SVN client update smooth Execution!
SSH remote forwarding enables remote hosts to listen on all IPs