Routing

 View Only
last person joined: 2 days ago 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
  • 1.  regular expression for community member

    Posted 09-06-2022 02:40
    Hi,

    I want to control BGP community attribute through Juniper MX router.

    First, the pattern I want to control is as follows.

    1:00111
    1:00122
    1:00133

    1:10111
    1:10122
    1:10133

    As you can see, the pattern after : is divided into "0" or "1".
    So I looked at the content in the link below and set it up as in the example, but I found out that there is a problem with this part.
    Link: Understanding How to Define BGP Communities and Extended Communities

    The settings I applied are below.

    set policy-options community REGEX-COMM members ^1:(1.*)$                -> AS number is 1. Community value is any number that starts with 1.
    And I expected that only the community values below would match.
    1:10111
    1:10122
    1:10133

    However, all six communities were matched, and the reason was estimated that the equipment would recognize it as follows.

    1:00111 -> 1:111
    1:00122 -> 1:122
    1:00133 -> 1:133

    1:10111 -> 1:10111
    1:10122 -> 1:10122
    1:10133 -> 1:10133


    Can you please tell me what regex expression would be suitable for this case?

    Best Regards,


  • 2.  RE: regular expression for community member

    Posted 09-16-2022 12:21
    Hi there,
    The following expression will match the correct community strings:
    ^1:1\d{4}$​

    https://regex101.com/r/99UDXs/1

    cheers,
    Seb.



    ------------------------------
    SEB RUPIK
    ------------------------------