If both OSPF and other routing protocols run on the router, you can configure OSPF to import routes generated by other protocols such as RIP, ISIS, BGP, static routes, and direct routes, and then advertise these routes through Type5 LSA or Type7 LSA.
OSPF can ensure loop-free intra-area routes and inter-area routes; however, OSPF cannot prevent external routes from loops. Therefore, you should be cautious when configuring OSPF to import external routes.
ospf [ process-id ]
import-route { limit limit-number | { bgp [ permit-ibgp ] | direct | unr | rip [ process-id-rip ] | static | isis [ process-id-isis ] | ospf [ process-id-ospf ] } [ cost cost | type type | tag tag | route-policy route-policy-name ] * }
filter-policy { acl-number | ip-prefix ip-prefix-name | route-policy route-policy-name } export [ direct | static | unr | bgp | { rip | isis | ospf } [ process-id ] ]
Only the routes that pass the filtering can be advertised.
You can configure OSPF to filter the routing information of a protocol or a process by specifying the parameter direct, static, unr, bgp, rip [ process-id ], isis [ process-id ], ospf [ process-id ]. If direct, static, unr, bgp, rip [ process-id ], isis [ process-id ], ospf [ process-id ] is not specified, OSPF filters all the imported routing information.