OcNOS-SP : Layer 3 Guide : Layer 3 Unicast Configuration Guide : BGP : OSPF as PE-CE Protocol for VPNs
OSPF as PE-CE Protocol for VPNs
In an MPLS VPN environment, customer networks are connected to an MPLS VPN-enabled provider backbone. As shown in Figure 1-30, Customer A areas, Areas 0 and 1, are connected to an MPLS VPN–enabled provider network. Area 0 and Area 1 have routers CE1 and CE2 running OSPF. MP-iBGP is used between PE1 and PE2 to propagate routes between Site 1 (Area 0) and Site 2 (Area 1). Traditional OSPF-BGP redistribution is performed at PE routers, PE1 and PE2. In this case, routes distributed by CE1 into the MP-iBGP cloud are sent to CE2 as external routes, even though both CE1 and CE2 belong to the same customer.
This behavior can be changed with the additional domain ID configuration. Each VRF should be configured a domain ID on the PE routers. If a PE router gets a route through the MP-iBGP cloud and has to send to any customer site, it checks the domain ID value against the list of stored domain ID values. If the incoming domain ID matches any of the stored IDs, that route is inserted into the customer site with the same type, as it was inserted into the MP-BGP cloud; otherwise, it is inserted as external route.
Topology
Figure 1-30: OSPF as PE-CE Protocol
Configuration
CE1
 
#configure terminal
Enter configure mode
(config)#interface lo
Enter loopback interface mode
(config-if)#ip address 60.1.1.1/24 secondary
Specify IP address for the interface
(config-if)#exit
Exit loopback interface mode
(config)#router ospf 1
Configure the routing process and specify the Process ID (1).
(config-router)#network 10.10.10.0/24 area 0
Advertise the network in OSPF
(config-router)#network 60.1.1.0/24 area 0
Advertise the loopback IP address in area 0 of router OSPF 1.
(config-router)#commit
Commit the candidate configuration to the running configuration.
PE1
 
#configure terminal
Enter configure mode.
(config)#ip vrf ABC
Specify the name of the VRF (ABC) to be created.
(config-vrf)#rd 10:100
Assign a route distinguisher (RD) for the VRF, which is a unique value on the router. The RD value can be in ASN:NN or A.B.C.D:NN format.
(config-vrf)#route-target both 10:100
Specify the 2-Octet AS specific or IPv4 specific Transitive Route-Target extended community attribute.
(config-vrf)#exit
Exit VRF mode, and return to Configure mode.
(config)#interface eth1
Enter interface mode.
(config-if)#ip vrf forwarding ABC
Associate interface eth1 to vrf ABC.
(config-if)#exit
Exit interface mode.
(config)#router ospf 1 ABC
Configure OSPF for VRF.
(config-router)#network 10.10.10.0/24 area 0
Advertise the network for OSPF adjacency with CE1.
(config-router)#domain-id 1.1.1.1
Configure the primary domain ID.
(config-router)#domain-id 2.2.2.2 secondary
Configure a secondary domain ID.
(config-router)#domain-id 3.3.3.3 secondary
Configure a secondary domain ID.
(config-router)#exit
Exit Router mode and return to Configure mode.
(config)#router bgp 100
Assign the ASN value (100) to the BGP router.
(config-router)#neighbor 30.30.30.2 remote-as 100
Configure neighbor 30.30.30.2 for iBGP.
(config-router)#address-family vpnv4 unicast
Enter Address-Family-VPNv4 mode.
(config-router-af)#neighbor 30.30.30.2 activate
Activate neighbor 30.30.30.2.
(config-router-af)#exit-address-family
Exit Address Family mode and return to Router mode.
(config-router)#address-family ipv4 vrf ABC
Enter Address-Family-VRF mode.
(config-router-af)#redistribute ospf
Specify redistributing routes from OSPF into BGP.
(config-router-af)#exit-address-family
Exit Address Family mode and return to Router mode.
(config-router)#commit
Commit the candidate configuration to the running configuration.
PE2
 
#configure terminal
Enter configure mode.
(config)#ip vrf ABC
Specify the name of the VRF (ABC) to be created.
(config-vrf)#rd 10:100
Assign a route distinguisher (RD) for the VRF, which is a unique value on the router. The RD value can be in ASN:NN or A.B.C.D:NN format.
(config-vrf)#route-target both 10:100
Specify the 2-Octet AS specific or IPv4 specific Transitive Route-Target extended community attribute.
(config-vrf)#exit
Exit VRF mode, and return to Configure mode.
(config)#interface eth1
Enter interface mode.
(config-if)#ip vrf forwarding ABC
Associate interface eth1 to vrf ABC.
(config-if)#exit
Exit interface mode.
(config)#commit
Commit the candidate configuration to the running configuration.
(config)#router ospf 1 ABC
Configure OSPF for VRF.
(config-router)#network 20.20.20.0/24 area 0
Advertise the network for OSPF adjacency with CE1.
(config-router)#domain-id 1.1.1.1
Configure the primary domain ID.
(config-router)#domain-id 2.2.2.2 secondary
Configure a secondary domain ID.
(config-router)#domain-id 3.3.3.3 secondary
Configure a secondary domain ID.
(config-router)#exit
Exit Router mode and return to Configure mode.
(config)#commit
Commit the candidate configuration to the running configuration.
(config)#router bgp 100
Assign the ASN value (100) to the BGP router.
(config-router)#neighbor 30.30.30.1 remote-as 100
Configure neighbor 30.30.30.1 for iBGP.
(config-router)#address-family vpnv4 unicast
Enter Address-Family-VPNv4 mode.
(config-router-af)#neighbor 30.30.30.1 activate
Activate neighbor 30.30.30.1.
(config-router-af)#exit-address-family
Exit Address Family mode and return to Router mode.
(config-router)#address-family ipv4 vrf ABC
Enter Address-Family-VRF mode.
(config-router-af)#redistribute ospf
Specify redistributing routes from OSPF into BGP.
(config-router-af)#exit-address-family
Exit Address Family mode and return to Router mode.
(config-router)#commit
Commit the candidate configuration to the running configuration.
CE2
 
#configure terminal
Enter configure mode.
(config)#router ospf 1
Configure the routing process, and specify the Process ID (1).
(config-router)#network 20.20.20.0/24 area 0
Advertise the network in OSPF.
(config-router)#commit
Commit the candidate configuration to the running configuration.
Validation
#show ip bgp vpnv4 all
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, l - labeled
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
 
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 10:100 (Default for VRF ABC)
*> 10.10.10.0/24 0.0.0.0 2 100 32768 ?
*> 60.1.1.1/32 10.10.10.1 12 100 32768 ?
Announced routes count = 2
Accepted routes count = 0
#
 
Last modified date: 10/16/2023