cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
10659
Views
5
Helpful
7
Replies

TAG problem in OSPF-BGP

Anand Solgama
Level 1
Level 1

Hi,

I create a LAB and try to apply set tag and match tag for loop prevention.

I used R1 ,R2,R3 BGP and R2-R4 ,R3-R5 OSPF now I want to set tag on R2 side for OSPF so that I can match it and deny it on R3 side!!!!

I have attached my lab with this post.

I am pasting R2 and R3 config here :

R2::::

router ospf 1

log-adjacency-changes

redistribute bgp 200 subnets

network 192.168.1.0 0.0.0.255 area 1

!

router bgp 200

no synchronization

bgp log-neighbor-changes

network 200.200.200.0

redistribute ospf 1 match internal external 1 external 2 route-map TAG

neighbor 200.200.200.1 remote-as 100

no auto-summary

!

no ip http server

no ip http secure-server

!

!

!

!

route-map TAG permit 10

set tag 50

!

!

!

R3:::::::::

router ospf 1

log-adjacency-changes

redistribute bgp 300 subnets route-map TAG

network 192.168.2.0 0.0.0.255 area 1

distribute-list route-map TAG in

!

router bgp 300

no synchronization

bgp log-neighbor-changes

network 200.200.201.0

redistribute ospf 1 match internal external 1 external 2

neighbor 200.200.201.1 remote-as 100

no auto-summary

!

no ip http server

no ip http secure-server

!

!

!

!

route-map TAG deny 10

match tag 50

!

route-map TAG permit 20

!

so my problem is why R2's OSPF not stoping at R3 where I used match tag???

Thanks

1 Accepted Solution

Accepted Solutions

Anand,

The distribution-list technique can be really hard to maintain in a real life network as the list needs to be modified every time a new prefix is added somewhere in the network. The route-map (set tag/match tag) technique is really easy to maintain.

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

View solution in original post

7 Replies 7

Rolf Fischer
Level 9
Level 9

Hi Anand,

you cannot use a  route-map with set tag when redistributing an IGP into BGP, see "Table 2" in

Route-Maps for IP Routing Protocol Redistribution Configuration

When doing so, may IOS display a message like:

% "TAG" used as redistribute ospf into bgp route-map, set tag not supported

Hope that helps

Rolf

Thanks I also saw this so I also used distribution-list to match route-map

Anand,

The distribution-list technique can be really hard to maintain in a real life network as the list needs to be modified every time a new prefix is added somewhere in the network. The route-map (set tag/match tag) technique is really easy to maintain.

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

I tried like this ....

R2:::::

router eigrp 1

redistribute ospf 1 metric 30000 1 255 255 1500 route-map TAG

network 200.200.200.0

auto-summary

!

router ospf 1

log-adjacency-changes

redistribute eigrp 1 subnets

network 192.168.1.0 0.0.0.255 area 1

!

route-map TAG permit 10

set tag 50

R3:::::

router eigrp 1

redistribute ospf 1 metric 30000 1 255 255 1500

network 200.200.201.0

auto-summary

!

router ospf 1

log-adjacency-changes

redistribute eigrp 1 subnets route-map TAG

network 192.168.2.0 0.0.0.255 area 1

!

no ip http server

no ip http secure-server

!

!

!

!

route-map TAG deny 10

match tag 50

!

route-map TAG permit 20

sometimes there is an option after redistribute command TAG but sometimes dont so I think we should use route-map   This is working now my R2 OSPF routes not showing in R5

Thanks 4 help happy now

Is there any way to check TAG is working or not other than check in route table ???

Thanks,


Harold Ritter
Cisco Employee
Cisco Employee

Hi Anand,

As Rolf mentioned, you can't set tag in BGP. The equivalent of tag in BGP would be community. Generally though, when you do mutual redistribution between BGP and an OSPF at multiple point in the network and you to make sure that there will not be loops, you should rather tag the routes when redistributing from BGOP to OSPF and deny these routes when redistributing back from OSPF to BGP.

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Thanks again ,but I couldnt do it properly on EIGRP to OSPF as well

Any material ???so I can learn my self ,I checked some sites but tuff examples

Thanks

Hi Anand,

The same would apply for EIGRP to OSPF redistribution. You would set a specific tag when redistributing from EIGRP to OSPF and then deny routes that match that same specific tag when redistributing from OSPF to EIGRP.

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México
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:

Review Cisco Networking products for a $25 gift card