
0 - Sets a round-robin policy for fault tolerance and load balancing. Transmissions are received and sent out sequentially on each bonded slave interface beginning with the first one available.
1 - Sets an active-backup policy for fault tolerance. Transmissions are received and sent out via the first available bonded slave interface. Another bonded slave interface is only used if the active bonded slave interface fails.
2 - Sets an XOR (exclusive-or) policy for fault tolerance and load balancing. Using this method, the interface matches up the incoming request's MAC address with the MAC address for one of the slave NICs. Once this link is established, transmissions are sent out sequentially beginning with the first available interface.
3 - Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces.
4 - Sets an IEEE 802.3ad dynamic link aggregation policy. Creates aggregation groups that share the same speed and duplex settings. Transmits and receives on all slaves in the active aggregator. Requires a switch that is 802.3ad compliant.
5 - Sets a Transmit Load Balancing (TLB) policy for fault tolerance and load balancing. The outgoing traffic is distributed according to the current load on each slave interface. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed slave.
6 - Sets an Active Load Balancing (ALB) policy for fault tolerance and load balancing. Includes transmit and receive load balancing for IPV4 traffic. Receive load balancing is achieved through ARP negotiation.
需要注意的是MODE 0仅仅能实现网卡轮询,但同一时间只有一个网卡生效,总体带宽还是1个网卡的带宽。
这里,我们需要开启交换机的802.3ad,并设置mode=4来实现带宽增倍
注意,在上面这个BLOG里的mode需要改一下:
vi /etc/modprobe.conf
alias bond0 bonding
options bond0 miimon=100 mode=4 lacp_rate=1
我们用iperf工具来测试带宽,由于mode 4模式使用mac地址分配那个网卡参与工作,因此,需要多台测试机进行测试
10.199.81.39作为server,10.199.81.40及10.199.81.42作为client,如果两个client均能达到1000Mbits,那也就意味着带宽是翻倍了。
server:
# iperf -s -w 1M
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 2.00 MByte (WARNING: requested 1.00 MByte)
------------------------------------------------------------
[ 4] local 10.199.81.39 port 5001 connected with 10.199.81.40 port 9951
[ 5] local 10.199.81.39 port 5001 connected with 10.199.81.42 port 61211
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-100.0 sec 11.1 GBytes 949 Mbits/sec
[ 5] 0.0-100.0 sec 11.1 GBytes 949 Mbits/sec
达到了带宽翻倍的目的
Linux系统有好多种类,像我们经常碰到的centos、ubuntu或redhat有的系统是有 *** 作界面的,有的直接是命令模式,命令模式的适合做服务器,大家都知道Linux系统安全性比较高,所以在网络上的运用也是相当的广泛。
linux如何拨号上网
当然有界面的设置更加方便,那么没界面的系统只能从配置文件中修改,我就把从配置文件中设置拨号上网的方式呈现下。
不管有没有界面 *** 作,此配置都可以使用,大家知道Linux系统查看文件的命令有很多,只要目录才是关键,通过more /etc/sysconfig/network-scripts/ifcfg-ppp0 命令跟目录的方式知道系统文件下进行对pppoe拨号账号设置具体方式参考下图。
为了提高安全性。密码放置在sysconfig文件目录下,密码就放置在密码文件。密码放置的目录在/etc/ppp/下,从下图我们就可以看到需要pap和chap验证的2个文件。
找到目录我们就进入设置密码,我们可以看到账号和密码都是以“”表示隔开。大家在设置账号密码的时候记得两个文件都需要更改。
修改了配置文件就不需要图形界面的配置了
更改配置文件的命令是vi,通常我们说的是vi编辑器就是这个,通过vi编辑器修改里面的配置。
有的朋友对于编辑器不太熟悉,狂用ctrl+c,+v,+z但是都是行不通,Linux下退出编辑器的命令是:q表示直接退出不保存如果需要保存那么就:wq,意思是write quit的意思,保存退出。
完成设置后我们可以在命令行下ping下域名或网络地址即可,或者我们再看下ip获取情况,我们看到获取到了一个正常的公网地址,然后也可以ping通百度网站,说明网络已经连接,恭喜可以正常上网了。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)