环境centos7两台
跳板机: eth0:X.X.X.X
eth1:10.165.93.161
内网主机:eth0:10.165.93.162
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLicGcq5iM4IzMxAjNy81ctQzXw12dtMzXtdXLwgHMwUzXodXLnBnauIDNxUVTXpHTs1CUEFUQlhWaHp3XuVVMnFTbvl2S39CXGlzLcFEOvwVMw00LcJDMzZWe39CXt92Yu8GdjFTNuYzcvw1LcpDc0RHaiojIsJye.jpg)
解析:
-4 以ipv4地址格式
-f 后台运行
-g 允许远程主机进行连接本地端口2222
-L [bind_address:]port:host:hostport
-N Do not execute a remote command. This is useful for just for-
warding ports (protocol version 2 only).