Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
Ipfixe
New Contributor

Script to automate routing

Helo ,

 

First of all, excuse me for my English which is not very good, I am basic French.

 

I have a FortiGate 30E, with an ISP Box as WAN access. Connected to this FortiGate I have a Cisco router that has a 4G connection.

Today, I pass all my Internet traffic via a route to the ISP box. But if there is a problem with the operator, I no longer have Internet. So I have to manually deactivate the route to the ISP box and activate the route to the 4G router. And vice versa when the signal from the box returns.

 

I would therefore like to automate this task, namely: When the FortiGate can no longer reach the IP 192.168.1.1 of the ISP box, it automatically deactivates the route to this address, and activates the one to 10.3.0.1 which is the address of the 4G router.

 

I already know how to deactivate or activate the good routes in CLI, I no longer lack a functional script to automate my principle.

Thank you in advance for your help.

 

Ipfixe

1 REPLY 1
Toshi_Esumi
SuperUser
SuperUser

I'm assuming both are either DHCP or PPPoE. Then one way to do it is...

 1) disable defaultgw injection and set a staic default route on both interfaces like below KB but set higher distance on the 4G interface, or set higher priority value (lower priority) for the default route to the 4G side: https://kb.fortinet.com/kb/documentLink.do?externalID=FD48900

 2) set a link-monitor to monitor the primary circuit then remove the static routes, including the default route, toward the primary when it detected a connection down.

You can find many articles for the link-monitor how-to in internet search.

Labels
Top Kudoed Authors