I have VPN connections from my main router over to several places around the world.
I need to be able to route everything across the VPN.
Easy to maintain (get rid of static routing).
Enable RIP over the EoIP tunnel.
RIP would brake EoIP tunnel because it would send out routing information of the WAN Network.
WAN Network assigned by DHCP (no static IP available).
Use Routing Filter to force not redistribute WAN Network.
If tunnel is down update Filter with new network as it possibly changed IP addresses and or network.
Make a note of the number:
/routing filter add action=reject chain=rip-out disabled=no invert-match=no prefix=xxx.26.xxx.192/30 set-bgp-prepend-path=""
Write script to update and set it up Netwatch
/routing filter print Flags: X - disabled 0 chain=rip-out prefix=18.104.22.168/30 invert-match=no action=reject set-bgp-prepend-path=""
1 name="RIPFix" owner="rviteri" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api last-started=mar/14/2012 04:08:21 run-count=8 source= :local newnetwork [/ip route get [find gateway=ether1-WAN(use the name of your GW)] dst-address] /routing filter set number=0 prefix=$newnetwork; :log info "RIPFix updated to $newnetwork1"
Note: Most likely there is a better way to write this script, however I am not a programmer so if you are and can improve it chime in!
/tool netwatch add disabled=no down-script="/system script run RIPFix" host=(put an ip at the other side of the tunnel) interval=1s timeout=1s up-script=""