cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

How to configure route policy to redistribute connected route to bgp?

How to configure route policy to redistribute connected route to bgp?

David32
New Contributor II
Hi guys,

I want to redistribute direct (connected) routes to bgp basically.
But I also want to specify community for particular prefixes as well.

For example, a Router-A has vlan A (10.1.1.0/24) and vlan B (10.2.2.0/24), vlan C (10.3.3.0/24) locally.

And Router-A wants to redistribute direct route to BGP but also want to specify 10.1.1.0/24 prefix with community 7777:100.

So I tried to configure above as below:

enable bgp export direct address-family ipv4-unicast export-policy CONN_TO_BGP

Policy: CONN_TO_BGPentry 10 {
if match any {
nlri 10.1.1.0/24 ;
}
then {
community set "7777:100" ;
permit ;
}
}

However, when I checked the routes from Router-B, it only receives 10.1.1.0/24 with community 7777:100 but no other direct routes.

Please help me.
3 REPLIES 3

David32
New Contributor II
Let me ask one more question. With Parthibanā€™s anwer above, let say this router A has 3 bgp neighnors, router-b, router-c and router-d. I want to redistribute direct routes to all three neighbors basically. But I want to filter prefix 10.1.1.0/24 with community 7777:100 to router-c and also want to filter 10.2.2.0/24 with community 8888:100 to router-d. In orther words, router-b will receive all direct routes from router-a, router-c will receive all direct routes except 10.1.1.0/24 and router-d will receive all direct routes except 10.2.2.0/24. For this scenario, how should I configure route policies? Br David

Parthiban_V
Extreme Employee
Hi David,

Try this

CONN_TO_BGPentry 10 {
if match any {
nlri 10.1.1.0/24 ;
}
then {
community set "7777:100" ;
permit ;
}
}
entry two {
if match any {
nlri 0.0.0.0/0;
} then {
permit;
}
}

David32
New Contributor II
Hi Parthiban, Does entry two mean ā€œall connected routesā€?
GTM-P2G8KFN