Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

OSPF E2 distribution into BGP

What would be best practice to take some E2 routes in OSPF and populate them into BGP. I have a switch that has several static routes that are reditribtued into OSPF. Then I have a router that is running BGP and OSPF and I want to take just those static routes and populate those into BGP. Would tagging the static routes or creating a route map work best?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Silver

OSPF E2 distribution into BGP

Redistributing E2/E1 Routes into BGP can be done via two ways

a) Command " redistribute ospf 1 match external 2"

b) Using Route-Map Match Statement "match route-type external type-2"

Redistribute OSPF E2 Routes in BGP

Please rate the post if you find it useful.

Regards,

Sunil Khanna.

Regards, Sunil Khanna
Hall of Fame Super Silver

Re: OSPF E2 distribution into BGP

Hello Tconnorbok,

route tagging can be a smart way to achieve this

on the switch you can use a route-map to set a route-tag and to control what static routes are redistributed at once

access-list 10 permit 10.10.10.0 0.0.0.0.255

access-list 10 permit 10.10.11.0 0.0.0.0.255

.....

( a prefix list could be used instead of a normal ACL)

route-map STATIC-INTO-OSPF permit 10

match ip address 10

set tag 6500

set metric-type type-2

router ospf 10

redistribute static subnets route-map STATIC-INTO-OSPF

! subnets keyword to avoid automatic summarization

on the router speaking OSPF and BGP you need a route-map that takes routes with tag value 6500

route-map OSPF-INTO-BGP permit 10

match tag 6500

match route-type external type-2

router bgp 100

redistribute ospf 10 route-map OSPF-INTO-BGP

The advantage is that if in the future you add static routes on the switch no change is required on the router if the new routes are O E2 with the expected route tag

Hope to help

Giuseppe

4 REPLIES
Silver

OSPF E2 distribution into BGP

I am not sure about using tags for redistribution without using route-maps,

route-maps will give more flexibility and can match the routes based on different criteria (access-list, tag)

Siddhartha
Silver

OSPF E2 distribution into BGP

Redistributing E2/E1 Routes into BGP can be done via two ways

a) Command " redistribute ospf 1 match external 2"

b) Using Route-Map Match Statement "match route-type external type-2"

Redistribute OSPF E2 Routes in BGP

Please rate the post if you find it useful.

Regards,

Sunil Khanna.

Regards, Sunil Khanna
Hall of Fame Super Silver

Re: OSPF E2 distribution into BGP

Hello Tconnorbok,

route tagging can be a smart way to achieve this

on the switch you can use a route-map to set a route-tag and to control what static routes are redistributed at once

access-list 10 permit 10.10.10.0 0.0.0.0.255

access-list 10 permit 10.10.11.0 0.0.0.0.255

.....

( a prefix list could be used instead of a normal ACL)

route-map STATIC-INTO-OSPF permit 10

match ip address 10

set tag 6500

set metric-type type-2

router ospf 10

redistribute static subnets route-map STATIC-INTO-OSPF

! subnets keyword to avoid automatic summarization

on the router speaking OSPF and BGP you need a route-map that takes routes with tag value 6500

route-map OSPF-INTO-BGP permit 10

match tag 6500

match route-type external type-2

router bgp 100

redistribute ospf 10 route-map OSPF-INTO-BGP

The advantage is that if in the future you add static routes on the switch no change is required on the router if the new routes are O E2 with the expected route tag

Hope to help

Giuseppe

New Member

OSPF E2 distribution into BGP


Thank you so much for the examples. This will help alot.

859
Views
0
Helpful
4
Replies