服务器网卡多网卡绑定及vlan支持

版本: 1.2 2014-12-04 增加一个排错案例

版本: 1.1 2012-07-26 增加如何查看linux系统中的bond状态

版本: 1.0

原理: 利用802.3ad协议,实现多网卡的绑定。

利用802.31p协议,实现服务器对多vlan的支持。

结果: 通过netperf测试,双网卡绑定流量可以达到1.5G以上。

通过对vlan的支持,服务器可以绑定多个vlan的ip。

软件环境:

broadcom网卡 windows 2003 windows 2008 Dotnet3.5 broadcom 管理软件BACS

intel 网卡 windows 2003 windows 2008 最新驱动包

hp服务器 最新驱动包,hp网卡管理工具

linux centos 6.2

注意事项:

1) 一定要确定交换机端口和服务器网卡的对应关系。

2) 配置的时候,交换机端口关闭,待服务器和交换机全部完成配置后,再开启端口,否则可能导致交换机端口自动阻塞。

3) 配置的时候网卡ip信息会丢失,如果是远程操作,会造成连接丢失,请做预案。

操作步骤:

1. 交换机配置

多网卡绑定支持

假设3,4端口做port-channel,相关配置如下:

snda-intel-lab-2960s-250#sh running-config int port-channel 1

Building configuration...

Current configuration : 55 bytes

!

interface Port-channel1

switchport mode access

end

snda-intel-lab-2960s-250#sh running-config int g0/3

Building configuration...

Current configuration : 137 bytes

!

interface GigabitEthernet0/3

switchport mode access

spanning-tree portfast

channel-protocol lacp

channel-group 1 mode passive

end

snda-intel-lab-2960s-250#sh running-config int g0/4

Building configuration...

Current configuration : 137 bytes

!

interface GigabitEthernet0/4

switchport mode access

spanning-tree portfast

channel-protocol lacp

channel-group 1 mode passive

end

vlan支持,交换机接服务器端口做truak配置

interface GigabitEthernet0/15

switchport mode trunk

2. 软件安装

Windows 系统

1) intel网卡在intel网站下载最新的网卡驱动安装就可以。

2) broadcom 网卡在broadcom网站下载最新驱动,并下载网卡管理工具,目前能下载到的管理工具只支持windows server 2008,如果需要支持windows server 2003 请在dell ibm 等厂家网站支持页面下载比较老的版本。

3) hp服务器安装最新的网卡驱动和管理工具,hp的设置方法和broadcom设置类似,多网卡绑定介绍broadcom管理工具使用,网卡vlan介绍hp网卡的使用。

Linux 系统不需要安装特殊软件

3. 配置网卡端口绑定

Windows 系统

broadcom网卡

添加一个端口组

下一步

输入一个名字

选择第二项802.3ad

添加要绑定的网卡

配置vlan,一般没有的,跳过

完成

需要几分钟的配置

网卡需要几分钟和交换机协商,完成后,可以看到两块网卡开始正常工作

intel 网卡

选择网卡属性

选择分组—将此适配器与其他适配器组合—新组

选择网卡

创建成功,将Ip绑定到新建的组上。

Linux 系统

[root@lab]# cat /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0

BOOTPROTO=none

IPADDR=172.16.1.248

NETMASK=255.255.255.0

GATEWAY=172.16.1.1

TYPE=Ethernet

BONDING_OPTS="mode=4 miimon=100"

注:

CentOS7 bond配置:

cat ifcfg-bond0

DEVICE=bond0

NAME=bond0

BOOTPROTO=dhcp

BONDING_MASTER=yes

BONDING_OPTS="mode=0 miimon=100"

(BONDING_MASTER=yes 这一句一定需要)

[root@lab]# cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

BOOTPROTO=none

ONBOOT=yes

TYPE=Ethernet

MASTER=bond0

SLAVE=yes

[root@lab]# cat /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1

ONBOOT=yes

BOOTPROTO=none

TYPE=Ethernet

MASTER=bond0

SLAVE=yes

[root@lab]# cat /etc/modprobe.d/bond0.conf

alias bond0 bonding

4. 配置网卡对vlan的支持

Windows 系统

Intel网卡

选择网络连接属性---网卡配置

点击vlan按钮

新建一个vlan,输入vlan id名字---确定

过一会就可以在网络管理器看到两个网卡,

如果需要创建多个vlan,可以同样设置。

Broadcom网卡

以hp服务器为例,dell ibm使用broadcom的管理工具,配置过程类似

选择需要配置vlan的网卡,点击vlan按钮

添加一个vlan100

等待配置生效

完成后可以看到生成一个网卡,vlan100,如果需要生成多个vlan,可以重复操作:

Linux 系统

配置对vlan100的支持

[root@lab]# cat ifcfg-eth1

DEVICE=eth1

HWADDR=E4:1F:13:B7:8F:56

ONBOOT=yes

BOOTPROTO=none

TYPE=Ethernet

[root@lab]# cat ifcfg-eth1.100

DEVICE=eth1.100

ONBOOT=yes

BOOTPROTO=none

TYPE=Ethernet

VLAN=yes

IPADDR=*.*.*.*

NETMASK=255.255.255.0

附1

Linux 系统中参数及其意义

mode=<value>

Allows you to specify the bonding policy. The <value> can be one of:

balance-rr or 0 &mdash; 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.

active-backup or 1 &mdash; 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.

balance-xor or 2 &mdash; 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.

broadcast or 3 &mdash; Sets a broadcast policy for fault tolerance. All transmissions are sent on all slave interfaces.

802.3ad or 4 &mdash; 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.

balance-tlb or 5 &mdash; 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.

balance-alb or 6 &mdash; 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.

附2:

Linux 系统中绑定失败的处理一例

insmod /lib/modules/2.6.18-164.el5/kernel/net/ipv6/ipv6.ko disable=1

insmod /lib/modules/2.6.18-164.el5/kernel/drivers/net/bonding/bonding.ko

3:

查看linux系统中bond状态

cat /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)

Bonding Mode: load balancing (round-robin)

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 0

Down Delay (ms): 0

Slave Interface: eth1

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:1b:21:9f:0e:17

Slave queue ID: 0

Slave Interface: eth3

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:1b:21:9f:0c:37

Slave queue ID: 0

Slave Interface: eth5

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:25:90:14:1a:19

Slave queue ID: 0

附4

最近在实施一个网卡绑定的时候,碰到一个很奇怪的案例。

现象是:

eth0 eth1 绑定成bond0,使用的是mode4,交换机对应的端口也做了绑定。

测试的时候发现一个很奇怪的现象,将eth1 down up网络可以正常通讯。

将eth0 down 网络可以正常通讯 但是将eth0 up的时候,网络直接就会断掉。

查看bond状态,bond得不到mac,端口只有一个。

cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
802.3ad info
LACP rate: fast
Aggregator selection policy (ad_select): stable
Active Aggregator Info:Aggregator ID: 15Number of ports: 1Actor Key: 17Partner Key: 3Partner Mac Address: 000000000

h3c交换机修改成和服务器动态协商

link-aggregation mode dynamic

欢迎加我微信(ID:xiaolikvm)一起交流。欢迎加入云技术社区KVM/QEMU技术交流QQ,请加QQ:502207183,注明姓名,城市,及要加入KVM群。

服务器网卡多网卡绑定及vlan支持相关推荐

  1. 腾讯云服务器增加网卡,腾讯云centos7服务器添加辅助网卡绑定多IP实践

    购买的腾讯云CVM服务器默认只有一个公网IP的,如果您的业务有多IP的需求,可以通过云服务器绑定弹性网卡,再通过弹性网卡绑定弹性公网IP的方式实现.本文为介绍如何通过绑定弹性网卡的方式,绑定弹性公网I ...

  2. 服务器无盘网卡设置,安装无盘时各种网卡最佳设置

    1.8168/8111c网卡高级设置 在网卡高级选项里 JUMBO FRAME 改成无 802.1Q/1P VLAN Tagging 改成关闭 Flow Control  改成关闭 Jumbo Fra ...

  3. 服务器bios查看网卡型号,bios查看网卡型号

    bios查看网卡型号 [2021-01-28 07:17:40]  简介: php去除nbsp的方法:首先创建一个PHP代码示例文件:然后通过"preg_replace("/(\s ...

  4. 无盘 服务器 聚合,四网卡汇聚技术详解(为windows7无盘铺路)

    一.网卡端口汇聚: 首先先看下我汇聚好的设备管理器图 详细步骤如下: 安装最新的网卡驱动会自动把INTEL分组的功能集成进去 1.安装INTEL的网卡驱动(我安装的是14.4) 2.驱动完毕后在设备管 ...

  5. 试hp服务器不识别网卡一则

    昨天发现hp ml370 g3服务器上网络不通,装完之后就没通.重起服务器后只能发现一块网卡(该服务器3块网卡,2块后加的),怀疑1.线或交换机有问题,经测试,正常.2.怀疑系统问题,重做linux系 ...

  6. ubuntu服务器网络管理(解决无法restart命令重启网卡,网卡冲突等)

    在我们使用服务器的网络过程中,服务器都有多个网卡,通常需要给服务器多个IP以此来配合多个网络的使用,但是很多时候给网卡新配置一个IP之后都不会生效,下面给出两种方法 查看网卡名 ifconfig -a ...

  7. Linux服务器排错之网卡频繁updown

    Linux服务器排错之网卡频繁updown ​ 这几天德阳的一台服务器公网频繁出现updown的情况,down掉的时间随机,基本上每天都会出现一两次,但是down掉时间很短,一秒甚至不到一秒就恢复正常 ...

  8. 服务器厂商对VMware vSphere的驱动支持

    虚拟化软件厂商有华为FusionCompute.深信服.SmartX超融合.天融信超融合(TopHC).新华三H3C UIS超融合.青云QingCloud.联想超融合.VMware vSphere.C ...

  9. Linux网卡ifcfg网卡配置项详解

    前言 由于在工作中涉及到服务器网卡的适配,算是linux新手,本次记录下linux网卡ifcfg-exx配置项含义说明,以下是某款终端下centos 7.5系统自动生成的网卡配置内容: [root@x ...

最新文章

  1. R语言使用ggplot2包使用geom_boxplot函数绘制基础分组缺口箱图(notch boxplot)实战
  2. MariaDB/MySQL 报错解决:ERROR 1698 (28000): Access denied for user 'root'@'localhost'
  3. 银行办理业务观察者模式解析
  4. SaltStack:Salt SSH
  5. JavaScript实现十种经典排序算法(js排序算法)
  6. 关于求职简历的碎碎念。
  7. 从前序与中序遍历序列构造二叉树Python解法
  8. 怎样使set现程变得安全_使不安全变得更加安全
  9. python爬取csdn用户头像
  10. 移除mac下 .Ds_Store的解决办法
  11. 闽什么什么院第二课堂网课破解-----微信内置浏览器
  12. EDA技术及应用实验2 h_adder程序
  13. 热插拔48块硬盘服务器,24块前置热插拔硬盘设计
  14. 亚洲杯:国足告别阿联酋
  15. 分享新作:休闲小游戏『Flying Stone』
  16. 10大动图:秒懂各种常用通信协议原理
  17. Altium Designer21 的安装过程
  18. IT行业怎么了?程序员按时上下班也被开除
  19. 9种圣诞字体tabs选择
  20. 简单的无人坚守的远程控制软件-向日葵远程控制软件-12版本配置方法

热门文章

  1. codeforces Div.2 #429 B.Godsend C. Leha and Function
  2. EC20 不常用AT 命令 整理
  3. linux中20个高级命令 8月26日学习笔记
  4. 西藏计算机一级,西藏计算机一级考试成绩查询入口
  5. Java——计算圆面积
  6. MapReduce实战案例:发现共同好友
  7. Office EXCEL VBA如何取得EXCEL中的行数和列数
  8. 【agora】AgoraService 大管家
  9. 微信浏览器h5分享卡片模式
  10. 句子记录(摘抄+原创)