pirmdiena, 2012. gada 27. februāris

Tīkla karšu apvienošana, pieslēgšana Procurve slēdzim ar statisko LACP maģistrāli.

Angliski nosaukums varētu skanēt sekojoši:
Network interface bonding with Procurve LACP static trunk and VLAN tagging.

Ja serverim ir 2 vai vairāk tīkla kartes, tad varētu būt lietderīgi tās apvienot (NIC bonding, teaming), lai sasniegtu lielāku caurlaides spēju, kā arī nodrošinātu bojājumpiecietību.

Sekojošais tika veikts uz Ubuntu servera un Procurve tīkla slēdža.

Uz servera

Uzstādam ifenslave,  moduli un parametrus.
apt-get install ifenslave 
echo alias bond0 bonding >  /etc/modprobe.d/bonding.conf 
echo options bonding mode=4 miimon=100 >>  /etc/modprobe.d/bonding.conf
Pārbaudām, kā ielādējies bonding modulis:

===== cat /proc/net/bonding/bond0 ======
Ethernet Channel Bonding Driver: v3.2.3 (December 6, 2007)


Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: down
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0


802.3ad info
LACP rate: slow
bond bond0 has no active aggregator
=============================================

Konfigurējam tīkla saskarni bond0, rediģējot failu /etc/network/interfaces:


===== cat /etc/network/interfaces ======
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).


# The loopback network interface
auto lo
iface lo inet loopback


# The primary network interface
auto bond0
iface bond0 inet static
  address 10.0.0.4
netmask 255.255.0.0
gateway 10.0.0.1
post-up ifenslave bond0 eth0 eth1
pre-down ifenslave -d bond0 eth0 eth1
==============================================


Uz Procurve


Tranka izveidošana


Ja nevēlas izmantot VLAN'us, tad var vienkārši salikt visus interesējošos slēdža portus LACP active vai passive(?) modē - un piespraužot konfigurētā servera tīkla portus, autormātiski tiks izveidoti dinamiskie tranki kā Dyn1 u.t.t.. Diemžēl uz dinamiskajiem trankiem nav iespējams uzlikt VLAN marķējumus, tāpēc ir jāveido statiskie tranki:

config t 
trunk 9-10 trk5 lacp

Lai pārbaudītu izveidoto tranku:
show lacp
....

                           LACP


   PORT   LACP      TRUNK     PORT      LACP      LACP
   NUMB   ENABLED   GROUP     STATUS    PARTNER   STATUS
   ----   -------   -------   -------   -------   -------
   9      Active    Trk5      Down      No        Success
   10     Active    Trk5      Down      No        Success


VLAN'a pieslēgšana


Tos pieslēdz kā parasti, bet slēdža porta vietā jānorāda Trk5, piem.,:

vlan 8 tagged Trk5

Servera pieslēgšana trankam

Serveri pārslēgt no viena vada pieslēguma uz LACP tranku iespējams "hotswap" režīmā:

1. Pieslēdzam tīkla vadu no līdz šim neizmantotās tīkla saskarnes (piem., eth1)  Trk5 portam (piem. 10)
2. Uz servera apturam darbojošos esošo tīkla saskarni eth0 un uzreiz startējam bond0 -
 ifconfig eth0 down
 ifconfig bond0 up
3. Pēc 1-2 sekunžu pātraukuma sāk darboties bond0 tīkla saskarne
4. Pārslēdzam arī līdz šim izmantotās tīkla saskarnes (eth0)  uz jauno tranku (9. tīkla slēdža portam).

Kad serveris pieslēgts:


==== cat /proc/net/bonding/bond0  =====
Ethernet Channel Bonding Driver: v3.2.3 (December 6, 2007)


Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0


802.3ad info
LACP rate: slow
Active Aggregator Info:
Aggregator ID: 2
Number of ports: 2
Actor Key: 17
Partner Key: 289
Partner Mac Address: 00:1f:fe:1f:92:c0


Slave Interface: eth0
MII Status: up
Link Failure Count: 5
Permanent HW addr: 00:15:17:5e:d8:34
Aggregator ID: 2


Slave Interface: eth1
MII Status: up
Link Failure Count: 2
Permanent HW addr: 00:15:17:5e:d8:35
Aggregator ID: 2
========================================