Yesterday we had a customer network migration from IPsec VPN to MPLS. Customer’s headquarter network wanted to be the point of internet sharing so that all branch offices use that point for internet browsing. OSPF was chosen to be the dynamic routing protocol between CE and PE, as ASA is deaf to BGP. We configured everything on CE side and contacted customer’s service provider to check their configuration, everything was fine, but the default route. We had injected a default route at HQ but the branch offices were unable to get that particular 0.0.0.0/0 route through MPLS.
The service provider (DU) told me that OSPF is not able to inject default route from one CE to another CE… and you have to migrate to BGP! what!? It’s not true… I’ve sent them a sample configuration to set on their PE LSRs, now it’s time to explain the problem in detail:
- Customer 1 is injecting default-information via OSPF by “default-information originate” command to the service provider’s PE router.
- Service provider receives LSA type 5 and should “redistribute ospf x vrf Customer1 match external” into MP-BGP to other PE.
- BGP will not redistribute default-information unless we configure “default-information originate” under bgp address-family ipv4 vrf Customer1 (Tricky)
- The other PE receives 0.0.0.0/0 via BGP from the first PE and should redistribute it to OSPF but it won’t unless we configure “default-information originate” under OSPF process.
In our example R7 is connected to internet using a static route. R7 injects internet to PE (R3) by “redistribute static subnets”. R3 redistribute that to BGP by “default-information originate” to the other PE (R2). Now R2 has 0.0.0.0/0 in the BGP and should redistribute it into OSPF and use “default-information originate” to send it to its own connected CE.
So I sent the following diagram to the provider for their reference:
Example (based on the first topology):
R7 (CE-Internet):
router ospf 1
redistribute static subnets
network 172.16.37.7 0.0.0.0 area 0
default-information originate
!
ip route 0.0.0.0 0.0.0.0 172.16.69.68
!
R3 (PE):
router ospf 147 vrf VPN1
redistribute bgp 666 subnets
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 666
no synchronization
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 666
neighbor 2.2.2.2 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 send-community extended
exit-address-family
!
address-family ipv4 vrf VPN1
redistribute ospf 147 vrf VPN1 match internal external 1 external 2
default-information originate
no synchronization
exit-address-family
!
R2 (PE):
router ospf 147 vrf VPN1
redistribute bgp 666 subnets
network 0.0.0.0 255.255.255.255 area 0
default-information originate
!
router bgp 666
no synchronization
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 666
neighbor 3.3.3.3 update-source Loopback0
no auto-summary
!
address-family vpnv4
neighbor 3.3.3.3 activate
neighbor 3.3.3.3 send-community extended
exit-address-family
!
address-family ipv4 vrf VPN1
redistribute ospf 147 vrf VPN1 match internal external 1 external 2
no synchronization
exit-address-family
Verification:
R3#show ip ospf 147 database
OSPF Router with ID (172.16.37.3) (Process ID 147)
Router Link States (Area 0)
Link ID ADV Router Age Seq#
172.16.37.3 172.16.37.3 1047 0×8000
172.16.37.7 172.16.37.7 1021 0×8000
Net Link States (Area 0)
Link ID ADV Router Age Seq#
172.16.37.3 172.16.37.3 1047 0×8000
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq#
172.16.24.0 172.16.37.3 1047 0×8000
Type-5 AS External Link States
Link ID ADV Router Age Seq#
0.0.0.0 172.16.37.7 482 0×8000
47.47.47.4 172.16.37.3 1047 0×8000
47.47.47.7 172.16.37.7 1021 0×8000
R3#show ip route vrf VPN1
Routing Table: VPN1
Gateway of last resort is 172.16.37.7 to network 0.0.0.0
172.16.0.0/24 is subnetted, 2 subnets
C 172.16.37.0 is directly connected, Ethernet0/2
B 172.16.24.0 [200/0] via 2.2.2.2, 01:27:35
47.0.0.0/32 is subnetted, 2 subnets
O E2 47.47.47.7 [110/20] via 172.16.37.7, 01:24:49, Ethernet0/2
B 47.47.47.4 [200/20] via 2.2.2.2, 01:27:35
O*E2 0.0.0.0/0 [110/1] via 172.16.37.7, 00:09:39, Ethernet0/2
R2#show ip bgp vpnv4 vrf VPN1
BGP table version is 41, local router ID is 2.2.2.2
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 172.16.12.2:1 (default for vrf VPN1)
*>i0.0.0.0 3.3.3.3 1 100 0 ?
*> 47.47.47.4/32 172.16.24.4 20 32768 ?
*>i47.47.47.7/32 3.3.3.3 20 100 0 ?
*> 172.16.24.0/24 0.0.0.0 0 32768 ?
*>i172.16.37.0/24 3.3.3.3 0 100 0 ?
R4#show ip route
Gateway of last resort is 172.16.24.2 to network 0.0.0.0
172.16.0.0/24 is subnetted, 2 subnets
O IA 172.16.37.0 [110/11] via 172.16.24.2, 03:32:41, Ethernet0/0
C 172.16.24.0 is directly connected, Ethernet0/0
47.0.0.0/32 is subnetted, 2 subnets
O E2 47.47.47.7 [110/20] via 172.16.24.2, 01:27:21, Ethernet0/0
C 47.47.47.4 is directly connected, Loopback0
O*E2 0.0.0.0/0 [110/1] via 172.16.24.2, 00:12:15, Ethernet0/0
Note that branch offices still have their own internet as backup, so whenever MPLS goes down, they can use their own internet with IPsec capability to connect to the headquarter automatically, if I would use “default-information originate always” then CE would always advertise default route regardless of it’s existence in the routing table but in our case we have IP SLA monitored static route to the internet, and whenever it goes down OSPF will take back default-route advertisement (default-information originate – without always!) and branch office will use the higher administrative distance static route to its own internet (floating route). Then it will use IPsec to HQ as the crypto-map on internet interface will be triggered.


Posted by Hosein Paydar on November 10, 2009 at 11:36 pm
Very instructive post.Thanx
Posted by Zeus on November 11, 2009 at 11:02 pm
Excellent and I am impressed! You should go for CCIE SP and get done with it. Your blogs cleared couple of topics for me as well.
Posted by Zeus on November 12, 2009 at 3:36 am
What tool you used to draw the second diagram?
thanks,
Zeus
Posted by Shafagh on November 12, 2009 at 8:37 am
Don’t Tempt me…
The Second drawing is power point.
Posted by Abid Nazeer on December 28, 2009 at 9:53 am
Excellent post.I’m always checking your blog.
Posted by Irfan on January 25, 2010 at 11:31 pm
Very well explained and great share bro keep it up
Blessings and Regards
The Best Bunny