server1 : internet connection, connection from private network is inhibited, connection to server2 is allowed
server2 : no internet connection, connection from server1 is allowed but it impossible to connect server2 from server1
1. make ssh reverse tunnel port 22
[server1 root]# ssh -R 19132:localhost:22 root@192.168.101.232
//this command will make reverse tunnel. the server2 can ssh to server1
//if remote server2 connect localhost:19132 then itwill connect to server1:22
[server2 root]# ssh root@localhost -p 19132
//by using this command server2 can connect to server1.
2. modify the /etc/yum.conf
[server2 root]# vim /etc/yum.conf
#add this line
proxy=socks5h://localhost:8080
3. make dynamic ssh tunnel
[server2 root]# ssh -D 8080 root@localhost -p 19132
4. by using following command we can use github
git config --global http.proxy socks5h://127.0.0.1:1080
5. by setting following, you can use internet through firefox
curl --socks5 125.119.175.48:8909 http://example.com/