One of my readers asked for a working configuration of the conditional OSPF default route advertisment feature. In my scenario, the OSPF default route would be announced whenever an Internet prefix (172.18.0.0/16) would be present in the IP routing table.
router ospf 1
network 0.0.0.0 255.255.255.255 area 0
default-information originate always route-map FromInternet
router bgp 11
neighbor 172.16.1.2 remote-as 21
ip access-list standard FromInternet
route-map FromInternet permit 10
match ip address FromInternet
- The route map configured in the default-information originate command tests the IP prefixes in the IP routing table. You can thus match only on those attributes that are present in the IP routing table (IP prefix, metric, next-hop), not on additional BGP attributes (like AS-path), which would be really cool
- Contrary to what Sebastian wrote in his comment, you don't have to redistribute BGP route into OSPF to make it work in IOS release 12.4(11)T or 12.2SRC, but the IP prefix you test cannot be a subnet.