
Linux Bonding Switche agregacje
Poniżej opiszę w jaki sposób skonfigurować bonding od strony systemu operacyjnego na przykładzie RHEL do switchy Cisco, Juniper oraz HP z wykożytaniem LACP, oraz konfigurację samych switchy.
Konfiguracja RHEL
załadowanie modułu odpowiedzialnego za bonding w RHEL
1 2 3 |
# modprobe --first-time bonding |
Sprawdzenie możliwości bondingu:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# modinfo bonding filename: /lib/modules/2.6.32-504.el6.x86_64/kernel/drivers/net/bonding/bonding.ko author: Thomas Davis, tadavis@lbl.gov and many others description: Ethernet Channel Bonding Driver, v3.6.0 version: 3.6.0 license: GPL srcversion: 332968C1FF133A42ED33D6B depends: 8021q,ipv6 vermagic: 2.6.32-504.el6.x86_64 SMP mod_unload modversions parm: max_bonds:Max number of bonded devices (int) parm: tx_queues:Max number of transmit queues (default = 16) (int) parm: num_grat_arp:Number of gratuitous ARP packets to send on failover event (int) parm: num_unsol_na:Number of unsolicited IPv6 Neighbor Advertisements packets to send on failover event (int) parm: miimon:Link check interval in milliseconds (int) parm: updelay:Delay before considering link up, in milliseconds (int) parm: downdelay:Delay before considering link down, in milliseconds (int) parm: use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default) (int) parm: mode:Mode of operation; 0 for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp) parm: primary:Primary network device to use (charp) parm: primary_reselect:Reselect primary slave once it comes up; 0 for always (default), 1 for only if speed of primary is better, 2 for only on active slave failure (charp) parm: lacp_rate:LACPDU tx rate to request from 802.3ad partner; 0 for slow, 1 for fast (charp) parm: ad_select:803.ad aggregation selection logic; 0 for stable (default), 1 for bandwidth, 2 for count (charp) parm: xmit_hash_policy:balance-xor and 802.3ad hashing method; 0 for layer 2 (default), 1 for layer 3+4, 2 for layer 2+3 (charp) parm: arp_interval:arp interval in milliseconds (int) parm: arp_ip_target:arp targets in n.n.n.n form (array of charp) parm: arp_validate:validate src/dst of ARP probes; 0 for none (default), 1 for active, 2 for backup, 3 for all (charp) parm: arp_all_targets:fail on any/all arp targets timeout; 0 for any (default), 1 for all (charp) parm: fail_over_mac:For active-backup, do not set all slaves to the same MAC; 0 for none (default), 1 for active, 2 for follow (charp) parm: all_slaves_active:Keep all frames received on an interfaceby setting active flag for all slaves; 0 for never (default), 1 for always. (int) parm: resend_igmp:Number of IGMP membership reports to send on link failure (int) |
Konfiguracja Interfejsów sieciowych, w mym przypadku będzie:
Bond0 – składa się z 2 portu z karty 4 portowej na płycie głównej oraz 2 portu z karty 4 portowej na PCI slot 6
Konfiguracja karty 1
przechodzimy do pliku /etc/sysconfig/network-scripts/ifcfg-em2
1 2 3 |
# vi /etc/sysconfig/network-scripts/ifcfg-em2 |
1 2 3 4 5 6 7 8 |
DEVICE="em2" BOOTPROTO="none" IPV6INIT="no" ONBOOT="yes" MASTER=bond0 SLAVE=yes |
Konfiguracja karty 2
1 2 3 |
vi /etc/sysconfig/network-scripts/ifcfg-p6p2 |
1 2 3 4 5 6 7 8 9 |
DEVICE="p6p2" BOOTPROTO="none" NM_CONTROLLED="yes" ONBOOT="yes" TYPE="Ethernet" MASTER=bond0 SLAVE=yes |
Konfiguracja bond0 w trybie lacp:
1 2 3 |
# vi /etc/sysconfig/network-scripts/ifcfg-bond0 |
1 2 3 4 5 6 7 8 9 10 |
DEVICE=bond0 IPADDR=10.200.244.30 NETMASK=255.255.248.0 ONBOOT=yes BOOTPROTO=none USERCTL=no BONDING_OPTS="miimon=100 mode=4 lacp_rate=1" GATEWAY=10.200.244.1 |
Konfiguracja Switcha:
Cisco Catalist 4500x w konfiguraacji VSS:
1 2 3 4 5 6 |
interface Port-channel1 description Server1 switchport switchport access vlan 200 |
1 2 3 4 5 6 |
interface TenGigabitEthernet1/1/9 description Server1_em2 switchport access vlan 200 channel-group 1 mode active |
1 2 3 4 5 6 |
interface TenGigabitEthernet2/1/9 description Server1_p6p2 switchport access vlan 200 channel-group 1 mode active |
Cisco Nexus 5k porty które należą do FEX’a który jest skonfigurowany w vPC
Nexus1
1 2 3 4 5 6 7 8 |
interface port-channel29 description Server01-Bond0 switchport access vlan 200 spanning-tree port type edge speed 1000 vpc 29 |
1 2 3 4 5 6 7 8 9 |
interface Ethernet101/1/3 description Server1_em2 switchport access vlan 200 spanning-tree port type edge speed 1000 logging event port link-status channel-group 29 mode active |
Nexus2
1 2 3 4 5 6 7 8 |
interface port-channel29 description Server1_bond0 switchport access vlan 200 spanning-tree port type edge speed 1000 vpc 29 |
1 2 3 4 5 6 7 8 9 |
interface Ethernet101/1/3 description Server1_p6p2 switchport access vlan 200 spanning-tree port type edge speed 1000 logging event port link-status channel-group 29 mode active |
Juniper EX:
Jeżeli jeszcze nie tworzyliśmy interfejsów ae na switchu EX musimy, zdefiniować ile interfejsów ae ma być widoczne na urządzeniu, w tym przypadku
1 2 3 |
# set chassis aggregated-devices ethernet device-count 2 |
definiujemy interfejs ae z lacp:
1 2 3 4 5 6 |
set interface ae0 description Server1_bond0 set interface ae0.0 family ethernet-switching port-mode access set interface ae0.0 family ethernet-switching vlan members vlan200 set interface ae0 aggregated-ether-options lacp active |
dodajemy interfejsy do ae0
1 2 3 4 |
set interface xe-0/1/0 description Serwer1_em2 set interface xe-0/1/0 ether-options 802.3ad ae0 |
1 2 3 4 |
set interface xe-1/1/0 description Serwer1_p6p2 set interface xe-1/1/0 ether-options 802.3ad ae0 |
na koniec wykonujemy commit:
1 2 3 4 5 6 7 8 9 |
# commit fpc0: configuration check succeeds fpc1: commit complete fpc0: commit complete |
HP:
Tworzymy interfejs trk z przypisanie portów:
1 2 3 |
trunk A7-A8 trk10 lacp |
dajemy opis portów
1 2 3 |
interface A7 name "Server1_em2" |
1 2 3 |
interface A8 name "Server1_p6p2" |
przypisujemy interfejs trk10 do vlanu 200 w trybie access
1 2 3 |
vlan 4 untagged trk10 |