User Tools

Site Tools


redundant_routers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
redundant_routers [2023/07/29 18:13] – created bentredundant_routers [2025/09/10 15:54] (current) – [Redundant Routers] bent
Line 3: Line 3:
 {{ :redundancy-1.jpg?400 |}} {{ :redundancy-1.jpg?400 |}}
  
-The virtual router is implented using the keepalived(8) package from the [[https://www.keepalived.org./|Keepalive]] project. Keepalived can do a lot of thingd but I only use the VRRP (Virtual Redundant Router Protocal) part of the package.+The virtual router is implented using the keepalived(8) package from the [[https://www.keepalived.org./|Keepalive]] project. Keepalived can do a lot of things but I only use the VRRP (Virtual Redundant Router Protocal) part of the package.
  
 Nounours is the chosen master router since it has the best connection to the Internet. Gate-rpi is then the backup router. Configuration is done following the guidelines on the [[https://wiki.archlinux.org/title/Keepalived|ArchLinux Wiki]]. Nounours is the chosen master router since it has the best connection to the Internet. Gate-rpi is then the backup router. Configuration is done following the guidelines on the [[https://wiki.archlinux.org/title/Keepalived|ArchLinux Wiki]].
 +
 +The switch between master and backup is only done when the backup has a higher priority than the (previous) master. If Nounours goes down this happens automatically, but mishaps further 'up' in the system,e.g fiber break, cable break etc, are not detected by Nounours. The dilemma is solved by using the monitoring capablilties of keepalived. In this case I use the  [[https://www.redhat.com/sysadmin/advanced-keepalived|'Track script']] facility where I let a script ping the upstream router every so often and when/if the upstream router doesn't reply the router enters the fault state. See the configuration file for details.
  
 Here are the configurations files. On both routers they may be found at /etc/keepalive/keepelive.conf. Here are the configurations files. On both routers they may be found at /etc/keepalive/keepelive.conf.
Line 19: Line 21:
    smtp_connect_timeout 30    smtp_connect_timeout 30
    router_id ROUTER1    router_id ROUTER1
 +   script_user bent
 +   enable_script_security
 +
 +  }
 +  vrrp_script keepalived_check {
 +   script "/usr/local/bin/keepalived_check.sh"
 +   interval 1
 +   timeout 5
 +   rise 3
 +   fall 3
   }   }
   vrrp_instance NET19 {   vrrp_instance NET19 {
Line 34: Line 46:
     }     }
   }   }
 +  track_script { 
 +    keepalived_check 
 +  } 
 +  notify "/usr/local/bin/keepalived_notify.sh"
 ===== Backup Router (Gate-rpi)===== ===== Backup Router (Gate-rpi)=====
  
redundant_routers.1690654391.txt.gz · Last modified: by bent