linux 多重 路由,linux – 两个或多个默认路由时的路由行为是什么?

我当时有两个ISP,连接到同一台机器.我默认在路由表中添加了它们.但是,仅使用一个连接.

$route

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 192.168.1.1 0.0.0.0 UG 303 0 0 eth0

0.0.0.0 192.168.0.1 0.0.0.0 UG 303 0 0 eth1

192.168.1.0 0.0.0.0 255.255.255.0 U 303 0 0 eth0

192.168.0.0 0.0.0.0 255.255.255.0 U 303 0 0 eth1

如何平衡两个ISP之间的流量负载?

解决方法:

平衡两条路线之间的交通的关键步骤是给它们两个权重.

ip route add default scope global \

nexthop via 192.168.0.1 dev eth1 weight 1 \

nexthop via 192.168.1.1 dev eth0 weight 1

标签:administration,linux,routing

来源: https://codeday.me/bug/20190809/1634346.html