Got it

XPL - Unable to Test existence of Commumnity Marked above on the Same Parent Route-Filter

Created: Apr 1, 2020 08:34:26Latest reply: Apr 18, 2020 02:28:56 126 5 0 0
  Rewarded HiCoins: 1 (problem resolved)


The issue is not with the community matcher type!
      I tried match-any, match-all, match-within...

- If I test a community that already is marked coming from my costumer... OK!
       - If I test a community that I Marker on the above "call route-filter" is like the community is not there.

The idea in my concept is(example):
- Test Prefix for Bogon, mark

- Test AS-Path for Bogon, mark

- Test RPKI, mark.
- On the botton, using the marks(communities) that I JUST DID, approve or refuse the route.


Is that logic correct?

What took me to believe that this concept wolud work is the help output of de action command:

[~MyNE40-xpl-filter] ?
Current view commands:
 !-comment   Comment beginning with '!'
 abort       Discard XPL definition and return to top level config
 apply       Set values in destination routing protocols
 approve     Approve this route for further processing
 break       Exit current filter and continue to run the parent filter
 call        Call a route filter
 display     Display current system information
 end-filter  End of route-filter definition
 finish      Accept this route with no further processing
 if          Begin if-statement
 refuse      Refuse this route with no further processing
 <cr>



I will give a simple exaple of how to test a community that was marked ona above "Call Route-Filter" is not working:


#

xpl route-filter BGP-Peer_MyCustomer_v4_import
 !

call route-filter Prefix_IsBogon_v4
 !
 call route-filter Action_Customer_v4_import
 !
end-filter
#

#

xpl route-filter Action_Customer_v4_import
 if not community matches-all PrefixIsBogon then  
   finish
 else
    refuse
 endif
end-filter
#


#

xpl route-filter Prefix_IsBogon_v4

if ip route-destination in Bogons_Prefixes_v4 then

  apply community PrefixIsBogon additive
 break !!!!!! in here i tried to use finish, or do not put it... no sucess!
endif
 break
end-filter
#
xpl ip-prefix-list Bogons_Prefixes_v4
0.0.0.0 8 le 32,
10.0.0.0 8 le 32,
100.64.0.0 10 le 32,
127.0.0.0 8 le 32,
169.254.0.0 16 le 32,
172.16.0.0 12 le 32,
192.0.2.0 24 le 32,
192.88.99.0 24 le 32,
192.168.0.0 16 le 32,
198.18.0.0 15 le 32,
198.51.100.0 24 le 32,
203.0.113.0 24 le 32,
224.0.0.0 4 le 32,
240.0.0.0 4 le 32
end-list
#
xpl community-list PrefixIsBogon
123:123
end-list
#

  • x
  • convention:

Featured Answers

Recommended answer

Admin Created Apr 18, 2020 02:28:56 Helpful(0) Helpful(0)

Posted by fischerdouglas at 2020-04-01 14:38 Sorry Chenhui!It was late in the night here in Brazil... I was already very sleepy.I messed up whe ...

Hi,

I think the XPL route-filter has the similar processing logical as the route policy. When the routes are matched in the previous route-filter, the reset route-filter will be ignored.

Take your configuration as an example,

#
xpl route-filter BGP-Peer_MyCustomer_v4_import
 call route-filter Prefix_IsBogon_v4
 call route-filter Action_Customer_v4_import
end-filter
#

When the routes matches the route-filter Prefix_IsBogon_v4, the process is over, no more route-filter will be excuted for the same routes.

View more
  • x
  • convention:

All Answers
Popeye_Wang Admin Created Apr 1, 2020 08:42:49 Helpful(0) Helpful(0)

Hello fischerdouglas,
It's nice to meet you in the community.
We're working on your problem. Please wait patiently.

View more
  • x
  • convention:

fischerdouglas Created Apr 1, 2020 08:54:28 Helpful(0) Helpful(0)

Another example of this same situation is when I need to invert the logic of communities used to "no-export".

In this case, I first apply all the three types of communities(in a list), and the I remove each of those my custumer tells-me the he doesnt want to be exported to.

It Doesn't work!
The programing logic is correct(I believe), but It doesn't execute the process as described.
It Just fiils with the three "export to" communities, but does not remove it as specified on the subsequent IFs.
xpl route-filter SetNoExport
apply community ExportToAllTypesOfPeers additive
!
if community matches-any NoExportToMyself then
apply community in ExportToMyself delete
endif
if community matches-any NoExportToCustomer then
apply community in ExportToCustomer delete
endif
if community matches-any NoExportToPeering then
apply community in ExportToPeering delete
endif
if community matches-any NoExportToTransit then
apply community in ExportToTransit delete
endif
break
end-filter
#
View more
  • x
  • convention:

chenhui Admin Created Apr 1, 2020 09:21:37 Helpful(0) Helpful(0)

Hi,
What is the addresses in the prefix-list Bogons_Prefixes_v4 used for?

#
xpl ip-prefix-list Bogons_Prefixes_v4
0.0.0.0 8 le 32,
10.0.0.0 8 le 32,
100.64.0.0 10 le 32,
127.0.0.0 8 le 32,
169.254.0.0 16 le 32,
172.16.0.0 12 le 32,
192.0.2.0 24 le 32,
192.88.99.0 24 le 32,
192.168.0.0 16 le 32,
198.18.0.0 15 le 32,
198.51.100.0 24 le 32,
203.0.113.0 24 le 32,
224.0.0.0 4 le 32,
240.0.0.0 4 le 32
end-list
#


In the routefilter Prefix_IsGogon_v4, you used the BGP community to match the prefix-list Bogons_Prefix_v4, which I think nothing will be matched. Kindly try use the route-source, route-destination or next-hop to match the prefix-list.

#

xpl route-filter Prefix_IsBogon_v4

if community matches-any Bogons_Prefixes_v4 then
 apply community PrefixIsBogon additive
 break !!!!!! in here i tried to use finish, or do not put it... no sucess!
endif
 break
end-filter


View more
  • x
  • convention:

fischerdouglas Created Apr 1, 2020 14:38:18 Helpful(0) Helpful(0)

Posted by chenhui at 2020-04-01 09:21 Hi, What is the addresses in the prefix-list Bogons_Prefixes_v4 used for?#xpl ip-prefix-list Bogons_ ...
Sorry Chenhui!

It was late in the night here in Brazil... I was already very sleepy.
I messed up when I was sanitizing the code to make it public.

The correct code is:

#
xpl route-filter Prefix_IsBogon_v4
if ip route-destination in Bogons_Prefixes_v4 then
apply community PrefixIsBogon additive
break !!!!!! in here i tried to use finish, or do not put it... no sucess!
endif
break
end-filter
#
View more
  • x
  • convention:

chenhui Admin Created Apr 18, 2020 02:28:56 Helpful(0) Helpful(0)

Posted by fischerdouglas at 2020-04-01 14:38 Sorry Chenhui!It was late in the night here in Brazil... I was already very sleepy.I messed up whe ...

Hi,

I think the XPL route-filter has the similar processing logical as the route policy. When the routes are matched in the previous route-filter, the reset route-filter will be ignored.

Take your configuration as an example,

#
xpl route-filter BGP-Peer_MyCustomer_v4_import
 call route-filter Prefix_IsBogon_v4
 call route-filter Action_Customer_v4_import
end-filter
#

When the routes matches the route-filter Prefix_IsBogon_v4, the process is over, no more route-filter will be excuted for the same routes.

View more
  • x
  • convention:

Comment

Comment
You need to log in to comment to the post Login | Register

Notice Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."
If the attachment button is not available, update the Adobe Flash Player to the latest version!

My Followers

Login and enjoy all the member benefits

Login

Huawei Enterprise Support Community
Huawei Enterprise Support Community
Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.