Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Junos CLI Reference
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

show route aspath-regex

date_range 19-Nov-23

Syntax

content_copy zoom_out_map
show route aspath-regex regular-expression
<logical-system (all | logical-system-name)>

Syntax (EX Series Switches)

content_copy zoom_out_map
show route aspath-regex regular-expression

Description

Display the entries in the routing table that match the specified autonomous system (AS) path regular expression.

Options

regular-expression

Regular expression that matches an entire AS path.

logical-system (all | logical-system-name)

(Optional) Perform this operation on all logical systems or on a particular logical system.

Additional Information

You can specify a regular expression as:

  • An individual AS number

  • A period wildcard used in place of an AS number

  • An AS path regular expression that is enclosed in parentheses

You also can include the operators described in the table of AS path regular expression operators in the Junos Policy Framework Configuration Guide. The following list summarizes these operators:

  • {m,n}—At least m and at most n repetitions of the AS path term.

  • {m}—Exactly m repetitions of the AS path term.

  • {m,}m or more repetitions of the AS path term.

  • *—Zero or more repetitions of an AS path term.

  • +—One or more repetitions of an AS path term.

  • ?—Zero or one repetition of an AS path term.

  • aspath_term | aspath_term—Match one of the two AS path terms.

    When you specify more than one AS number or path term, or when you include an operator in the regular expression, enclose the entire regular expression in quotation marks. For example, to match any path that contains AS number 234, specify the following command:

    content_copy zoom_out_map
    show route aspath-regex ".* 234 .*"
    

Required Privilege Level

view

Output Fields

For information about output fields, see the output field table for the show route command.

Sample Output

show route aspath-regex (Matching a Specific AS Number)

content_copy zoom_out_map
user@host> show route aspath-regex 65477   
inet.0: 46411 destinations, 46411 routes (46409 active, 0 holddown, 2 hidden)
+ = Active Route, - = Last Active, * = Both
 
111.222.1.0/25     *[BGP/170] 00:08:48, localpref 100, from 111.222.2.24
                   AS Path: [65477] ({65548 65536}) IGP
                     to 111.222.18.225 via fpa0.0(111.222.18.233)
111.222.1.128/25   *[IS-IS/15] 09:15:37, metric 37, tag 1
                     to 111.222.18.225 via fpa0.0(111.222.18.233)
                    [BGP/170] 00:08:48, localpref 100, from 111.222.2.24
                   AS Path: [65477] ({65548 65536}) IGP
                     to 111.222.18.225 via fpa0.0(111.222.18.233)
...

show route aspath-regex (Matching Any Path with Two AS Numbers)

content_copy zoom_out_map
user@host> show route aspath-regex ".* 234 3561 .*"
 
inet.0: 46351 destinations, 46351 routes (46349 active, 0 holddown, 2 hidden)
+ = Active Route, - = Last Active, * = Both
 
9.20.0.0/17        *[BGP/170] 01:35:00, localpref 100, from 131.103.20.49
                   AS Path: [666] 234 3561 2685 2686 Incomplete
                     to 192.156.169.1 via 192.156.169.14(so-0/0/0)
12.10.231.0/24     *[BGP/170] 01:35:00, localpref 100, from 131.103.20.49
                   AS Path: [666] 234 3561 5696 7369 IGP
                     to 192.156.169.1 via 192.156.169.14(so-0/0/0)
24.64.32.0/19      *[BGP/170] 01:34:59, localpref 100, from 131.103.20.49
                   AS Path: [666] 234 3561 6327 IGP
                     to 192.156.169.1 via 192.156.169.14(so-0/0/0)
...

Release Information

Command introduced before Junos OS Release 7.4.

footer-navigation