Keepalived is a routing software written in C. The main goal of this project is to provide simple and robust facilities for loadbalancing and high-availability to Linux system and Linux based infrastructures.

Install Keepalived

1
2
3
sudo apt update
sudo apt install keepalived
sudo apt install libipset13

Edi keepalived config:

1
sudo nano /etc/keepalived/keepalived.conf

Modify the following:

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
vrrp_track_process track_ping {

   process ping
   weight 10
}

vrrp_instance VI_2 {

   state MASTER
   interface eth0
   virtual_router_id 20
   priority 100
   advert_int 1


   authentication {
      auth_type PASS
      auth_pass yfsLhJv9
   }

   track_process {
      trace_ping
   }

   virtual_ipaddress {
      192.168.x.x/24
   }

}