Fortinet white logo
Fortinet white logo

SD-WAN Deployment for MSSPs

Adding custom CLI Templates

Adding custom CLI Templates

In this example, we want to add NetFlow configuration to our SD-WAN nodes. The required CLI configuration should look like this:

# Configure NetFlow Collector
config system netflow
   set collector-ip <ip>
   set source-ip <ip>
end

# Enable NetFlow Sampler on the LAN interface
config system interface
   edit <lan_intf>
      set netflow-sampler both
   next
end

It might be tempting to simply add this snippet to one of the existing Jinja Templates, but we strongly discourage this approach.

Instead of modifying the Jinja Templates downloaded from our GitHub repository (the "code"), we recommend adding a new CLI Template to the existing CLI Template Group. This way, whenever the "code" in the GitHub repository is updated, you can easily download the updated version, without overriding your custom additions.

Let us create a new Jinja CLI Template (named "10-Edge-Netflow"), reusing the already familiar per-device variables:

# Configure NetFlow Collector
config system netflow
   set collector-ip 10.1.0.13
   set source-ip {{ loopback }}
end

# Enable NetFlow Sampler on the LAN interface
config system interface
   edit {{ lan_interface }}
      set netflow-sampler both
   next
end

We can now add this new template to the existing CLI Template Group named "Edge-Jinja" to apply the NetFlow configuration to all the Spokes:

Adding custom CLI Templates

Adding custom CLI Templates

In this example, we want to add NetFlow configuration to our SD-WAN nodes. The required CLI configuration should look like this:

# Configure NetFlow Collector
config system netflow
   set collector-ip <ip>
   set source-ip <ip>
end

# Enable NetFlow Sampler on the LAN interface
config system interface
   edit <lan_intf>
      set netflow-sampler both
   next
end

It might be tempting to simply add this snippet to one of the existing Jinja Templates, but we strongly discourage this approach.

Instead of modifying the Jinja Templates downloaded from our GitHub repository (the "code"), we recommend adding a new CLI Template to the existing CLI Template Group. This way, whenever the "code" in the GitHub repository is updated, you can easily download the updated version, without overriding your custom additions.

Let us create a new Jinja CLI Template (named "10-Edge-Netflow"), reusing the already familiar per-device variables:

# Configure NetFlow Collector
config system netflow
   set collector-ip 10.1.0.13
   set source-ip {{ loopback }}
end

# Enable NetFlow Sampler on the LAN interface
config system interface
   edit {{ lan_interface }}
      set netflow-sampler both
   next
end

We can now add this new template to the existing CLI Template Group named "Edge-Jinja" to apply the NetFlow configuration to all the Spokes: