Hello,
I have a question concerning OSPF with access-list and route-map.
It has to filter permit 192.168.0.0/16 and deny any.
When using an access-list, it works. When using a route-map it doesn't.
Here is part of the configuration:
FGT (ospf) # show
config router ospf
  set distribute-list-in "access-list-01"
  config area
  edit 0.0.0.0
  next
  edit 0.0.0.1
  next
end
config network
  edit 1
    set prefix 10.0.242.0 255.255.255.0
  next
  edit 2
    set prefix 10.99.12.0 255.255.255.0
    set area 0.0.0.1
  next
end
.......
FGT (ospf) # show
config router ospf
  set distribute-route-map-in "route-map-01"
  config area
  edit 0.0.0.0
  next
  edit 0.0.0.1
  next
end
config network
  edit 1
    set prefix 10.0.242.0 255.255.255.0
  next
  edit 2
    set prefix 10.99.12.0 255.255.255.0
    set area 0.0.0.1
  next
end
.......
FGT (access-list-01) # show
config router access-list
  edit "access-list-01"
  config rule
    edit 3
    set prefix 192.168.0.0 255.255.0.0
  next
  edit 5
    set action deny
    set prefix any
  next
  end
next
end
FGT (route-map) # show
config router route-map
  edit "route-map-01"
    config rule
      edit 1
        set match-ip-address "access-list-01"
        .......
     next
  end
next
end
What do I have to change to work it with route-maps?
Kind regards,
Philip
Hi @philip_nl ,
Please check this article:
Note: The distribute-route-map-in feature to filter routes in OSPF, is useful only in case filter LSA type 5 (External) routes or matching the TAG value needs to be done.
You may also check this article:
Hello,
Thanks for the reply.
Only in case filter LSA type 5.
I will study the provided links.
Thanks,
Philip
Hi @philip_nl ,
In general,
1) If you want to filter external routes, you can use distribute-route-map-in with route map;
2) Otherwise, you may have to use one of the following:
2.1) distribute-list-in with access list (using prefix)
or
2.2) Using "set routemap" under "config redistribute"
By the way, distribute-list-in is mainly for inbound route filtering, and "set route map" under "config redistribute" is mainly for outbound route filtering.
Thanks Jerry
| User | Count | 
|---|---|
| 2727 | |
| 1416 | |
| 810 | |
| 738 | |
| 455 | 
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.