Failover fibre/4g Mikrotik

Démarré par halesk2k, 27 Août 2021 à 09:49:30

« précédent - suivant »

0 Membres et 1 Invité sur ce sujet

Si comme moi, vous utilisez un backup 4G pour fiabiliser votre connexion, je vous partages mon script de failover pour routeur Mikrotik.

https://github.com/loiklo/mikrotik/blob/main/failover-dhcp


Features:
   - main/backup failover with 2 dhcp-client interfaces
   - rely on multiple remote test hosts to decide if the main link is working properly
   - automaticaly add/remove required routes to remote test hosts
   - adjust testHosts routes if the gateway change
   - configurable "ping success rate expected"
   - stop pinging testHosts as soon as the expected rate is reached to avoid unnecessary traffic
   - release DHCP lease in mainInterface on link failure to trigger a renew.
     (This is usefull if the provider change the subnet on its side but our DHCP lease is not expired yet)
   - doesn't need :global variable
   - doesn't need specific configuration other than using dhcp-client on both main/backup interfaces
 
Limitations:
   - hosts in testHosts array can't be reach through backupInterface if mainInterface receive a DHCP lease
   - mainInterface and backupInterface must be configured in dhcp-client
   - Only work with IPv4
Offre: K-Net Pulse 1Gb/s symétrique Sosh 300Mb/s symétrique
Routeur: Mikrotik RB4011
Switch: Netgear GS110TP, Cisco SG200
AP Wi-Fi: Ubiquiti UAP-AC-Lite
Uptime: https://uptime.loiklo.net/