Skip to main content
arie_arie
Explorer II
June 11, 2024
Solved

Redistribute iBGP routes to OSPF in FortiGate

  • June 11, 2024
  • 8 replies
  • 4348 views

Hi,

I need to know whether iBGP routes that learnt in FortiGate can be redistributed to OSPF by default or not?

Because in other router like Cisco, iBGP can't be redistributed to OSPF by default, it needs command like 'bgp redistribute-internal'

 

Thank you

Best answer by srajeswaran

You are fast, I just did this test and confirmed the same :)

 

image.png

 

image.png

8 replies

HarshChavda
Staff
Staff
June 11, 2024
arie_arie
arie_arieAuthor
Explorer II
June 12, 2024

Hi,

In FortiGate, by default, the iBGP can redistribute to OSPF by using route-map and redistribute config, is it correct?

 

Thanks

Toshi_Esumi
SuperUser
SuperUser
June 12, 2024

I was not sure about this either and I couldn't find any documentation as well. So, I decided to test it myself.
I set up three FGTs and one side is iBGP peering and the other side is OSFP peering and, of course, the middle one is redistributing from iBGP to OSPF. The config snippet at the middle FGT is below. 192.168.150.0/24 is advertised from iBGP neighbor. So I set a filter to allow only this prefix to be redistributed to OSPF side.

config router bgp
  set as 64512
  set router-id 10.10.1.2
  config neighbor
    edit "10.10.1.1"
      set next-hop-self enable
      set soft-reconfiguration enable
      set remote-as 64512
    next
  end
<snip>
end

config router ospf
  set router-id 10.10.11.2
  config area

    edit 0.0.0.0
    next
  end
  config network
    edit 1
      set prefix 10.10.11.0 255.255.255.252
    next
  end
  <snip>
  config redistribute "bgp"
    set status enable
    set routemap "allow_192_168_150_only"
  end
  <snip>
end

 

The result was below:
<both at ASBR FGT and OSPF neighbor FGT>

FortiGate-60E # get router info ospf database brief

                OSPF Router with ID (10.10.11.2) (Process ID 0, VRF 0)

                   Router Link States (Area 0.0.0.0)

Link ID       ADV Router Age  Seq#        CkSum Flag Link count
10.10.11.1 10.10.11.1   748   80000005 e1e9    0012 1
10.10.11.2 10.10.11.2   1565 80000006 dde9    0021 1

                  Net Link States (Area 0.0.0.0)

Link ID       ADV Router Age   Seq#        CkSum Flag
10.10.11.2 10.10.11.2    1538 80000002 7365    0031

                  AS External Link States

Link ID           ADV Router Age Seq#         CkSum Flag Route                       Tag
10.253.240.0 10.10.11.1   1168 80000002 3786    0012 E2 10.253.240.0/20 0
192.168.1.0 10.10.11.1     98     80000002 8ab2    0012 E2 192.168.1.0/24   0
192.168.150.0 10.10.11.2 1565 80000001 198e    0021 E2 192.168.150.0/24 0

Conclusion:
iBGP learned routes are redistributed to OSPF side without any special command to allow, which is the case for Cisco. (Juniper's route redistribution is always going through RIB, not directly from iBGP to OSPF, so it wouldn't apply).

Toshi

srajeswaran
Staff
Staff
June 12, 2024

You are fast, I just did this test and confirmed the same :)

 

image.png

 

image.png

Toshi_Esumi
SuperUser
SuperUser
June 12, 2024

haha, @srajeswaran, you're sooo slow.
It's interesting to find a FGT's behavior is different from Cisco's. For routing, FortiOS is almost strictly copied from Cisco IOS including the command line details.

Toshi

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!