In short I have been doing a networking lab with route leaking using OSPF. To keep things simple the idea has been to use only BGP and OSPF as dynamical routing protocols. The OSPF redistribution router has 2 OSPF processes and can do mutual redistribution between these two running OSPF processes. The redistribution router has following tasks:
- OSPF process 1 has to pick up the default route from the global routing table and redistribute it into the OSPF process 10, the local routing table
- OSPF process 10 has to pick up OSPF prefixes from the local routing table and redistribute to the global routing table OSPF process 1
Almost all things have worked with mutual redistribution, but the default route redistribution did not work as expected . Redistributing 0.0.0.0/0 did not work with following:
- distribute lists
- prefix-lists
- route-maps
- access-lists
After reading further documentation I have found Ivan's Papelnjak's blog post about this process, and have discovered a additional documentation about OSPF Redistribution among different OSPF processes. At this point the RFC1925 comes to mind paragraph (8) It is more complicated than you think.
A few days a more simpler solution came to my mind. Each routing process advertises the default network route instead of redistributing it. The simpler solution has been to advertise a default route to the local OSPF process with higher OSPF metrics. The default route in the global routing tables has lower OSPF metrics. Interesting has been, which I have not been aware of, IOS tagged routes have their tag still attached after redistribution. The redistribution router has following configuration:
configure terminal
!
!global routing table
!
router ospf 1
router-id 10.255.255.200
auto-cost reference-bandwidth 1000
redistribute ospf 10 subnets
!
!local routing table
!
router ospf 10
router-id 10.0.3.0
auto-cost reference-bandwidth 1000
default-information originate always metric 10000
!
end
The redistribution is done in the global router ospf 1 process. Importing IP OSPF prefixes from router ospf 10 process, using following command:
redistribute ospf 10 subnets
The local ospf process router ospf 10, advertises the default route with the command:
default-information originate always metric 10000
The default route metric in the global routing table is set to 1000 which is a smaller value than metric of 10000. This is what has been configured on the router that is doing route leaking . Leaking routes from the local routing table to the global routing table. This router has 2 separate OSPF processes, and is lacking MPLS/BGP/VRF configuration.
The router that has MPLS/BGP/VRF configuration is directly attache to the mutual redistribution router, uses following router configuration:
configure terminal
!
!local routing table
!
router ospf 10 vrf vpn10
router-id 10.0.3.2
auto-cost reference-bandwidth 1000
redistribute bgp 65001 subnets tag 200
!
!global routing table
!
router ospf 1
router-id 10.255.255.1
auto-cost reference-bandwidth 1000
!
!bgp routing table
!
router bgp 65001
bgp router-id 10.255.255.1
bgp log-neighbor-changes
neighbor 10.255.255.60 remote-as 65001
neighbor 10.255.255.60 update-source Loopback0
neighbor 10.255.255.61 remote-as 65001
neighbor 10.255.255.61 update-source Loopback0
!
address-family ipv4
neighbor 10.255.255.60 activate
neighbor 10.255.255.61 activate
maximum-paths ibgp 4
exit-address-family
!
address-family vpnv4
bgp nexthop trigger delay 0
neighbor 10.255.255.60 activate
neighbor 10.255.255.60 send-community both
neighbor 10.255.255.61 activate
neighbor 10.255.255.61 send-community both
exit-address-family
!
address-family ipv4 vrf vpn10
network 0.0.0.0
exit-address-family
!
end
The default route again is not redistributed from local routing table router ospf 10. The BGP process announces the default route with the command:
address-family ipv4 vrf vpn10
network 0.0.0.0
exit address-family
This way the default route is send to the BGP route reflectors. The BGP route reflectors announce the default route to the BGP route reflector clients.