Debian,2个网卡负载平衡或与同一个网关进行聚合

我有一台服务器,双网卡连接到同一个网关的交换机。 在交换机后面我们有互联网。

| Debian的| – > eth0 – > switch – > internet – > eth1 – >相同

我不明白如何在eth0和eth1之间进行负载平衡。 入站/出站stream量始终使用eth1。

这是configuration:

# The primary network interface allow-hotplug eth0 auto eth0 iface eth0 inet static address 192.168.248.82 netmask 255.255.255.240 network 192.168.248.80 broadcast 192.168.248.95 gateway 192.168.248.81 allow-hotplug eth1 auto eth1 iface eth1 inet static address 192.168.248.83 netmask 255.255.255.240 network 192.168.248.80 broadcast 192.168.248.95 gateway 192.168.248.81 

 Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.248.80 0.0.0.0 255.255.255.240 U 0 0 0 eth1 192.168.248.80 0.0.0.0 255.255.255.240 U 0 0 0 eth0 0.0.0.0 192.168.248.81 0.0.0.0 UG 0 0 0 eth1 0.0.0.0 192.168.248.81 0.0.0.0 UG 0 0 0 eth0 

Ips不是真实的,只是为了举例。

任何人有一个正确的路由使用eth0 192.168.248.82和eth1 192.168.248.83的想法? 我有很多多网关的例子,但在这里是一样的。

谢谢大家。

问候

简单的答案是,你不能这样做。 事情不是为了这样工作的。

是的,Linux是非常灵活的,所以你可能会发现一些非常模糊的方法来实现你想要的一些行为,但是将两个链接绑定会好得多。

要做你想做的事情,你可能需要查看一些关于多个ISP连接的文档。 这些概念可能足够接近你想要做的事情。 这Shorewall多IPS文档可能会给你一个想法如何做到这一点。