Vyatta 6 – Load balancing

                                                                                      ________
                                                              +--------------+       /
                                                              | 93.155.130.1 |      |
   		        	             +----------------+  Provider 1  +-------
        __                                   | eth0           |              |     /
    ___/  \_                          +------+----------+     +--------------+    |
  _/        \__                       |  93.155.130.11  |                        /
 /             \   192.168.100.1 eth2 |                 |                        |
| Local network ----------------------+  Vyatta router  |                        |     Internet
 \           __/                      |                 |                        |
   \__     __/                        |  172.16.10.254  |                        \
      \___/                           +------+----------+     +--------------+    |
                                             | eth1           | 172.16.10.1  |     \
                                             +----------------+  Provider 2  +-------
                                                              |              |       |
                                                              +--------------+        \________
set interfaces ethernet eth0 address 93.155.130.11/28
set interfaces ethernet eth1 address 172.16.10.254/24
set interfaces ethernet eth2 address 192.168.100.1/24
 
set protocols static route 0.0.0.0/0 next-hop 93.155.130.1
set protocols static route 0.0.0.0/0 next-hop 172.16.10.1
 
set service nat rule 1 source address 192.168.100.0/24
set service nat rule 1 outbound-interface eth0
set service nat rule 1 type masquerade
 
set service nat rule 2 source address 192.168.100.0/24
set service nat rule 2 outbound-interface eth1
set service nat rule 2 type masquerade
 
set load-balancing wan interface-health eth0 failure-count 2
set load-balancing wan interface-health eth0 nexthop 93.155.130.1
set load-balancing wan interface-health eth0 test 10 ping
set load-balancing wan interface-health eth0 test 10 target 93.155.130.1
 
set load-balancing wan interface-health eth1 failure-count 2
set load-balancing wan interface-health eth1 nexthop 172.16.10.1
set load-balancing wan interface-health eth1 test 10 ping
set load-balancing wan interface-health eth1 test 10 target 172.16.10.1
 
set load-balancing wan rule 10 inbound-interface eth2
set load-balancing wan rule 10 interface eth0
set load-balancing wan rule 10 interface eth1
 
vyatta@vyatta# show load-balancing
 wan {
     interface-health eth0 {
         failure-count 2
         nexthop 93.155.130.1
         test 10 {
             ping
             target 93.155.130.1
         }
     }
     interface-health eth1 {
         failure-count 2
         nexthop 172.16.10.1
         test 10 {
             ping
             target 172.16.10.1
         }
     }
     rule 10 {
         inbound-interface eth2
         interface eth0 {
         }
         interface eth1 {
         }
     }
 }
[edit]
 
vyatta@vyatta# run show wan-load-balance
Interface:  eth0
  Status:  active
  Last Status Change:  Wed Feb 17 21:28:42 2010
  +Test:  ping  Target:  93.155.130.1
    Last Interface Success:  0s
    Last Interface Failure:  n/a
    # Interface Failure(s):  0
 
Interface:  eth1
  Status:  active
  Last Status Change:  Wed Feb 17 21:28:42 2010
  +Test:  ping  Target:  172.16.10.1
    Last Interface Success:  0s
    Last Interface Failure:  n/a
    # Interface Failure(s):  0
 
[edit]
 
vyatta@vyatta# run show wan-load-balance connection
Type    State           Src                     Dst                     Packets Bytes
udp                     192.168.100.2:3567      95.42.44.41:21676       95.42.44.41     172.16.10.254
udp                     192.168.100.2:6306      77.85.162.25:59323      77.85.162.25    172.16.10.254
tcp     TIME_WAIT       192.168.100.2:4971      67.215.233.130:80       67.215.233.130  93.155.130.11
udp                     192.168.100.2:5356      65.55.158.118:3544      65.55.158.118   93.155.130.11
udp                     192.168.100.2:5356      172.16.10.12:59323      172.16.10.12    172.16.10.254
                        :               :
udp                     192.168.100.2:5356      79.103.207.228:648      79.103.207.228  172.16.10.254
tcp     TIME_WAIT       192.168.100.2:4971      95.42.44.41:21676       95.42.44.41     172.16.10.254
udp                     192.168.100.2:5356      77.85.162.25:59323      77.85.162.25    93.155.130.11
udp                     192.168.100.2:5356      83.228.15.175:5921      83.228.15.175   93.155.130.11
udp                     192.168.100.2:3567      92.247.225.227:646      92.247.225.227  172.16.10.254
[edit]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.