05-07-2012 12:41 PM - edited 03-07-2019 06:33 AM
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?
Solved! Go to Solution.
05-10-2012 03:37 AM
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.
05-10-2012 03:56 AM
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
05-07-2012 02:19 PM
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)
05-10-2012 03:37 AM
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.
05-10-2012 03:56 AM
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
05-10-2012 07:33 AM
Thank you so much for the examples. This will help alot.
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: