#Load balancing cu Vyatta 6.1 Ionel Mocanu Load balancing cu Vyatta 6.1 — Ionel Mocanu
Skip to content
 

Load balancing cu Vyatta 6.1

Vyatta suporta balansarea incarcarii traficului de iesire pentru doua sau mai multe interfete.

Pentru balansarea traficului, fisierul de configurare contine:

interfaces {
ethernet eth1 {
address 172.16.40.26/29
duplex auto
hw-id 08:00:27:27:f5:a7
smp_affinity auto
speed auto
}
ethernet eth2 {
address 172.30.4.2/23
duplex auto
hw-id 08:00:27:be:b2:75
smp_affinity auto
speed auto
}
ethernet eth3 {
address 192.168.0.1/24
duplex auto
hw-id 08:00:27:b3:5f:4c
smp_affinity auto
speed auto
}
loopback lo {
}
}
load-balancing {
wan {
interface-health eth1 {
failure-count 2
nexthop 172.16.40.25
success-count 1
test 10 {
resp-time 5
target 172.16.40.25
ttl-limit 1
type ping
}
}
interface-health eth2 {
failure-count 2
nexthop 172.30.4.1
success-count 1
test 10 {
resp-time 5
target 172.30.4.1
ttl-limit 1
type ping
}
}
rule 10 {
inbound-interface eth3
interface eth1 {
weight 1
}
interface eth2 {
weight 1
}
protocol all
}
}
}
protocols {
static {
route 0.0.0.0/0 {
next-hop 172.16.40.25 {
}
next-hop 172.30.4.1 {
}
}
}
}
service {
nat {
rule 10 {
outbound-interface eth1
source {
address 192.168.0.0/24
}
type masquerade
}
rule 20 {
outbound-interface eth2
source {
address 192.168.0.0/24
}
type masquerade
}
}
}

Vyatta asigura redundanta cailor. Daca principala conexiune la Internet nu mai functioneaza, traficul este comutat automat pe o alta conexiune de backup.
Consideram ca in schema de mai sus, eth1 este interfata principala, iar eth2 este interfata de backup. Configuratia realizata pentru load balancing asigura si mecanismul de failover. Daca se urmareste realizarea doar a unei configurari pentru failover, in fisierul de configurare, regula 10 se modifica astfel:

rule 10 {
inbound-interface eth3
interface eth1 {
weight 7
}
interface eth2 {
weight 1
}

Leave a Reply