01-28-2008 06:38 AM - edited 03-03-2019 08:27 PM
I've private AS connected to other private AS's via 2 routers. I received route at first router with as-path 3 and on the second with as-path 4(i've made it for influence traffic). But during redistribution to OSPF all as-path information will be lost. How to preserve that info and use it later in OSPF domain for managing routes?
Solved! Go to Solution.
01-29-2008 12:37 AM
Ah well, you never said you wanted to do anything with them :)
If you want to set metrics you are better doing it when you redistribute - on the 7200 in our example. So you still use the as-paths to identify the relevant routes but then just set the metric you need.
Jon
01-28-2008 07:36 AM
You can always modify the metric while redistributing so that one router is always preferred inside your ospf domain
Narayan
01-28-2008 07:58 AM
Hi
I've just checked this in our lab. The as-path information is preserved as a tag automatically for you. To see this do a
sh ip route "IP subnet" "subnet mask"
on an OSPF route redistributed from BGP and you will see the tag.
You can then use a route-map to match these tags and apply whatever policies you want to them.
Jon
01-28-2008 10:42 PM
Hi
Position tag shows me only last AS number ( Tag 65334)-
pdc-cat6506-obs# sh ip route 10.20.9.0
Routing entry for 10.20.9.0/24
Known via "ospf 1", distance 110, metric 1
Tag 65334, type extern 2, forward metric 1
Last update from 9.9.9.2 on GigabitEthernet5/1, 18:19:09 ago
Routing Descriptor Blocks:
* 9.9.9.2, from 172.22.21.222, 18:19:09 ago, via GigabitEthernet5/1
Route metric is 1, traffic share count is 1
Route tag 65334
pdc-cat6506-obs# sh ip route 10.20.16.0
Routing entry for 10.20.16.0/24
Known via "ospf 1", distance 110, metric 1
Tag 65334, type extern 2, forward metric 1
Last update from 9.9.9.2 on GigabitEthernet5/1, 18:19:22 ago
Routing Descriptor Blocks:
* 9.9.9.2, from 172.22.21.222, 18:19:22 ago, via GigabitEthernet5/1
Route metric is 1, traffic share count is 1
Route tag 65334
Here info from BGP table -
*> 10.20.9.0/24 2.2.2.100 0 65334 i
*> 10.20.16.0/24 2.2.2.201 0 65334 2854 65011 i
01-28-2008 11:39 PM
Ospf does not understand the attributes of bgp ,you1`d better use metric xx command when redistribute was configured
01-28-2008 11:55 PM
Should i use route policy during redistribution from bgp to ospf where i can match as-path and set metric?
01-28-2008 11:59 PM
Hi
This is exactly what i'm trying at the moment in the lab - can't seem to get it working just yet but there is a lot going on in my lab :)
I can't see why this wouldn't work though.
** Edit - okay just got it working, my mistake on the as-path access-list. So yes, you can do this on the router that redistributes between BGP and OSPF. **
Jon
01-29-2008 12:05 AM
Jon, can you post part of config for example?
01-29-2008 12:13 AM
Okay, i did not emulate your setup entirely so you will need to use regexs in your as-path access-lists.
R5 -> R1 -> 7200 -> R4
R5 is in BGP AS 20
R1 is in BGP AS 3
7200 is in BGP 10
R5 peers with R1, R1 peers with 7200 and 7200 uses OSPF to peer with R4.
The routes received by 7200 from R1
192.168.31.0 - as path 3
192.168.41.0 - as path 3 20 <-- this is the one we are setting tag of 200 on.
router ospf 10
log-adjacency-changes
redistribute bgp 10 subnets route-map MPL
network 172.16.22.0 0.0.0.255 area 0
!
router bgp 10
no synchronization
bgp log-neighbor-changes
network 10.9.1.0 mask 255.255.255.240
network 172.16.22.0 mask 255.255.255.0
neighbor 192.168.5.1 remote-as 3
no auto-summary
!
ip as-path access-list 2 permit 3 20
!
route-map MPL permit 10
match as-path 2
set tag 200
!
route-map MPL permit 20
Output from R4
R4#sh ip ro 192.168.31.0
Routing entry for 192.168.31.0/24
Known via "ospf 1", distance 110, metric 1
Tag 3, type extern 2, forward metric 1
Last update from 172.16.22.1 on FastEthernet0/1, 00:12:39 ago
Routing Descriptor Blocks:
* 172.16.22.1, from 192.168.6.2, 00:12:39 ago, via FastEthernet0/1
Route metric is 1, traffic share count is 1
Route tag 3
R4#sh ip ro 192.168.41.0
Routing entry for 192.168.41.0/24
Known via "ospf 1", distance 110, metric 1
Tag 200, type extern 2, forward metric 1
Last update from 172.16.22.1 on FastEthernet0/1, 00:13:04 ago
Routing Descriptor Blocks:
* 172.16.22.1, from 192.168.6.2, 00:13:04 ago, via FastEthernet0/1
Route metric is 1, traffic share count is 1
Route tag 200
HTH
Jon
01-29-2008 12:24 AM
And now i can have routes at R4 with different route tags. But how to use it is later? I mean how to convert Route tag to metric which can influence which route to use )?
01-29-2008 12:37 AM
Ah well, you never said you wanted to do anything with them :)
If you want to set metrics you are better doing it when you redistribute - on the 7200 in our example. So you still use the as-paths to identify the relevant routes but then just set the metric you need.
Jon
01-29-2008 12:40 AM
you would be better off configuring the metric while redistribution
Make sure the router that is setting the as-path prepend redistributes with a higher metric
Narayan
01-29-2008 12:44 AM
Narayan
After messing around in a lab with route-maps, as-path's etc. i came to the same conclusion as you. The fact that you got straight to the point while i went round the houses should tell me something :)
Jon
01-29-2008 12:54 AM
There is always something we get to learn when you play around in the lab. worth the time spent
I keep doing it all the time :-)
good day..
can i get to know your mail address
Narayan
01-29-2008 01:01 AM
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: