cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1904
Views
0
Helpful
4
Replies

OSPF E2 distribution into BGP

tconnorbok
Level 1
Level 1

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

SunilKhanna
Level 1
Level 1

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

View solution in original post

Giuseppe Larosa
Hall of Fame
Hall of Fame

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

View solution in original post

4 Replies 4

siddhartham
Level 4
Level 4

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

SunilKhanna
Level 1
Level 1

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

Giuseppe Larosa
Hall of Fame
Hall of Fame

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

tconnorbok
Level 1
Level 1


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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: