By Manny Fernandez

September 2, 2019

Reverse Path Forwarding on Fortigate Firewalls

What is spoofing?  Back in the days of security being on routers via ACLs, we would regularly fool the routers into passing packets by crafting a packet with a SourceIP that lived on the inside of the router. This would fool the router by saying to itself  “Oh this is a packet sourced from the inside, since that packet is coming from the inside and heading to the inside, I guess it is OK to pass it”  When we realized this, we started creating access-lists and assigning them to the outside interface (or whatever the inbound connection was coming from that you wanted to enable anti-spoofing:

1st

In the example above, we would have created an access-list that would block anything coming from 10.1.1.0/24 coming in from 1.1.1.1/24 .  Since a packet would never be coming from the Internet with a 10.1.1.0/24 address.

Fortigates have a method of blocking spoofing attacks known as Reverse Path Forwarding (RFP).  RPF protects against IP Spoofing attacks as well as routing loops. RFP will check the source IP address for a valid route.  The Fortigate will check the first packet only when the session is created.

If you the check fails, the following error will be thrown-up

reverse path check fail, drop

There are two RPF check modes; The default, feasible path (formerly known as loose) and strict.

In Feasible Mode, the packet is accepted as long as there is one active route to the source IP through the incoming interface.

In strict mode, FortiGate checks that the best route to the source IP address is through the incoming interface. The route not only has to be active (as in the case of feasible path mode), but it also has to be the best.

Particularly with Strict Mode, there is a phenomenon where if you have a particular scenario, you can break things.  Here is the scenario:

Strict Mode4

What we are seeing in the picture above is a workstation 10.2.1.10 with a default gateway of 10.2.1.254 on link (1).  As we can see, the Fortigate has a static route to the 10.2.1.0/24 network via 10.1.1.254 on the local switch interface (3) but also has an OSPF route learned from port 3 via 10.3.1.254.  As you know, OSPF has an administrative cost of 110 while the static route has a admin cost of 10.

In this scenario, the workstation will send a packet out to the Internet via its default gateway on (1) since it is its default gateway.  The router 10.2.1.254 will forward the packet to the Fortigate via (5) to 10.3.1.1.  The Fortigate will enter the session coming from its port 3.  When the packet comes back,  the Fortigate will look at the packet and since it has a better route via its static route (cost of 10), the packet will be out of state and considered to have failed the RPF.

The point here is, beware of your networking environment before you enable strict mode for RFP.

If you are controlling your upstream router, you CAN combine the RPF feature on the Fortigate while still having the upstream router config I described in the beginning of this post.

Recent posts

  • If you've spent any time configuring user authentication on... Full Story

  • DNS is one of those technologies that quietly underpins... Full Story

  • BGP issues on FortiGate firewalls usually trace back to... Full Story

  • Every time your laptop talks to your router, a... Full Story

  • If you've spent any time configuring NAT on a... Full Story

  • If you have spent any time configuring firewall policies... Full Story

  • High availability on FortiGate is one of those features... Full Story

  • If you've configured SD-WAN on a FortiGate, you've almost... Full Story

  • FortiLink is the management protocol that turns a FortiSwitch... Full Story

  • FortiSwitches are pretty rock solid from Mean Time Between... Full Story

  • This is a quicky tip.  Have you ever gone... Full Story

  • DNS is one of those quiet pieces of internet... Full Story

  • This article is an updated version of the previous... Full Story

  • You will add ns2 as a secondary (slave) BIND9... Full Story

  • In the process of deploying my lab, I needed... Full Story

  • RFC 8805, used to be known as Self-Correcting IP... Full Story

  • Years back, I wrote an article about certificate pinning. ... Full Story

  • FortiGates have the ability to send alerts to Microsoft... Full Story

  • In this post, I am going to walk through... Full Story

  • Troubleshooting VoIP on a FortiGate can feel like trying... Full Story

  • Prior to FortiOS 7.0, there were three commands to... Full Story

  • In this post, I am going to go over... Full Story

  • What we are going to do:  We are going... Full Story

  • Choosing between FGCP (FortiGate Clustering Protocol) and FGSP (FortiGate... Full Story

  • Creating a VLAN on macOS (The "Pro" Move) A... Full Story

  • This blog post explores the logic behind how macOS... Full Story

  • Pretty Fly for a Wi-Fi Tell My Wi-Fi Love... Full Story

  • Part of my daily gig is creating BoMs (Bill-of-Materials)... Full Story

  • ICMP introduces several security risks, but careful filtering, rate... Full Story

  • The command diag debug application dhcps -1 enables full... Full Story

  • In the world of FortiOS, execute tac report is... Full Story

  • LLDP; What is it The Link Layer Discovery Protocol... Full Story

  • What it actually does When you run diagnose fdsm... Full Story

  • Monkey Bites are bite-sized, high-impact security insights designed for... Full Story

  • I have run macOS in macOS with Parallels but... Full Story

  • Don't be confused with my other FortiNAC posts where... Full Story

  • This is the third session in a multi-part article... Full Story

  • Today I was configuring key-based authentication on a FortiGate... Full Story

  • Netcat, often called the "Swiss Army knife" of networking,... Full Story

  • At its core, IEEE 802.1X is a network layer... Full Story

  • In case you did not see the previous FortiNAC... Full Story

  • This is our 5th session where we are going... Full Story

  • Now that we have Wireshark installed and somewhat configured,... Full Story

  • The Philosophy of Packet Analysis Troubleshooting isn't about looking... Full Story

  • 1. High-Level Overview The FortiGate Wireless Intrusion Detection System... Full Story

  • What MIMO Actually Does Multiple Input, Multiple Output (MIMO)... Full Story

  • A practitioner's tour of the diagnose, test, and fnsysctl... Full Story