Además veremos la configuración específica de los switches.
Primer servidor con Ubuntu 12.04, vamos a configurar dos bondings y un bridge con 6 interfaces en total (eth0 hasta eth5).
El esquema de conexión es el siguiente:
Necesitamos tener instalados algunos paquetes:
# aptitude install bridge-utils ifenslave-2.6
Modificamos el fichero /etc/network/interfaces:
auto br0
iface br0 inet static
address 192.168.164.21
netmask 255.255.255.0
network 192.168.164.0
broadcast 192.168.164.255
gateway 192.168.164.1
# # dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.100.182 192.168.100.189 192.168.100.183
dns-search rubensalazar.net
bridge_ports eth0 eth1
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp on
Reiniciamos el servicio de red:
# /etc/init.d/networking restart
Podemos comprobar si ha funcionado :
# brctl showLa configuración en los switches es idéntica en los dos, con un show run vemos la configuración de esa interfaz:
bridge name bridge id STP enabled interfaces
br0 8000.001b78976e50 yes eth0
eth1
interface GigabitEthernet0/6
switchport access vlan 7
switchport mode access
spanning-tree portfast
Pasamos a configurar los bondings, añadimos en el fichero /etc/network/interfaces:
auto bond0iface bond0 inet staticslaves eth2 eth3bond_mode 4bond_miimon 100bond_updelay 200bond_downdelay 200address 10.0.1.21netmask 255.255.255.0auto bond1iface bond1 inet staticslaves eth4 eth5bond_mode 4bond_miimon 100bond_updelay 200bond_downdelay 200address 10.0.2.21netmask 255.255.255.0auto eth2iface eth2 inet manualbond-master bond0
auto eth3iface eth3 inet manualbond-master bond0auto eth4iface eth4 inet manualbond-master bond1auto eth5iface eth5 inet manualbond-master bond1
El modo 4 indica el tipo de bonding que configuramos, podéis encontrar más información en:
http://en.wikipedia.org/wiki/Link_Aggregation_Control_Protocol#Link_Aggregation_Control_Protocol
http://systemadmin.es/2009/04/los-modos-de-bonding
Volvemos a reiniciar el servicio de red y comprobamos que funcionan:
# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 200
Down Delay (ms): 200
802.3ad info
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 1
Number of ports: 2
Actor Key: 17
Partner Key: 2
Partner Mac Address: 00:19:e8:e8:02:00
Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:26:55:d8:b5:99
Aggregator ID: 1
Slave queue ID: 0
Slave Interface: eth3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:26:55:d8:b5:9b
Aggregator ID: 1
Slave queue ID: 0
# cat /proc/net/bonding/bond1
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 200
Down Delay (ms): 200
802.3ad info
LACP rate: slow
Min links: 0
Aggregator selection policy (ad_select): stable
Active Aggregator Info:
Aggregator ID: 1
Number of ports: 2
Actor Key: 17
Partner Key: 2
Partner Mac Address: 00:1e:14:db:05:80
Slave Interface: eth4
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:26:55:d8:b5:98
Aggregator ID: 1
Slave queue ID: 0
Slave Interface: eth5
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:26:55:d8:b5:9a
Aggregator ID: 1
Slave queue ID: 0
La configuración de los switches es más compleja, definimos dos port channels, uno por cada red:
interface Port-channel1
switchport access vlan 8
switchport mode access
spanning-tree portfast
!
interface Port-channel2
switchport access vlan 9
switchport mode access
spanning-tree portfast
interface GigabitEthernet0/7
switchport access vlan 8
switchport mode access
channel-group 1 mode active
spanning-tree portfast
!
interface GigabitEthernet0/8
switchport access vlan 8
switchport mode access
channel-group 1 mode active
spanning-tree portfast
!
interface GigabitEthernet0/9
switchport access vlan 9
switchport mode access
channel-group 2 mode active
spanning-tree portfast
!
interface GigabitEthernet0/10
switchport access vlan 9
switchport mode access
channel-group 2 mode active
spanning-tree portfast
