centos 6.2 网卡聚合及Cisco交换机链路聚合

一、配置环境

centos 6.2系统。网卡1口和2口做链路聚合。    交换机网口 6口和7口。

二、服务器操作步骤

  1.创建一个channel bonding interface

#vi /etc/sysconfig/network-scripts/ifcfg-bond0
添加如下几行:
GATEWAY=192.168.10.1
DNS1=202.106.0.20
DEVICE=bond0
BOOTPROTO=none
NETMASK=255.255.255.0
TYPE=Ethernet
IPADDR=192.168.10.100
ONBOOT=yes
USERCTL=no

也可以使用 setup 命令进入网卡配置模式,添加一块行的网卡: <New Device>  --> Ethernet--> Name :bond0 --> Device:bond0  ……保存后-->进入bond0的配置文件,将ONBOOT参数改为yes。

2.修改网卡em1和em2 配置

DEVICE=em1  ## 网卡em1:DEVICE 参数为em1   网卡em2:DEVICE 参数为em2
ONBOOT=no
TYPE=Ethernet
MASTER=bond0
BOOTPROTO=none
USERCTL=no
SLAVE=yes
IPV6INIT=no

3.编辑bond0.conf配置文件,及配置bond模式

创建bond.config配置文件:

vi /etc/modprobe.d/bond0.conf
添加如下行:
alias  bond0 bonding

修改bond模式:(mode 0:为负载均衡)

echo 0 > /sys/class/net/bond0/bonding/mode

重启网卡服务:service network restart  (在交换机也做好channel后再重启网卡服务,这样可以和服务器不断开连接)

注:
mode的值表示工作模式,他共有0,1,2,3,4,5,6这7种模式,常用的为0,1两种。
mode=0表示load balancing (round-robin)为负载均衡方式,两块网卡都工作。
mode=1表示fault-tolerance (active-backup)提供冗余功能,工作方式是主备的工作方式,也就是说默认情况下只有一块网卡工作,另一块做备份.
mode=2表示balance-x,提供负载均衡和冗余功能。
mode=3表示broadcast,这个模式提供容错性。
mode=4表示802.3ad,提供了ethtool的迅速,以及使用了802.3ad模式
mode=5表示balance-tlb,自动适应负载均衡,自动切换故障。在此基础上Ethtool支持驱动。
mode=6表示在5模式的基础上优化了arp的广播信息。

bonding模式介绍和所需条件详见:

http://blog.chinaunix.net/uid-49097-id-78251.html

三、交换机下的配置:

(config)#interface range gigabitEthernet 0/6 -7
(config-if-range)#switchport access vlan 10
(config-if-range)#channel-protocol lacp
(config-if-range)#channel-group 3 mode active
(config)#interface port-channel 3
(config-if)#switchport access vlan 10

四、主机show 信息:

[[email protected] bonding]# ifconfig
bond0 Link encap:Ethernet HWaddr 14:FE:B5:C8:1A:B7
inet addr:192.168.10.100  Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::16fe:b5ff:fec8:1ab7/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:60730879 errors:0 dropped:0 overruns:0 frame:0
TX packets:10640 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:11017881974 (10.2 GiB) TX bytes:1221132 (1.1 MiB)

em1 Link encap:Ethernet HWaddr 14:FE:B5:C8:1A:B7
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:30367565 errors:0 dropped:0 overruns:0 frame:0
TX packets:5315 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5509317809 (5.1 GiB) TX bytes:607884 (593.6 KiB)
Interrupt:24 Memory:e6000000-e6012800

em2 Link encap:Ethernet HWaddr 14:FE:B5:C8:1A:B7
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:30363314 errors:0 dropped:0 overruns:0 frame:0
TX packets:5325 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5508564165 (5.1 GiB) TX bytes:613248 (598.8 KiB)
Interrupt:25 Memory:e8000000-e8012800

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:2163 errors:0 dropped:0 overruns:0 frame:0
TX packets:2163 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3604424 (3.4 MiB) TX bytes:3604424 (3.4 MiB)

++++++++++++++++++++++++++++++++++++++++++

[[email protected] bonding]# dmesg | grep bond0
Loading kernel module for a network device with CAP_SYS_MODULE (deprecated). Use CAP_NET_ADMIN and alias netdev-bond0 instead
bonding: bond0: setting mode to balance-rr (0).
ADDRCONF(NETDEV_UP): bond0: link is not ready
bonding: unable to remove non-existent slave em1 for bond bond0.
bonding: unable to remove non-existent slave em2 for bond bond0.
ADDRCONF(NETDEV_UP): bond0: link is not ready
bonding: bond0: Adding slave em1.
bonding: bond0: Warning: failed to get speed and duplex from em1, assumed to be 100Mb/sec and Full.
bonding: bond0: enslaving em1 as an active interface with an up link.
ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
bonding: bond0: Adding slave em2.
bonding: bond0: Warning: failed to get speed and duplex from em2, assumed to be 100Mb/sec and Full.
bonding: bond0: enslaving em2 as an active interface with an up link.
bond0: no IPv6 routers present
bonding: bond0: Removing slave em1
bonding: bond0: Warning: the permanent HWaddr of em1 - 14:fe:b5:c8:1a:b7 - is still in use by bond0. Set the HWaddr of em1 to a different address to avoid conflicts.
bonding: bond0: releasing active interface em1
bonding: bond0: Removing slave em2
bonding: bond0: releasing active interface em2
ADDRCONF(NETDEV_UP): bond0: link is not ready
bonding: unable to remove non-existent slave em1 for bond bond0.
bonding: unable to remove non-existent slave em2 for bond bond0.
ADDRCONF(NETDEV_UP): bond0: link is not ready
bonding: bond0: Adding slave em1.
bonding: bond0: Warning: failed to get speed and duplex from em1, assumed to be 100Mb/sec and Full.
bonding: bond0: enslaving em1 as an active interface with an up link.
ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready
bonding: bond0: Adding slave em2.
bonding: bond0: Warning: failed to get speed and duplex from em2, assumed to be 100Mb/sec and Full.
bonding: bond0: enslaving em2 as an active interface with an up link.
bond0: no IPv6 routers present

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[[email protected] bonding]# ethtool em1
Settings for em1:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: d
Link detected: yes

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[[email protected] bonding]# ethtool em2
Settings for em2:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: d
Link detected: yes

+++++++++++++++++++++++++++++++++++++++++++++++

[[email protected] bonding]# ethtool bond0
Settings for bond0:
Link detected: yes

时间: 2024-10-06 19:16:33

centos 6.2 网卡聚合及Cisco交换机链路聚合的相关文章

某虚拟化项目中思科与华为交换机链路聚合互连案例

在今年初的时候,我在实施一个VMware虚拟化项目中,涉及到华为与思科交换机通过"链路聚合"的方式互连,经过咨询华为的技术工程师,问题得以成功解决. 不像某些厂家的售后:我们的产品只支持与我们的产品互连,其他的不提供技术支持.华为售后没有因为我是询问与思科交换机的互连而不告诉我解决方法,而是直接告诉我现成的互连案例,并将案例文档及链接网页发到我邮箱,我通过参考案例解决了项目中碰到的问题.现在项目已经运行几个月,一切正常. 现在就此案例记录下来,同时感谢华为技术支持工程师! (小记:我咨

七厂节目接入,中兴交换机链路聚合配置

需求:从数字电视机房核心交换机引出复用器IP组播信号,将前端节目信号传输至七厂交换机中兴5950,因带宽不够用,需做链路聚合,并通过NSG重新调制输出.中兴5950交换机配置如下: Building configuration... ! ! vlan list 1-3 ! interface vlan 1                     // 创建vlan1,将其加入smartgroup1 ip address 172.30.101.251 255.255.255.0 out_index

思科和华为交换机链路聚合命令对比

思科和华为交换机链路聚合命令对比在本人经历过的项目中,有思科交换机和华为交换机对接,通过链路聚合将两条以上物理线路绑在一起成为一条逻辑线路.因为是两个品牌的交换机,其中的配置不同,稍有差错将聚合不成功导致线路不通,下面列出两个品牌的命令对比.(一) 思科交换机配置命令思科交换机逻辑端口为 Port-channel 物理口所有配置如下,注意哪些是自动跟随逻辑口配置的,哪些是要在物理口上配置的,这些特别容易混淆.通过查看端口配置命令,最后物理端口配置如下:interface GigabitEther

华为交换机---链路聚合

链路聚合简介 链路聚合: 作用: 增加宽带,同事提供链路冗余 LACP模式支持链路备份 灵活多用 手工负载分担模式: 无法自由自定义配置 链路聚合: 手工负载配置所有活动接口都参与数据的转发分担负载流量 二层链路聚合 eth-trunk LACP默认不转发,在一条链路断了才进行转发 三层交换机链路聚合 实验: 交换机交换机链路聚合 解释: 通过 dis stp bri 查看端口状态: DISCARDING 预定端口状态 [阻塞状态] FORWARDING 转发端口状态 [转发状态] 默认 stp

Server 2012 网卡teaming 和 cisco 交换机配置, network card teaming

基本上及时 用 服务器的R720的后面两个端口, Nic3 Nic4 做成一个Teaming 然后插到交换机的端口一和二口:对了 同时记得在端口三插的是R720的IDAC 7 管理端口,不同的vlan: 我的环境是,两个网线插到同一台交换机上:还有一个就是两个网线插到不同的交换机的情形.请参考下面的文章: Windows Server 2012网卡Teaming模式http://www.cnblogs.com/dreamer-fish/p/3483190.html 对于cisco方面的协议可以参

Cisco交换机端口聚合配置

交换机和交换机,交换机和路由器之间的端口速率,不能满足实际的速率,就需要将两个以上的端口绑在一起,实现负载均衡,防止出现单点故障. 1.选择交换机SW2960 进行配置  将f0/1和f0/2端口模式配置成truck #conf terminal                进入特权模式 #interface range fa0/1 – 2   用来绑定一组端口,并进入端口批量配置视图 #switchport mode truck        将图端口这只为truck模式 2. 将fa0/1

交换机链路聚合技术之负载均衡算法原理

HASH表介绍: 在交换机内部,每创建一个聚合组时,底层同时创建对应该聚合组的一个hash表,该表存在于交换芯片上,详情见互联网相关文章. 交换机负载均衡转发原理:虽然底层有了一张HASH表,那么到底是怎么利用这张表的呢?1)工程师设定端口成员与HASH算法,如SIP.DIP.SIP+DIP.SIP+DIP+SP+DP等.2)交换机根据成员生成HASH表,根据算法提取报文中相应内容.3)使用特定HASH值的计算方法,把提取的内容计算出一个10bits的值.4)找到底层HASH表项中该值对应的出端

最近进坑了DCS-3950双层交换机链路聚合配置整理

交换机A上1-2端口对应交换机B上3-4端口 PC1链接交换机A上23端口 PC2链接交换机B上24端口 命令如下: DCS-3950-28C>enDCS-3950-28C#conDCS-3950-28C(config)#hostname switchAswitchA(config)#%Jan 01 00:01:39 2006 %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/2, changed state to DOWN%Ja

链路聚合LACP 配置和结果验证(51cti实验11)

1. 实验线路连接图使用Cisco Packet Tracer6.0 构建拓扑结构图. 2. 实验内容(1) 按图配置各台计算机IP 地址.(2) 参阅教材中内容,完成链路聚合的配置内容,配置要求如图9.14 所示.在各台交换机上使用showrunning-config 和show etherchannel summary 查看链路聚合的配置情况,并使用Ping 指令测试各台计算机之间的连通性. SWA Switch>enable Switch#configure terminal SA(con