cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
1653
Views
0
Helpful
3
Replies

BGP redistributed to OSPF

Hi.

I have a router which redistridutes BGP routes to OSPF process. Here is my config:

router ospf 2 vrf customer1

log-adjacency-changes

redistribute bgp 65000 subnets

network 192.168.21.0 0.0.0.255 area 0

router ospf 3 vrf customer2

log-adjacency-changes

redistribute bgp 65000 subnets

network 192.168.22.0 0.0.0.255 area 0

Here are my BGP routes:

R11#sh ip route vrf customer2 bgp

     172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks

B       172.16.35.0/24 [200/156160] via 6.6.6.6, 00:54:56

B       172.16.25.0/24 [200/156160] via 6.6.6.6, 00:54:56

B    192.168.11.0/24 [200/0] via 6.6.6.6, 00:54:56

According to default seed metric when BGP routes are redistributed to OSPF is 1 and type is E2. But when I analize the redistributed routes I see next picture:

R9#sh ip route ospf

     172.16.0.0/24 is subnetted, 8 subnets

O E2    172.16.35.0

           [110/156160] via 192.168.22.2, 00:31:55, FastEthernet0/1.22

O E2    172.16.25.0

           [110/156160] via 192.168.22.2, 00:31:55, FastEthernet0/1.22

O E2 192.168.11.0/24 [110/1] via 192.168.22.2, 00:31:55, FastEthernet0/1.22

As can be seen for two routes the metric remains!!! and for the third is turned to 1 as written by default seed metric. I am confused why??? Can any one explain me?

3 REPLIES 3
Beginner

BGP redistributed to OSPF

When redistributing a BGP route into OSPF, a default metric of 1 is to be used as per RFC1403.

You can try to use the "redistribute .. metric x" command to set an explicit metric.

kind regards, Eehab

Enthusiast

BGP redistributed to OSPF

Hi

I've just started reading about MPLS so I'm not an expert.

But for what I've been reading so far is that BGP uses extended communities to be able to carry additional information about OSPF - like the metric. So the metric is converted to the BGP MED and then reconverted to OSPF cost on the other side of the MPLS VPN.

So if the metric is 156160 when it is redistributed into BGP, it will still be 156160 when it is redistributed back into OSPF.

Correct me if I'm wrong.

Highlighted
Beginner

BGP redistributed to OSPF

You have seen already that each PE router learns routes from across the MPLS/VPN backbone and from attached customer sites. These routes are populated into VPN-specific routing tables. Any routes learned from customers are advertised across the MPLS/VPN backbone through the use of MP-IBGP, and any routes learned via MP-IBGP are places into the  VRFs of interested parties. To achieve this, each PE router needs information that tells it how to process any routes it receives. This information not only tells the PE router into which VRF the routes should be imported but also what information it should append to the route when advertising to other PE routers.

A new transitive optional BGP attribute which contains a set of Extended Communities that define the site from where the VPN-IPv4 address was learned (the route origin). Route origin, referrred to as the SOO or site of origin by Ciso implementation, prevents routing loops between sites. While the route target Extended Community define the set of routers to which the route should be exported. If a MP-IBGP update has a route target of X, then this route will be imported by remote PE's that has a VRF configured to import the X route target.

BGP extended community attribute is also used for OSPF routes. Whenever a PE router receives an MP-IBGP update that contains a prefix learned via OSPF by the originating PE, it must be capable of identifying what type of OSPF route is contained within the update. This is necessary to allow the PE router to generate an appropriate LSA toward the VPN customer CE router based on the OSPF route type received across the MPLS/VPN backbone. OSPF has several route types:

- Intra area

- Inter area

- NSSA

- External 1

- External 2

To support this requirement, when the PE router propagates OSPF routes into the MP-IBGP through redistribution, the BGP extended community attribute is used to preserve and convey the OSPF attributes of the route.

The format of the attribute used for the propagation of OSPF information is as follows:

- 4 byte OSPF area number

- 1 byte OSPF route type (1 through 7)

- 1 byte option (used for external metric type)

Because multiple updates from the same prefix might be received and because OSPF has its own selection process for differing route types, the BGP decision process has been enhanced to prefer intra-area OSPF routes over Inter-area OSPF routes over External type 1 over external 2 routes. This decision process is based on the OSPF route type that is conveyed within the BGP extended community attribute that accompanies the VPN-IPv4 route.

kind regards, Eehab

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards