gpt4 book ai didi

Linux/中央操作系统 : How to force FTP/SSH to use a particular ethernet adapter

转载 作者:IT王子 更新时间:2023-10-29 01:24:22 26 4
gpt4 key购买 nike

我们有一个带有 2 个以太网适配器的 CentOS 服务器。这两个适配器都可以访问互联网,并且都可以用来连接到远程站点。

有没有办法知道在连接到 FTP 服务器或通过 SSH 连接到另一台服务器时将使用哪个以太网适配器?如果是这样,有没有办法强制它使用特定的适配器而不禁用任何适配器?

最佳答案

也许您可以为您打算连接的服务器设置一个特殊的路由?查看路由命令或“ip route”命令。

编辑:这似乎包含了我所说的示例:http://www.cyberciti.biz/faq/howto-linux-configuring-default-route-with-ipcommand/

具体来说:

Type the following command to sent all packets to the local enter code herenetwork 192.168.1.0 directly through the device eth0:, enter

ip route add 192.168.1.0/24 dev eth0

关于Linux/中央操作系统 : How to force FTP/SSH to use a particular ethernet adapter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10106505/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com