cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1003
Views
0
Helpful
5
Replies

BGP lab: network statement under bgp

mohAmed khAdr
Level 1
Level 1

Hello,

Q: bgp lab

!

can I config a prefix-list to group multiple prefix into 1 prefix-list & route-map and apply it under bgp?

!

Exp.

!

int lo1

ip add 172.20.255.1/26

int lo2

ip add 172.20.255.65/26

int lo3

ip add 172.20.255.129/26

int lo4

ip add 172.20.255.193/16

!

ip prefix-lsit bgglab seq 100 perm 172.20.255.192/24 le 26

!

route-map BGP_TEST perm 10

match ip add prefix-list bgplab

set met 100

!

router bg 100

net 172.20.255.0 mask 255.255.255.192 route-map BGP_TEST

!

end

!

Have been trying for 2 hrs now, no-can-do.

Should I reconfig the prefix-lsit to match each lo?

!

Thx in advance.

mohAmed

5 Replies 5

mikull.kiznozki
Level 1
Level 1

if you are trying to set med values for the specifed network to 100 the route-map should be applied to the neighbor and not the network command as your route-map has the prefix list which defines the networks.

i presume you have already advertised the 172.20.255.0/26 into BGP from this router.

Kizno,

Thx for taking a shot at it....

I aint trying to set any med values....I just set a med tag to see how the routes look in RT....

I am trying to see if we can use the network statement to group multiple prefixes under one network config statement, rather than 3 or 4 statements each pointing to 1specfic prefix... using prefix-list & route-map.

I tried with 1 prefix-list & 3 prefix-list to match the loopback ints...still I can only see 1 prefix being advertised(fist),,,not all of them.

Here’s' my Q: How to do it? Is it possible?

Thx.

Mohamed,

Try this. Create a static route to your summary pointed to null0. Then advertise that in BGP and your policy should work. You have to have a specific route for BGP to advertise, and if you don't have a route pointing to your summary then you won't see the advertisement.

ip route 172.20.255.0 255.255.255.192 null0

router bgp 1

network 172.20.255.0 mask 255.255.255.192 route-map BGP_TEST

HTH,

John

HTH, John *** Please rate all useful posts ***

Hey John,

Thx for your help..

It idin't take

!

R2

sh ip rou

B       172.20.255.0/26 [20/250] via 172.20.22.2, 00:01:29

R16#sh ip rou 172.20.255.1

Routing entry for 172.20.255.0/26

  Known via "bgp 300", distance 20, metric 250

  Tag 200, type external

  Last update from 172.20.22.2 00:13:57 ago

  Routing Descriptor Blocks:

  * 172.20.22.2, from 172.20.22.2, 00:13:57 ago

     Route metric is 250, traffic share count is 1

      AS Hops 1

      Route tag 200

this how the only route showing in routing table...I set the met to 250 to see if it will click or not...

It only take the first match in the prefix-list..which is Ok...but how I make it to take all the prefix in the list

!

here's the config again after the nu 0 on R1

!

int lo1   ip 172.20.255.1/26

int lo2   ip  172.20.255.65/26

int lo3   ip  172.20.255.129/26

int lo4   ip  172.20.255.193/26

!

ip route 172.20.255.0 255.255.255.192 nu 0

!

ip prefix-list singo seq 100 perm 172.20.255.0/24 le 26

!

route map BGP_TEST perm 10

match ip add prefix-list singo

set met 250

!

router bg 200

network 172.20.255.0 mask 255.255.255.192 route-map BGP_TEST

!

Thx.

mohAmed

Mohamed,

You'll need to change your prefix list to support just the summary and it should work. If you're wanting to change all routes that are advertised to the neighbor, you'll need to apply the route map to the neighbor and then you'll hit all entries in the prefix list.

** Edit **

I had some time to play around with this, and it doesn't look like you're going to be able to do what you're wanting to do. What the route-map on the network statement seems to do is to set whatever attribute you want on that route locally. In other words, you can set local pref, weight, etc, by putting a route-map on the network that you want to advertise. Weight, for example, is locally significant so you can set the route to be less preferred from your perspective. When you do your advertisement for your supernet, look at the bgp table that's on the router you're doing your advertisement on and you'll notice that you're also setting the metric on the local router which indicates to me that this is a "set and advertise" type of route-map.  There are certain values that you cannot set like a tag and as-path prepending; you'll need to do that with the neighbor route-map. Another interesting thing that I noticed was that the route-map applied directly to the neighbor overrides the route-map applied to the network command.

HTH,

John

HTH, John *** Please rate all useful posts ***