kevin

kevin

7 posts published

如何端口转发

iptablerinetdsocat假设有个第三方服务端(server)/客服端(client),它们只支持本地(127.0.0.1:10011)连接。通过socat就可以实现物理上的分离,如下所示: BEFORE ====== IP:x.x.x.x +--------+ | server | | | | | client | +--------+ AFTER ===== IP:x.x.x.x IP:y.y.y.y +--------+ +--------+ | server | +---|---+ | | | | | | | | | +----|---+ | client | +--------+ +--------+暴露本地端口: [Unit] Description=Socat Service Documentation=