Community Lists; Community Numbers; Metacharacters; Table 5: Supported Regular Expression Metacharacters - Juniper JUNOSE SOFTWARE FOR E SERIES 11.3.X - IP SERVICES CONFIGURATION GUIDE 2010-10-01 Configuration Manual

Software for e series broadband services routers ip services configuration guide
Table of Contents

Advertisement

Community Lists

Example

Community Numbers

Metacharacters

Copyright © 2010, Juniper Networks, Inc.
For a community list, the input string is the community attribute of the routes to which
the list is applied using a route-map command. If the community attribute matches the
regular expression in the community list, the route matches the community list.
The following commands apply route map 5 to routes forwarded to BGP peer 10.5.5.4.
Route map 5 uses a regular expression to match community numbers ending with 305,
setting the weight of matching routes to 150.
host1(config-router)#neighbor 10.5.5.4 remote-as 425
host1(config-router)#neighbor 10.5.5.4 route-map 5 out
host1(config-router)#exit
host1(config)#route-map 5 permit 10
host1(config-route-map)#match community 305$
host1(config-route-map)#set weight 150
When you use a regular expression to match a community number, use the appropriate
format for the community number in the community list. If you issue the ip bgp-community
new-format command, the community number has the format AA:NN where AA is a
number that identifies the autonomous system, and NN is a number that identifies the
community within the autonomous system. Otherwise, the community number is an
integer in the range 1–4294967295.
Each regular expression consists of one or more metacharacters and zero or more
complete or partial AS or community numbers. Table 5 on page 43 describes the
metacharacters supported for regular expression pattern-matching.

Table 5: Supported Regular Expression Metacharacters

Metacharacter
Description
^
Matches the beginning of the input string.
Alternatively, when used as the first character within brackets—[^ ]—matches
any number except the ones specified within the brackets.
$
Matches the end of the input string.
.
Matches any single character, including white space.
*
Matches zero or more sequences of the immediately previous character or
pattern.
+
Matches one or more sequences of the immediately previous character or
pattern.
?
Matches zero or one sequence of the immediately previous character or pattern.
Chapter 1: Configuring Routing Policy
43

Advertisement

Table of Contents
loading

This manual is also suitable for:

Junose 11.3

Table of Contents