Skip to content

Commit

Permalink
Fix the VRPP configuration so it works correctly (#33)
Browse files Browse the repository at this point in the history
This ensure a few things are fixed:

* Fix incorrect curly brace placement which was causing incorrect
  keepalived configuration on the master.
* Set nopreempt mode on both master and server.
* Setup a vrrp_sync_group.
* Ensure the backup has different virtual_router_id's than the
  master nodes.

Signed-off-by: Kyle Mestery <[email protected]>
  • Loading branch information
mestery authored Dec 18, 2018
1 parent 6a101f5 commit 90b02b0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
11 changes: 10 additions & 1 deletion docker/ha-scale-vpn/startstrongswan1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,21 @@ sudo mv /tmp/ipsec.secrets /etc/ipsec.secrets
# Setup keepalived
cat > /etc/keepalived/keepalived.conf << EOL
! Configuration File for keepalived
vrrp_sync_group VG1 {
group {
VI_1
VI_2
}
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 150
advert_int 1
nopreempt
authentication {
auth_type PASS
auth_pass Vpp123
Expand All @@ -88,13 +96,15 @@ vrrp_instance VI_1 {
${CLUSTERIP}/22 brd 10.122.223.255 dev eth0
}
notify /etc/keepalived/notifyipsec.sh
}
vrrp_instance VI_2 {
state MASTER
interface eth1
virtual_router_id 61
priority 150
advert_int 1
nopreempt
authentication {
auth_type PASS
auth_pass Vpp123
Expand All @@ -103,7 +113,6 @@ vrrp_instance VI_2 {
${VPNCLUSTERIP}/22 brd 10.223.223.255 dev eth1
}
}
}
EOL

cat > /etc/keepalived/notifyipsec.sh << EOL
Expand Down
13 changes: 11 additions & 2 deletions docker/ha-scale-vpn/startstrongswan2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,20 @@ sudo mv /tmp/ipsec.secrets /etc/ipsec.secrets
cat > /etc/keepalived/keepalived.conf << EOL
! Configuration File for keepalived
vrrp_sync_group VG1 {
group {
VI_1
VI_2
}
}
vrrp_instance VI_1 {
state BACKUP
interface eth0
virtual_router_id 51
virtual_router_id 52
priority 100
advert_int 1
nopreempt
authentication {
auth_type PASS
auth_pass Vpp123
Expand All @@ -93,9 +101,10 @@ vrrp_instance VI_1 {
vrrp_instance VI_2 {
state BACKUP
interface eth1
virtual_router_id 61
virtual_router_id 62
priority 100
advert_int 1
nopreempt
authentication {
auth_type PASS
auth_pass Vpp123
Expand Down

0 comments on commit 90b02b0

Please sign in to comment.