- 论坛徽章:
- 0
|
环境:两条宽带都接到hub上,网关ip分别为192.168.1.1和192.168.1.2
现在有一天linux主机,装的双网卡,ip分别为192.168.1.10和192.168.1.11都接到了hub上
目标:希望能够同时用两个宽带上网,带宽能够增大,1+1不等于2希望至少比1大
我参考网上前人的设置,写了如下设置:- #!/bin/bash
- def_ro=`ip route ls |grep "default"`
- ip route add 192.168.1.0/24 dev eth0 src 192.168.1.10 table T1
- ip route add default via 192.168.1.1 table T1
- ip route add 192.168.1.0/24 dev eth1 src 192.168.1.11 table T2
- ip route add default via 192.168.1.2 table T2
- ip rule add from 192.168.1.10 table T1
- ip rule add from 192.168.1.11 table T2
- ip route delet $def_ro
- ip route add default scope global nexthop via 192.168.1.1 dev eth0 weight 1 nexthop via 192.168.1.2 dev eth1 weight 1
- ip route flush cache
复制代码 运行后,下载测试带宽并没有增加,两个网卡的流量也没啥规律,更不均衡了,不知道为啥呢??- eth0 Link encap:Ethernet HWaddr 00:E0:4D:3E:6D:6F
- inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
- inet6 addr: fe80::2e0:4dff:fe3e:6d6f/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:8601 errors:0 dropped:0 overruns:0 frame:0
- TX packets:11545 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:9883725 (9.4 MiB) TX bytes:1204231 (1.1 MiB)
- Interrupt:11 Base address:0xc000
- eth1 Link encap:Ethernet HWaddr 00:40:63:C0:72:CC
- inet addr:192.168.1.11 Bcast:192.168.1.255 Mask:255.255.255.0
- inet6 addr: fe80::240:63ff:fec0:72cc/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:6134 errors:0 dropped:0 overruns:0 frame:0
- TX packets:1663 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:3475946 (3.3 MiB) TX bytes:319238 (311.7 KiB)
- Interrupt:10 Base address:0x6000
- lo Link encap:Local Loopback
- inet addr:127.0.0.1 Mask:255.0.0.0
- inet6 addr: ::1/128 Scope:Host
- UP LOOPBACK RUNNING MTU:16436 Metric:1
- RX packets:8 errors:0 dropped:0 overruns:0 frame:0
- TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)
复制代码 |
|