debian 8.2 bond 双网卡
来源:互联网 发布:正交矩阵性质 编辑:程序博客网 时间:2024/06/04 23:27
安装 debian 8.2
eth0
eth1
eth2
bonding模块工作方式
bonding有0-6七种模式,常用的工作方式为0、1、6三种:
0: (balance-rr) Round-robin policy: (平衡抡循环策略):传输数据包顺序是依次传输,直到最后一个传输完毕,
此模式提供负载平衡和容错能力。
1: (active-backup) Active-backup policy:(主-备份策略):只有一个设备处于活动状态。 一个宕掉另一个马上由
备份转换为主设备。mac地址是外部可见得。
此模式提供了容错能力。
2: (balance-xor) XOR policy:(广播策略):将所有数据包传输给所有接口。
此模式提供了容错能力。
3: (balance-xor) XOR policy:(平衡策略): 传输根据原地址布尔值选择传输设备。
此模式提供负载平衡和容错能力。
4: (802.3ad) IEEE 802.3ad Dynamic link aggregation.IEEE 802.3ad 动态链接聚合:创建共享相同的速度和
双工设置的聚合组。
5: (balance-tlb) Adaptive transmit load balancing(适配器传输负载均衡):没有特殊策略,第一个设备传不通就用
另一个设备接管第一个设备正在处理的mac地址,帮助上一个传。
6: (balance-alb) Adaptive load balancing:(适配器传输负载均衡):大致意思是包括mode5,bonding驱动程序
截获 ARP 在本地系统发送出的请求,用其中之一的硬件地址覆盖从属设备的原地址。就像是在服务器上不同的人
使用不同的硬件地址一样
本次参考主库,采用 模式1
安装ifenslave,用作bonding
# apt-get install ifenslave
让系统开机自动加载模块bonding
# echo "bonding" >> /etc/modules
没有重启需要手动添加进linux 内核
# modprobe bonding
创建vip bond
# cd /etc/network/interfaces.d# vi bond0:1# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).# The bond0:1 network interfaceauto bond0:1 iface bond0:1 inet static address 192.168.56.99 netmask 255.255.255.0 network 192.168.56.0 gateway 192.168.56.1
添加如下网卡配置文件
# vi /etc/network/interfaces# The primary network interfaceauto bond0iface bond0 inet static address 192.168.56.100 netmask 255.255.255.0 gateway 192.168.56.1 bond-mode 1 bond-primary eth0 bond-slaves eth0 eth1 bond-miimon 100 bond-downdelay 400 bond-updelay 800#post-up ifenslave bond0 eth0 eth1#pre-down ifenslave -d bond0 eth0 eth1
重新启动网卡
# /etc/init.d/networking restart
配置网卡信息****/
# cd /etc/network/interfaces.d/# ls -l总用量 4-rw-r--r-- 1 root root 137 6月 21 19:19 bond0:1# cat bond0:1 auto bond0:1 iface bond0:1 inet static address 192.168.56.99 netmask 255.255.255.0 network 192.168.56.0 gateway 192.168.56.1# cd /etc/network# cat interfaces# This file describes the network interfaces available on your system# and how to activate them. For more information, see interfaces(5).source /etc/network/interfaces.d/* #*/# The loopback network interfaceauto loiface lo inet loopback# The primary network interfaceauto bond0iface bond0 inet static address 192.168.56.100 netmask 255.255.255.0 gateway 192.168.56.1 bond-mode 1 bond-primary eth0 bond-slaves eth0 eth1 bond-miimon 100 bond-downdelay 400 bond-updelay 800up route del default gw 192.168.56.1down route del default gw 192.168.56.1auto eth2iface eth2 inet staticaddress 10.234.99.184netmask 255.255.255.0gateway 10.234.99.212up route del default gw 10.234.99.212down route del default gw 10.234.99.212 up route add default gw 10.234.99.7down route add default gw 10.234.99.7# ifconfig -abond0 Link encap:Ethernet HWaddr 08:00:27:7c:70:24 inet addr:192.168.56.100 Bcast:192.168.56.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe7c:7024/64 Scope:Link UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1 RX packets:100 errors:0 dropped:7 overruns:0 frame:0 TX packets:157 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:9967 (9.7 KiB) TX bytes:20953 (20.4 KiB)bond0:1 Link encap:Ethernet HWaddr 08:00:27:7c:70:24 inet addr:192.168.56.99 Bcast:192.168.56.255 Mask:255.255.255.0 UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1eth0 Link encap:Ethernet HWaddr 08:00:27:7c:70:24 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:93 errors:0 dropped:0 overruns:0 frame:0 TX packets:157 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:9511 (9.2 KiB) TX bytes:20953 (20.4 KiB)eth1 Link encap:Ethernet HWaddr 08:00:27:7c:70:24 UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1 RX packets:7 errors:0 dropped:7 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:456 (456.0 B) TX bytes:0 (0.0 B)eth2 Link encap:Ethernet HWaddr 08:00:27:92:4c:bd inet addr:10.234.99.184 Bcast:10.234.99.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe92:4cbd/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:830 errors:0 dropped:0 overruns:0 frame:0 TX packets:82 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:70259 (68.6 KiB) TX bytes:10501 (10.2 KiB)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:65536 Metric:1 RX packets:83 errors:0 dropped:0 overruns:0 frame:0 TX packets:83 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:26004 (25.3 KiB) TX bytes:26004 (25.3 KiB)
删除vip
# ifquery --listlobond0:1bond0eth2
# cd /etc/network/interfaces.d/# mv ./bond0:1 ../# /etc/init.d/networking restart
创建vip
# cd /etc/network/interfaces.d# vi bond0:1 auto bond0:1 iface bond0:1 inet static address 192.168.56.99 netmask 255.255.255.0 network 192.168.56.0 gateway 192.168.56.1# ifquery --listlobond0:1bond0eth2# /etc/init.d/networking restart
- debian 8.2 bond 双网卡
- Debian/Ubuntu下的网卡绑定-四网卡双bond
- 双网卡bond
- 双网卡bond配置
- CentOS双网卡bond绑定
- redhat6.5双网卡bond
- bond网卡
- CentOS双网卡做bond测试实验
- gentoo双网卡绑定为bond
- [基础]RHEL6双网卡绑定BOND
- linux配置bond双网卡绑定
- centos双网卡bond绑定详解
- LINUX-网卡Bond
- Centos 网卡做bond
- Centos 网卡做bond
- centos7网卡配置bond
- 实战网卡bond
- CentOS7实现网卡bond
- Python学习代码之买个宠物玩玩
- 循环神经网络(RNN, Recurrent Neural Networks)介绍
- ARM9 SWI软件中断
- HTTP Status 400
- 用python学概率与统计(第三章)描述性统计:数值方法
- debian 8.2 bond 双网卡
- 冬天到了,分享两款雪花特效代码
- 关于this指向及其改变指向的问题
- IT行业里的风险投资
- 哈尔滨理工大学第七届程序设计竞赛初赛(高年级组)B、C【water】
- IT
- 算法——中国剩余定理(孙子定理)
- Spring中Bean及@Bean的理解
- 关于get_magic_quotes_gpc()函数