linux服务器绑定双网卡(以ubuntu server 10.04)
2013-08-04 16:10
477 查看
Linux双网卡绑定实现就是使用两块网卡虚拟成为一块网卡,这个聚合起来的设备看起来是一个单独的以太网接口设备,通俗点讲就是两块网卡具有相同的IP 地址而并行链接聚合成一个逻辑链路工作。其实这项 技术在Sun和Cisco中早已存在,被称为Trunking和Etherchannel技术,在Linux的2.4.x的内核中也采用这这种技术,被称为bonding。bonding技术的最早应用是在集群——beowulf上,为了提高集群节点间的数据传输而设计的。
下面我们讨论一下bonding 的原理,什么是bonding需要从网卡的混杂(promisc)模式说起。我们知道,在正常情况下,网卡只接收目的硬件地址(MAC Address)是自身Mac的以太网帧,对于别的数据帧都滤掉,以减轻驱动程序的负担。但是网卡也支持另外一种被称为混杂promisc的模式,可以接收网络上所有的帧,比如说tcpdump,就是运行在这个模式下。bonding也运行在这个模式下,而且修改了驱动程序中的mac地址,将两块网卡的 Mac地址改成相同,可以接收特定mac的数据帧。然后把相应的数据帧传送给bond驱动程序处理。
Ubuntu 10.04 server
没安装的话,执行
写道
apt-get install ifenslave-2.6
写道vim /etc/network/interfaces
auto lo
iface lo inet loopback
auto bond0
iface bond0 inet static
address 192.168.4.132
netmask 255.255.255.0
gateway 192.168.4.1
post-up ifenslave bond0 eth0 eth1
pre-down ifenslave -d bond0 eth0 eth1
写道modprobe bonding
这样就不用重启设备了
当然,配置文件也同样需要添加
写道vim /etc/modules
bonding mode=0 miimon=100
写道/etc/init.d/networking restart
完成以后,同样可以查看一下bonding的状态
写道root@132:/etc/network# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:10:5c:ef:b2:a2
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:10:5c:ef:b2:a3
Slave queue ID: 0
下面我们讨论一下bonding 的原理,什么是bonding需要从网卡的混杂(promisc)模式说起。我们知道,在正常情况下,网卡只接收目的硬件地址(MAC Address)是自身Mac的以太网帧,对于别的数据帧都滤掉,以减轻驱动程序的负担。但是网卡也支持另外一种被称为混杂promisc的模式,可以接收网络上所有的帧,比如说tcpdump,就是运行在这个模式下。bonding也运行在这个模式下,而且修改了驱动程序中的mac地址,将两块网卡的 Mac地址改成相同,可以接收特定mac的数据帧。然后把相应的数据帧传送给bond驱动程序处理。
Ubuntu 10.04 server
没安装的话,执行
写道
apt-get install ifenslave-2.6
1、修改网卡配置
Ubuntu的稍微简单一些写道vim /etc/network/interfaces
auto lo
iface lo inet loopback
auto bond0
iface bond0 inet static
address 192.168.4.132
netmask 255.255.255.0
gateway 192.168.4.1
post-up ifenslave bond0 eth0 eth1
pre-down ifenslave -d bond0 eth0 eth1
2、加载模块
首先执行写道modprobe bonding
这样就不用重启设备了
当然,配置文件也同样需要添加
写道vim /etc/modules
bonding mode=0 miimon=100
3、重启网卡
执行写道/etc/init.d/networking restart
完成以后,同样可以查看一下bonding的状态
写道root@132:/etc/network# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:10:5c:ef:b2:a2
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:10:5c:ef:b2:a3
Slave queue ID: 0
相关文章推荐
- ubuntu 10.04 server 网卡驱动 图形界面问题日志
- Ubuntu server 14.04 LTS 多网卡绑定实现负载均衡
- ubuntu server 10.04 网卡丢失或不能联网
- Ubuntu 10.04修改内核并编译后有线网卡无法使用问题解决
- 【转】Ubuntu server 9.10更改网卡配置设置IP地址
- ubuntu server 10.04 安装 LAMP
- Ubuntu 10.04下安装TL-WN721N(RT5370)无线网卡驱动
- ubuntu 复制文件到xp (How i can copy file from server(OS:ubuntu 10.04) to my PC
- RedHat下利用bonding实现linux服务器网卡绑定
- Red Hat Enterprise Linux Server release 6.3 实现双网卡绑定
- 在Ubuntu 10.04中文版下Qt编程,使用unixODBC和FreeTDS连接MS SQL Server 2005,并且中文不出现乱码的方法
- u盘安装ubuntu10.04 、11.04 server
- windows、ubuntu、Red Hat、Solaris 单网卡绑定多个IP
- Ubuntu 10.04 升级到 11.04 无线网卡驱动问题
- VirtualBox上Ubuntu Server虚拟机配置双网卡
- Ubuntu 10.04 无线网卡 无法连接
- ubuntu server 10.04安装全攻略
- ubuntu双网卡绑定一个IP
- linux服务器双网卡绑定