Chinaunix首页 | 论坛 | 博客
  • 博客访问: 65536
  • 博文数量: 14
  • 博客积分: 1599
  • 博客等级: 上尉
  • 技术积分: 160
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-13 09:39
文章分类
文章存档

2011年(6)

2010年(4)

2008年(4)

分类:

2010-04-29 22:02:00

sun fire x41xx系列的服务器上有四个GB以太接口,一般我们会选择其中的一个上联到交换机上,这多少让人觉得有些浪费,如何有效的利用这些接口,做到增加带宽 和实现冗余,这是一个不错的主题。经过和北美的系统管理员和网络管理员多次的实践和沟通,终于实现了带宽的冗余和lb的功能。




物理接口

bash-3.00# dladm show-link -p
e1000g0 type=non-vlan mtu=1500 device=e1000g0
e1000g1 type=non-vlan mtu=1500 device=e1000g1
e1000g2 type=non-vlan mtu=1500 device=e1000g2
e1000g3 type=non-vlan mtu=1500 device=e1000g3
e1000g4 type=non-vlan mtu=1500 device=e1000g4
e1000g5 type=non-vlan mtu=1500 device=e1000g5
e1000g6 type=non-vlan mtu=1500 device=e1000g6
e1000g7 type=non-vlan mtu=1500 device=e1000g7
总共有8个接口。
将3,7和2,6分别建立两个名为aggr1和aggr2的冗余上联组。
分别上联到两个物理的交换机上,特别注意的是,不能将一个组的上联连接到不同的物理交换机,实践证明会出现flap。


创建aggr

dladm create-aggr -d e1000g3 -d e1000g7 1

dladm create-aggr -3 e1000g2-d e1000g6 2

显示创建好的aggr

bash-3.00# dladm show-aggr -L
key: 1 (0x0001) policy: L4      address: 0:15:17:d2:9e:1a (auto)
LACP mode: off       LACP timer: short
device    activity timeout aggregatable sync  coll dist defaulted expired
e1000g3   active   short   yes          yes   yes  yes  no        no
e1000g7   active   short   yes          yes   yes  yes  no        no
key: 2 (0x0002) policy: L4      address: 0:15:17:d2:9e:1b (auto)
LACP mode: off       LACP timer: short
device    activity timeout aggregatable sync  coll dist defaulted expired
e1000g2   active   short   yes          yes   yes  yes  no        no
e1000g6   active   short   yes          yes   yes  yes  no        no


修改LACP mode

dladm modify-aggr --lacp-mode=active -P L4 1

dladm modify-aggr --lacp-mode=active -P L4 2

显示

bash-3.00# dladm show-aggr -L
key: 1 (0x0001) policy: L4      address: 0:15:17:d2:9e:1a (auto)
LACP mode: active       LACP timer: short
device    activity timeout aggregatable sync  coll dist defaulted expired
e1000g3   active   short   yes          yes   yes  yes  no        no
e1000g7   active   short   yes          yes   yes  yes  no        no
key: 2 (0x0002) policy: L4      address: 0:15:17:d2:9e:1b (auto)
LACP mode: active       LACP timer: short
device    activity timeout aggregatable sync  coll dist defaulted expired
e1000g2   active   short   yes          yes   yes  yes  no        no
e1000g6   active   short   yes          yes   yes  yes  no        no

这时就已经建立好了两个上联的端口组。

然后在交换机上配置Portchanel

下来是设置ip地址。肯定不能为两个接口都设置地址,那样会引起路由的冲突,一般我们会想到keepalived这样的vrrp的实现,但是在solaris上还有一个更cool的特性---IPMP,

设置ipmp

bash-3.00#ifconfig aggr1 group ipmp 1 up

bash-3.00#ifconfig aggr2 group ipmp 1 standby up

设置好了

bash-3.00# ifconfig aggr1
aggr1: flags=1000843 mtu 1500 index 2
inet 10.3.50.34 netmask fffffe00 broadcast 10.3.51.255
     groupname ipmp1
ether 0:15:17:d2:9e:1a
bash-3.00# ifconfig aggr2
aggr2: flags=69000842 mtu 0 index 4
inet 0.0.0.0 netmask 0
    groupname ipmp1
ether 0:15:17:d2:9e:1b
bash-3.00#

设置hostname

bash-3.00# cat hostname.aggr1
fnd-vm03-apptraffic-aggr1 group ipmp1


bash-3.00# cat hostname.aggr2
group ipmp1 standby up

ok设置完成。


交换机的配置
interface Port-channel11
description VM01-aggr2
switchport access vlan 50
switchport mode access
logging event bundle-status


interface Vlan50
description Public
ip address 10.3.50.2 255.255.254.0
standby 50 ip 10.3.50.1
standby 50 timers 1 2
standby 50 priority 110
standby 50 preempt
standby 50 track GigabitEthernet1/0/1 30

正常情况下会由aggr1提供服务,采用L4负载均衡机制

L4-通过散列每个包的 TCP、UDP 或其他 ULP (L4) 头来确定传出链路。

由2条物理链路提供上行冗余连接。

一旦主交换机故障,辅助交换机会启用,ip会根据ipmp策略由standby状态的aggr接管。主交换机恢复,主aggr恢复。

参考资料

EthernetChannel

IPMP (IP MultiPathing)

LACP(Link Aggregation Control Potocol)

IEEE 802.3

阅读(1295) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~