Monday, April 22, 2013

Bonding network on linux


bonding card infiniband

bonding 2 card infiniband ib0 và ib1
IP chung là 192.168.10.8

Tạo file ifcfg-bond0

[root@TC-OSB network-scripts]# cat ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.10.8
NETMASK=255.255.255.0
BOOTPROTO=none
USERCTL=no
TYPE=Ethernet
ONBOOT=yes
IPV6INIT=no
BONDING_OPTS="mode=active-backup miimon=100 downdelay=5000 updelay=5000"
[root@TC-OSB network-scripts]#

Sửa file ifcfg-ib0

[root@TC-OSB network-scripts]# cat ifcfg-ib0
# Mellanox Technologies MT26428 [ConnectX VPI PCIe 2.0 5GT/s - IB QDR / 10GigE]
#DEVICE=ib0
#BOOTPROTO=dhcp
#HWADDR=80:00:00:48:FE:80:00:00:00:00:00:00:00:10:E0:00:01:28:C0:05
#ONBOOT=no
#HOTPLUG=no
#DHCP_HOSTNAME=TC-OSB

DEVICE=ib0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
[root@TC-OSB network-scripts]#

Sửa file ifcfg-ib1

[root@TC-OSB network-scripts]# cat ifcfg-ib1
# Mellanox Technologies MT26428 [ConnectX VPI PCIe 2.0 5GT/s - IB QDR / 10GigE]
#DEVICE=ib1
#BOOTPROTO=dhcp
#HWADDR=80:00:00:49:FE:80:00:00:00:00:00:00:00:10:E0:00:01:28:C0:06
#ONBOOT=no
#HOTPLUG=no
#DHCP_HOSTNAME=TC-OSB

DEVICE=ib1
BOOTPROTO=none
ONBOOT=no
MASTER=bond0
SLAVE=yes
USERCTL=no
[root@TC-OSB network-scripts]#

Sửa file /etc/modprobe.conf

Thêm dòng
alias bond0 bonding

[root@TC-OSB network-scripts]# cat /etc/modprobe.conf
alias scsi_hostadapter shpchp
alias eth0 ixgbe
alias eth1 ixgbe
alias eth2 ixgbe
alias eth3 ixgbe
alias scsi_hostadapter1 megaraid_sas
alias scsi_hostadapter2 ahci
alias scsi_hostadapter3 lpfc
alias scsi_hostadapter4 usb-storage

alias bond0 bonding
alias bond1 bonding
[root@TC-OSB network-scripts]#

bonding card ethernet

bonding 2 card infiniband eth0 và eth1
IP chung là 10.224.133.26

Tạo file ifcfg-bond1

[root@TC-OSB network-scripts]# cat ifcfg-bond1
DEVICE=bond1
IPADDR=10.224.133.26
NETMASK=255.255.255.0
GATEWAY=10.224.133.1
USERCTL=no
BOOTPROTO=none
TYPE=Ethernet
ONBOOT=yes
BONDING_OPTS="mode=active-backup miimon=100 downdelay=5000 updelay=5000"
[root@TC-OSB network-scripts]#

Sửa file ifcfg-eth0

[root@TC-OSB network-scripts]# cat ifcfg-eth0
# Intel Corporation Ethernet Controller 10-Gigabit X540-AT2
#DEVICE=eth0
#BOOTPROTO=static
#BROADCAST=10.224.133.255
#HWADDR=00:10:E0:23:F8:82
#IPADDR=10.224.133.26
#NETMASK=255.255.255.0
#NETWORK=10.224.133.0
#ONBOOT=yes

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
# Settings for Bond
MASTER=bond1
SLAVE=yes
[root@TC-OSB network-scripts]#

Sửa file ifcfg-eth1

[root@TC-OSB network-scripts]# cat ifcfg-eth1
# Intel Corporation Ethernet Controller 10-Gigabit X540-AT2
#DEVICE=eth1
#BOOTPROTO=dhcp
#HWADDR=00:10:E0:23:F8:83
#ONBOOT=no
#HOTPLUG=no
#DHCP_HOSTNAME=TC-OSB

DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
# Settings for bonding
MASTER=bond1
SLAVE=yes
[root@TC-OSB network-scripts]#

Sửa file /etc/modprobe.conf

Thêm dòng
alias bond1 bonding

[root@TC-OSB network-scripts]# cat /etc/modprobe.conf
alias scsi_hostadapter shpchp
alias eth0 ixgbe
alias eth1 ixgbe
alias eth2 ixgbe
alias eth3 ixgbe
alias scsi_hostadapter1 megaraid_sas
alias scsi_hostadapter2 ahci
alias scsi_hostadapter3 lpfc
alias scsi_hostadapter4 usb-storage

alias bond0 bonding
alias bond1 bonding
[root@TC-OSB network-scripts]#

Test

Restaret network

[root@TC-OSB ~]# service network restart
Shutting down interface bond0:                             [  OK  ]
Shutting down interface bond1:                             [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface bond0:                               [  OK  ]
Bringing up interface bond1:                               [  OK  ]
[root@TC-OSB ~]#

Kiểm tra bonding infiniband

[root@TC-OSB network-scripts]# cat cat /proc/net/bonding/bond0
cat: cat: No such file or directory
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
Primary Slave: None
Currently Active Slave: ib1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 5000
Down Delay (ms): 5000

Slave Interface: ib0
MII Status: down
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: 80:00:00:48:fe:80
Slave queue ID: 0

Slave Interface: ib1
MII Status: up
Speed: Unknown
Duplex: Unknown
Link Failure Count: 0
Permanent HW addr: 80:00:00:49:fe:80
Slave queue ID: 0
[root@TC-OSB network-scripts]#

Kiểm tra bonding ethernet

[root@TC-OSB network-scripts]# cat cat /proc/net/bonding/bond1
cat: cat: No such file or directory
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 5000
Down Delay (ms): 5000

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:10:e0:23:f8:82
Slave queue ID: 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:10:e0:23:f8:83
Slave queue ID: 0
[root@TC-OSB network-scripts]#


No comments:

Post a Comment