为了账号安全,请及时绑定邮箱和手机立即绑定

AIX多网卡绑定

标签:
运维

AIX操作系统中,用户可以配置多个EtherChannel(网卡绑定)。在AIX 5.2之前,我们要么只能选择active/active EtherChannel模式,要么,只能选择active/standby EtherChannel模式的绑定网卡。所以,AIX 5.2中引入了新的网卡后备模式,用户可以为整个EtherChannel指定一块备份网卡,当整个EtherChannel失效时,这块网卡会自动顶替EtherChannel的功能。这与AIX 5.2之前的EtherChannel网卡备份模式有很大区别,因此,在5.2以后可以出现更为复杂的复合网卡绑定模式。

 

一个EtherChannel中可以有28块网卡,一个AIX操作系统中可以配置多个EtherChannel。但要记住每个EtherChannel都是一个新的以太网接口,用户也许需要通过no命令调整ifsize参数的值来保证以太网卡和EtherChannel的总数不超过ifsizeifsize的默认值是8

您可以使用任何AIX系统支持的网卡来组建EtherChannel。但EtherChannel的同一个通道成员网卡必须连接到支持EtherChannel的交换机上,备用通道可以接入到另外一个交换机,用于主通道的失败接管。EtherChannel的所有成员网卡都应该设置成同样的速度和工作模式,如1000兆全双工。要用作EtherChannel成员的网卡不能配置IP地址,如果已经配置了,必须要在开始配置EtherChannel前删除这些配置。

 

Aix5.2以后,我们看看三种典型的配置方式

1、双通道或者多通道的共同active模式,这个模式下,所有的网卡都处于active状态,也就是每个网卡都处于工作状态,他们共有一个IP地址与MAC地址,但是,所有网卡的目标必须在同一个交换机上,并且交换机的对应端口也要绑定。

这样做最大的好处就是,当其中一个网卡失效,或者一根网线失效的时候,不影响整个网络的工作,只有当所有的网卡通道失效的时候,网络才失效。而且,多个网卡的同时工作,可以增加网络带宽,不过,要注意,默认的分配方式是根据目标机器的Ip来分配使用哪个网卡,如果目标机器只有一台,不适合使用默认设置。这种模式下,最大的问题就是所有的网卡目标必须在同一个交换机上,并且绑定在一起,不能防止目标交换机故障。

2active/standby模式,这样的模式下,一个网卡接到主交换机,一个网卡接到备用交换机,当active通道失效的时候,自动切换到standby通道,当主通道恢复正常的时候,再自动切换到主通道(这里是否切换回去,是可以配置的)。这种方式最大的好处就是可以防止交换机的故障。

3、复合式配置,在这种配置中,结合以上2种方式的优点。如一个3块网卡的环境中,我们可以把其中2片网卡配置成双active模式,以增加网络带宽以及网络的可靠性,另外一块网卡作为后备模式,接在另外一个交换机上,当前面2个网卡都失效,或者前面2个网卡接的交换机失效的时候,切换到后备网卡上。如图:

 

下面,我们介绍一下详细的步骤:

如果想绑定或者取消绑定,可以用smit etherchannel完成,如要绑定ent1ent2则:。

#chdev -l en1 -a netaddr=” -a netmask=”

#chdev -l en2 -a netaddr=” -a netmask=”

#chdev -l en1 -a state=’detach’

#chdev -l en2 -a state=’detach’

注意:以上命令是必要的,子网卡先取消现有的IP地址,以及一定要处于detach状态,注意,如果通过en1或者en2连接到主机,操作以上的命令,你的网络可能马上就被中断了,所以,以上的操作建议通过其它网卡完成,或者在HMC上完成。然后,我们开始绑定

#smit etherchannel

选择

Add An EtherChannel / Link Aggregation

在这里选择网卡

EtherChannel / Link Aggregation Adapters ent1,ent2

回车执行:

    Command: OK            stdout: yes           stderr: no

    Before command completion, additional instructions may appear below.

    ent4 Available

最后会提示新的网卡的生成,这个网卡就是可用的绑定过之后的网卡。可用lsattr查看其属性或者是lsdev -Cc adapter看所有网卡属性。

#lsattr -El ent4

    adapter_names   ent1,ent2      EtherChannel Adapters                     True

    alt_addr        0x000000000000 Alternate EtherChannel Address            True

    auto_recovery   yes            Enable automatic recovery after failover  True

    backup_adapter  NONE           Adapter used when whole channel fails     True

    hash_mode       default        Determines how outgoing adapter is chosen True

    mode            standard       EtherChannel mode of operation            True

    netaddr                        Address to ping                           True

    num_retries     3              Times to retry ping before failing        True

    retry_time      1              Wait time (in seconds) between pings      True

    use_alt_addr    no             Enable Alternate EtherChannel Address     True

    use_jumbo_frame no             Enable Gigabit Ethernet Jumbo Frames      True

这样绑定的网卡是双通路的,就是说两个网卡都是处于活动状态,注意,这里还需要交换机配合才可以最终接通2块网卡,网络交换机的设置,可以联系你们的系统管理员

我们也可以设置备用网卡,平常并不活动,处于备用接管状态,如果主通道发生问题,则切换到备用通道,这样的话,则可以接到两个不同的交换机上用于交换机冗余。

备用网卡就是上面的backup_adapter,可以通过

#smit chgethch

或者是

#smit etherchannel

选择

Change / Show Characteristics of an EtherChannel / Link Aggregation

再选择

Add Backup Adapter来完成。增加过后备网卡的绑定网卡,对比以上,将有如下的差别:

#lsattr -El ent4

    adapter_names   ent1,ent2      EtherChannel Adapters                     True

    alt_addr        0x000000000000 Alternate EtherChannel Address            True

    auto_recovery   yes            Enable automatic recovery after failover  True

    backup_adapter  ent3           Adapter used when whole channel fails     True

    hash_mode       default        Determines how outgoing adapter is chosen True

    mode            standard       EtherChannel mode of operation            True

    netaddr                        Address to ping                           True

    num_retries     3              Times to retry ping before failing        True

    retry_time      1              Wait time (in seconds) between pings      True

    use_alt_addr    no             Enable Alternate EtherChannel Address     True

    use_jumbo_frame no             Enable Gigabit Ethernet Jumbo Frames      True

至于网卡的工作状态,还可以通过netstat -v查看,如:

#netstat -v ent4

    ETHERNET STATISTICS (ent4) :

    Device Type: EtherChannel

    Hardware Address: 00:14:5e:b7:26:88

    ......

 

    Number of adapters: 3

    Active channel: primary channel

    Operating mode: Standard mode

    Hash mode: Destination IP address

    ......

 

    ETHERNET STATISTICS (ent1) :

    Link Status : Up

    Media Speed Selected: Auto negotiation

    Media Speed Running: 1000 Mbps Full Duplex

    ......

 

    ETHERNET STATISTICS (ent2) :

    Link Status : Up

    Media Speed Selected: Auto negotiation

    Media Speed Running: 1000 Mbps Full Duplex

    ......

 

    Backup adapter - ent3:

    ======================

    Link Status : Up

    Media Speed Selected: Auto negotiation

    Media Speed Running: 1000 Mbps Full Duplex

    ......                                     

 

如果想取消绑定,则同样执行

#smit etherchannel

选择

Remove An EtherChannel / Link Aggregation

选择你需要取消的网卡,如上面的ent4,回车执行

    Command: OK            stdout: yes           stderr: no

    Before command completion, additional instructions may appear below.

    ent4 deleted

如果得到以上的结果,表示绑定取消成功。成功的结果,可以通过lsdev -Cc adapter前后对比获得。

 

 

点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消