![通过不同接口连接到同一服务器](https://linux22.com/image/5839/%E9%80%9A%E8%BF%87%E4%B8%8D%E5%90%8C%E6%8E%A5%E5%8F%A3%E8%BF%9E%E6%8E%A5%E5%88%B0%E5%90%8C%E4%B8%80%E6%9C%8D%E5%8A%A1%E5%99%A8.png)
我有两个 pppoe 接口 -ppp0
和ppp1
。我想在两个接口上访问同一服务器。我将所需的 IP 地址添加到路由表中:
route add 10.88.40.13 ppp0
我可以连接到服务器。但是当我想将此目标 IP 也添加到其他接口时:
route add 10.88.40.13 ppp1
kittlnx127:~ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.62.49.1 0.0.0.0 UG 0 0 0 eth0
10.62.49.0 * 255.255.255.0 U 0 0 0 eth0
10.88.40.13 * 255.255.255.255 UH 0 0 0 ppp1
loopback * 255.0.0.0 U 0 0 0 lo
link-local * 255.255.0.0 U 0 0 0 eth0
169.254.203.1 * 255.255.255.255 UH 0 0 0 ppp0
169.254.203.1 * 255.255.255.255 UH 0 0 0 ppp1
192.168.201.0 * 255.255.255.0 U 0 0 0 eth1
因此该条目已更新为新界面。两个接口的源IP地址不同:
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.43.154.48 P-t-P:169.254.203.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:80 (80.0 b) TX bytes:80 (80.0 b)
ppp1 Link encap:Point-to-Point Protocol
inet addr:10.43.154.32 P-t-P:169.254.203.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:80 (80.0 b) TX bytes:80 (80.0 b)
那么是否有可能以某种方式在两个接口上到达同一服务器?我应该提供更多细节吗?提前致谢!我找到了这个问题但我认为这不是同一件事......
答案1
我想你正在寻找的东西叫做网络接口绑定
参见,例如http://docs.oracle.com/cd/E37670_01/E41138/html/ch11s05.html