show route aspath-regex
Syntax
show route aspath-regex "regular-expression..."<brief | detail | extensive | terse><logical-router(all |logical-router-name)>Description
Display the entries in the routing table that match the specified BGP autonomous system (AS) path regular expression.
Options
regular-expression—Regular expression that matches an entire AS path.
brief | detail | extensive | terse—(Optional) Display the specified level of output.
logical-router (all |logical-router-name)—(Optional) Perform this operation on all logical routers or on a particular logical router.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 leastmand at mostnrepetitions of the AS path term.{m}—Exactlymrepetitions of the AS path term.{m,}—mor 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:
show route aspath-regex ".* 234 .*"Required Privilege Level
List of Sample Output
show route aspath-regex (matching a specific AS number)show route aspath-regex (matching any path with two AS numbers)Output Fields
routing-table-name—Name of the routing table (for example,inet.0).
destinations—Number of destinations for which there are routes in the routing table.
routes—Number of routes in the routing table:
active—Number of routes that are active.holddown—Number of routes that are in the hold-down state prior to being declared inactive.hidden—Number of routes not used because of routing policy.
[protocol/preference]—Protocol from which the route was learned and the route's preference value.
+—A plus sign before[protocol/preference]indicates the active route, which is the route installed from the routing table into the forwarding table.
-—A hyphen before[protocol/preference]indicates the last active route.
*—An asterisk before[protocol/preference]indicates that the route is both the active and the last active route. An asterisk before atoline indicates the best subpath to the route.
time—How long the route has been known.
localpref—Local preference value included in the route.
from—Address and interface from which route was learned.
AS Path—AS path included in the route.
[ ]—Brackets enclose the local AS number associated with the AS path if more than one AS number is configured on the router, or if AS path prepend is configured.
{ }—Braces enclose AS sets, which are groups of AS numbers in which the order does not matter. A set commonly results from route aggregation. The numbers in each AS set are displayed in ascending order.
( )—Parentheses enclose a confederation.
( [ ] )—Parentheses and brackets enclose a confederation set.show route aspath-regex (matching a specific AS number)
user@host>show route aspath-regex 65477inet.0: 46411 destinations, 46411 routes (46409 active, 0 holddown, 2 hidden)+ = Active Route, - = Last Active, * = Both111.222.1.0/25 *[BGP/170] 00:08:48, localpref 100, from 111.222.2.24AS Path: [65477] ({65488 65535}) IGPto 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 1to 111.222.18.225 via fpa0.0(111.222.18.233)[BGP/170] 00:08:48, localpref 100, from 111.222.2.24AS Path: [65477] ({65488 65535}) IGPto 111.222.18.225 via fpa0.0(111.222.18.233)...show route aspath-regex (matching any path with two AS numbers)
user@host>show route aspath-regex ".* 234 3561 .*"inet.0: 46351 destinations, 46351 routes (46349 active, 0 holddown, 2 hidden)+ = Active Route, - = Last Active, * = Both9.20.0.0/17 *[BGP/170] 01:35:00, localpref 100, from 131.103.20.49AS Path: [666] 234 3561 2685 2686 Incompleteto 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.49AS Path: [666] 234 3561 5696 7369 IGPto 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.49AS Path: [666] 234 3561 6327 IGPto 192.156.169.1 via 192.156.169.14(so-0/0/0)...