From: Timothy Ouellette (timoue@cogeco.ca)
Date: Thu Nov 28 2002 - 05:16:29 GMT-3
Basically, when you redistribute BGP into OSPF, it'll automatically put the as-path
info into the tag. If you want it to also add the origin code, you need to use a
table-map and "set automatic-tag" on the router that is redistributing from bgp to
igp.
Nothing needs to be done on the IGP routes but when you want to redistribute the IGP
back into BGP, you need to tell BGP to look for the info in the tag. This is done on
your redistributing line calling a route map and then using "set as-path tag"
Quick thing to notice is that I didn't have to do any matches on anything to get the
tags out.
Here's the quick setup and partial configs
r2---ospf-----r3------ebgp-----r4
r2 is redistributing ospf into bgp, r3 is redistributing bgp into ospf. R4 is
generating networks 4.4.4.0/24 and 44.44.44.0/24
r2's config snippet
router ospf 1
log-adjacency-changes
network 10.1.1.0 0.0.0.255 area 0
!
router bgp 2
bgp log-neighbor-changes
redistribute ospf 1 match internal external 1 external 2 route-map get_tag
no auto-summary
r3's config snippet
router ospf 1
log-adjacency-changes
redistribute bgp 3 subnets
network 10.1.1.0 0.0.0.255 area 0
!
router bgp 3
table-map auto_tag
bgp log-neighbor-changes
redistribute static
neighbor 34.34.34.4 remote-as 4
default-information originate
r4's config
router bgp 4
bgp log-neighbor-changes
network 4.4.4.0 mask 255.255.255.0
network 44.44.44.0 mask 255.255.255.0
neighbor 34.34.34.3 remote-as 3
r4#b
BGP table version is 4, local router ID is 44.44.44.44
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 34.34.34.3 0 0 3 ?
*> 4.4.4.0/24 0.0.0.0 0 32768 i
*> 44.44.44.0/24 0.0.0.0 0 32768 i
And the final part we were waiting to see.
r2#b
BGP table version is 22, local router ID is 12.12.12.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 4.4.4.0/24 10.1.1.3 1 32768 4 i
*> 10.1.1.0/24 0.0.0.0 0 32768 ?
*> 44.44.44.0/24 10.1.1.3 1 32768 4 i
Jason Sinclair wrote:
> Tim,
>
> Use a match statement and an ACL to match 1.1.1.0 (or 1.0.0.0...) and then
> try it..
>
> Cheers,
>
> Jason Sinclair CCIE #9100
> Manager, Network Control Centre
> POWERTEL
> 55 Clarence Street,
> SYDNEY NSW 2000
> AUSTRALIA
> office: + 61 2 8264 3820
> mobile: + 61 416 105 858
> email: sinclairj@powertel.com.au
>
> -----Original Message-----
> From: Timothy Ouellette [mailto:timoue@cogeco.ca]
> Sent: Thursday, 24 October 2002 17:21
> To: Jason Sinclair
> Subject: Re: table-map with ospf/bgp - broken
>
> Jason, thanks for the response. Here's the data you were looking for. As
> you can
> see the tags are 0.....
>
> r2#sh ip ospf d e
>
> OSPF Router with ID (192.168.1.2) (Process ID 1)
>
> Type-5 AS External Link States
>
> LS age: 2640
> Options: (No TOS-capability, DC)
> LS Type: AS External Link
> Link State ID: 1.1.1.0 (External Network Number )
> Advertising Router: 1.1.1.1
> LS Seq Number: 80000002
> Checksum: 0xE4C6
> Length: 36
> Network Mask: /24
> Metric Type: 2 (Larger than any link state path)
> TOS: 0
> Metric: 1
> Forward Address: 0.0.0.0
> External Route Tag: 0
>
> Routing Bit Set on this LSA
> LS age: 319
> Options: (No TOS-capability, DC)
> LS Type: AS External Link
> Link State ID: 3.3.3.0 (External Network Number )
> Advertising Router: 3.3.3.3
> LS Seq Number: 80000001
> Checksum: 0x8A10
> Length: 36
> Network Mask: /24
> Metric Type: 2 (Larger than any link state path)
> TOS: 0
> Metric: 5
> Forward Address: 0.0.0.0
> External Route Tag: 0
>
> r2#
>
> Here's the config of r3. I wasn't sure what to match on so I just chose
> length?
>
> router ospf 1
> log-adjacency-changes
> redistribute bgp 3 metric 5 subnets
> network 172.16.1.0 0.0.0.255 area 0
> !
> router bgp 3
> no synchronization
> table-map autotag
> bgp log-neighbor-changes
> network 3.3.3.0 mask 255.255.255.0
> redistribute ospf 1 route-map tags
> no auto-summary
> !
> ip classless
> ip http server
> !
> route-map tags permit 10
> match length 1 5000
> set as-path tag
> !
> route-map autotag permit 10
> match length 1 5000
> set automatic-tag
>
> Jason Sinclair wrote:
>
> > Tim,
> >
> > Looks OK - try removing the route-maps from R1 as they are needed only on
> R3
> > at this stage. The table-map modifies the BGP info before it puts it into
> > the route table. The other route-map (on the redis from OSPF) is what
> > converts the OSPF tag to a BGP path. Then clear it all. If this doesn't
> > work, send me a show ip ospf data from R2 as well as it seems the tags
> > aren't being passed from BGP into OSPF.
> >
> > Regards,
> >
> > Jason Sinclair CCIE #9100
> > Manager, Network Control Centre
> > POWERTEL
> > 55 Clarence Street,
> > SYDNEY NSW 2000
> > AUSTRALIA
> > office: + 61 2 8264 3820
> > mobile: + 61 416 105 858
> > email: sinclairj@powertel.com.au
This archive was generated by hypermail 2.1.4 : Tue Dec 03 2002 - 07:23:12 GMT-3