Fortinet black logo
7.0.0

Adding a static route for the next-hop gateway

Adding a static route for the next-hop gateway

In addition to the default route, you can use Static Route Templates for any static routes that may be necessary in your environment.

In our example project, we need to specify a next-hop gateway for the MPLS underlay transport, since it does not have a DHCP server. On every site, we will add a static route towards the entire MPLS underlay network through the right next-hop gateway.

Because the next-hop gateway is site-specific, it will be different on each site. When we were discussing the Jinja CLI Templates, we saw how to deal with site-specific information by using a per-device meta field (which is a variable). Meta fields are used to define the IP address of the MPLS underlay interface on each FortiGate device by using the mpls_wan_ip meta field. For details, see Example project template.

We will use a similar approach for the next-hop gateway because static route templates support meta fields.

Following is a summary of the tasks to complete for our example project:

  1. Create a meta field for the MPLS gateway. See Creating a meta field.
  2. Edit the static route template to add another route. See Adding a static route .

Creating a meta field

To create a meta field for the MPLS gateway:
  1. In System Settings, go to Advanced > Meta Fields, and create a new optional Device meta field called mpls_wan_gateway:

Adding a static route

To edit the static route template and add another route:
  1. In Device Manager, on the Provisioning Templates > Static Route Templates pane, double-click the static route template to open it for editing.

  2. Click Create New, and set Type to IPv4.

  3. Set Destination to Subnet.

  4. In the Gateway Address field specify the meta field created at the previous step:

  5. Click OK to save the static route.

Adding a static route for the next-hop gateway

In addition to the default route, you can use Static Route Templates for any static routes that may be necessary in your environment.

In our example project, we need to specify a next-hop gateway for the MPLS underlay transport, since it does not have a DHCP server. On every site, we will add a static route towards the entire MPLS underlay network through the right next-hop gateway.

Because the next-hop gateway is site-specific, it will be different on each site. When we were discussing the Jinja CLI Templates, we saw how to deal with site-specific information by using a per-device meta field (which is a variable). Meta fields are used to define the IP address of the MPLS underlay interface on each FortiGate device by using the mpls_wan_ip meta field. For details, see Example project template.

We will use a similar approach for the next-hop gateway because static route templates support meta fields.

Following is a summary of the tasks to complete for our example project:

  1. Create a meta field for the MPLS gateway. See Creating a meta field.
  2. Edit the static route template to add another route. See Adding a static route .

Creating a meta field

To create a meta field for the MPLS gateway:
  1. In System Settings, go to Advanced > Meta Fields, and create a new optional Device meta field called mpls_wan_gateway:

Adding a static route

To edit the static route template and add another route:
  1. In Device Manager, on the Provisioning Templates > Static Route Templates pane, double-click the static route template to open it for editing.

  2. Click Create New, and set Type to IPv4.

  3. Set Destination to Subnet.

  4. In the Gateway Address field specify the meta field created at the previous step:

  5. Click OK to save the static route.