ssh 使用指定网卡 连接特定网络

有时候,当电脑有两个网卡时;一个网卡 连接免费网络,一个网卡连接收费网络。这样当你想使用免费网络与远程服务器建立连接,使用诸如scp命令或者 ssh 隧道之类传输大文件。这时候你需要指定特定的特定的网卡来建立连接了。

ssh 中 有一个选项可以绑定特定的interface 我们使用 man ssh 查看手册可以看到:

 -B bind_interface
             Bind to the address of bind_interface before attempting to connect to the destination host.  This is only useful on systems with more than one address.

可见,使用 ssh -B 选项,可以指定特定的网卡;

我在实验室环境测试成功。如果您有什么问题,欢迎留言讨论。

保持更新,转载请注明出处。更多关于 网络和系统的博客,请关注 cnblogs.com/xuyaowen 

猜你喜欢

转载自www.cnblogs.com/xuyaowen/p/ssh-bind-interface.html
今日推荐