BGP network command with route-map

Unanswered Question
May 20th, 2010

Hi ,

Anbody used bgp network command wit route-map ?

I have used this command with one route-map but I am facing issue.

router bgp 65272
no synchronization
bgp log-neighbor-changes
network route-map LAN_to_BGP
neighbor remote-as 4445
no auto-summary


route-map LAN_to_BGP deny 50
match tag 7001
route-map LAN_to_BGP deny 51
match tag 7002
route-map LAN_to_BGP permit 100
set metric 50

For me with this route-map , the advertisement is not happening for don't see any problem in the route-map. Can anybody suggest if there is somrthing I am missing in the config ?

Thanks in advance.


I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Giuseppe Larosa Thu, 05/20/2010 - 23:57

Hello Mathew,

post sh ip route

also you have no auto-summary, this requires an exact match in IP routing table, if you are using a subnet of (more specific) you need to add the correct mask to the network command.

you can then create the /24 IP prefix using the aggregate command

Hope to help


mathew-varghese Fri, 05/21/2010 - 00:03

Hi Giuslar,

Thanks for your reply.

As requested :-

sh ip route
Routing entry for
  Known via "connected", distance 0, metric 0 (connected, via interface)
  Advertised by bgp 65272
  Routing Descriptor Blocks:
  * directly connected, via Loopback200
      Route metric is 0, traffic share count is 1

Please note that , with route-map applied I am not able to advertise the prefix. If I remove the route-map it is working for me.



Giuseppe Larosa Fri, 05/21/2010 - 00:08

Hello Matthew,

the route-map should be used to set one or more BGP attributes of the IP prefix referenced by the network command

what if you use only the last route-map clause?


route-map LAN_to_BGP2 permit 100
set metric 50

Hope to help


mathew-varghese Fri, 05/21/2010 - 00:16

Hi Giuslar,

I got a requirement to deny all those routes with tag 7001 and 7002.

I just want to understand

1. Is there any problem with route-map ?

2. Is the route-map working different for network command than the neighbor command?



mathew-varghese Fri, 05/21/2010 - 00:27


When I am applying the route-map and debug , I am getting below logs..

*Mar  1 00:41:49.783: BGP(0): delete invalid sourced route for path 0
*Mar  1 00:41:49.787: BGP(0): no valid path for
*Mar  1 00:41:50.539: BGP(0): nettable_walker no best path
*Mar  1 00:41:50.543: BGP(0): send unreachable
*Mar  1 00:41:50.543: BGP(0): send UPDATE -- unreachable



Giuseppe Larosa Fri, 05/21/2010 - 00:37

Hello Mathew,

>> 2. Is the route-map working different for network command than the neighbor command?

I would say yes, when used with the network command the route-map should be used only for setting BGP attributes of the IP prefix that matches that network command

when used towards a neighbor a route-map can act as a route filter and can deny some routes based on different criteria including route tag = 7001 or route tag = 7002.

you can still implement a second route-map towards neighbor where you deny routes with that specific route tag values.

the debug shows that the network is considered not valid. but we know it is a connected route, it is actullay the IP address of a test loopbck or there is a static route using as next-hop the loopback address?

the debug can show the effects of using a route-map like that with the network command

Hope to help


mathew-varghese Fri, 05/21/2010 - 01:19

Thanks Giuslar..

Do you have any document reference for the route-map used for network command ? I serached but didn't find any document which says the difference between the route-maps for network and neighbor command.



Giuseppe Larosa Fri, 05/21/2010 - 01:49

Hello Mathew,

I agree that documentation is not clear about this

even command reference reports generic information

But if we think about the logic that is behind the command we should agree that:

given the following BGP command:

network route-map  test

a) applies only to IP prefix

b) route-map test at this point should do something related to prefix like setting metric (MED) to 50 no filtering action is required here because only one IP prefix is involved

in other words if I don't want to advertise a prefix I simply do not use a network command for that prefix.

If I use the network command I'm referring to a specific IP prefix.

On the other hand if I use a route-map towards a neighbor things are different all BGP prefixes in local BGP table are processed by the route-map and some filtering action is expected and performed.

Hope to help



This Discussion