- 论坛徽章:
- 0
|
各位好!
一:我现在遇到的问题是:
1:绑成的虚拟网卡(bond0:10.10.2.83/16)ping 的时候丢包
2:我拔第一个网口em1是通的,然后把em1拔掉,em2放上去,第二个网口是不通的
二:先给大家介绍下我的硬件和软件环境:
1:服务器:Dell PE C6200(DELL云产品),一个C6200有四台服务器,一台服务器有两个网口,其中有第一个口(em1)第二个口(em2)做链路聚合
Dell 核心交换机:Force 10 E 1200i
2:OS:Centos 6.2 内核版本是:
Linux C6200_03 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux
网络参数:
我的笔记本(测试虚拟bond0的机器):10.10.8.202/16
测试服务器:C6100其中一台服务器bond0:10.10.2.83/16
三:交换机和HOST配置如下:
1:交换机的配置如下:
动态聚合:配置完成后,一条链路是shutdown
静态聚合:配置完成后,链路OK,协议OK,portchannel 也是OK,但有丢包的现象
2:Host配置如下:
由于需要将两块网卡进行绑定,以下记录其操作步骤:
1)建立channel bonding interface
#vi /etc/sysconfig/network-scripts/ifcfg-bond0
输入下面内容
DEVICE=bond0
BOOTPROTO=none
IPADDR=10.10.2.83
NETMASK=255.255.0.0
ONBOOT=yes
USERCTL=no
修改网卡em1配置
DEVICE="em1"
BOOTPROTO=none
ONBOOT="no"
MASTER=bond0
SLAVE=yes
USERCTL=no
修改网卡em2配置
DEVICE="em2"
BOOTPROTO=none
ONBOOT="no"
MASTER=bond0
SLAVE=yes
USERCTL=no
2)编辑/etc/modprobe.d/
在/etc/modprobe.d/下新建bond0.conf文件,添加以下内容
#vi /etc/modprobe.d/bond0.conf
alias bond0 bonding
3)配置mode=0
#echo 0 > /sys/class/net/bond0/bonding/mode
#ifconfig bond0 up
#modprobe -a bonding
#service network restart
关于mode共有0-6等7种模式,详细请参考官方手册!
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
四:主机show 下来的信息供大家参考:
[root@C6200_03 ~]# ifconfig
bond0 Link encap:Ethernet HWaddr 18:03:73:FF:8D:08
inet addr:10.10.2.83 Bcast:10.10.255.255 Mask:255.255.0.0
inet6 addr: fe80::1a03:73ff:feff:8d08/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:537493574 errors:0 dropped:0 overruns:73 frame:0
TX packets:126793 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:258641520460 (240.8 GiB) TX bytes:6087655 (5.8 MiB)
em1 Link encap:Ethernet HWaddr 18:03:73:FF:8D:08
inet addr:10.10.2.83 Bcast:10.10.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:268754210 errors:0 dropped:0 overruns:34 frame:0
TX packets:63432 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:129323046907 (120.4 GiB) TX bytes:3052339 (2.9 MiB)
Memory:91120000-91140000
em2 Link encap:Ethernet HWaddr 18:03:73:FF:8D:09
inet addr:10.10.2.83 Bcast:10.10.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:268739364 errors:0 dropped:0 overruns:39 frame:0
TX packets:63361 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:129318473553 (120.4 GiB) TX bytes:3035316 (2.8 MiB)
Memory:91100000-91120000
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:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1592 (1.5 KiB) TX bytes:1592 (1.5 KiB)
[root@C6200_03 Desktop]# more /etc/net/bonding/bond0
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: em1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 18:03:73:ff:8d:08
Slave queue ID: 0
Slave Interface: em2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 18:03:73:ff:8d:09
Slave queue ID: 0
[root@C6200_03 Desktop]# dmesg |grep bond0
ADDRCONF(NETDEV_UP): bond0: link is not ready
bonding: bond0: Adding slave em1.
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: enslaving em2 as an active interface with an up link.
bond0: IPv6 duplicate address 2001:cc0:a012:8001:1a03:73ff:feff:8d08 detected!
8021q: adding VLAN 0 to HW filter on device bond0
[root@C6200_03 Desktop]# 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: pumbg
Wake-on: g
Current message level: 0x00000003 (3)
Link detected: yes
[root@C6200_03 Desktop]# 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: pumbg
Wake-on: g
Current message level: 0x00000003 (3)
Link detected: yes
[root@C6200_03 Desktop]# ethtool bond0
Settings for bond0:
Link detected: yes
|
|