Routing Control Functions
This section discusses the following topics:
- Understanding RCF Language and Syntax
- Configuring RCF Functions
- Using RCF Code with Configuration Sessions
- RCF Function Show Commands
- Router Control Functions Commands
Overview
Routing Control Functions (RCF functions) provide a language for powerful and programmatically expressed route filtering and attribute modification logic. RCF Functions allow network administrators to create very granular and customized routing policies, especially within protocols such as BGP.
RCF configurations define RCF functions to apply at points of application or reused in other RCF functions. Each function consists of a sequence of statements evaluated in the order written. For example, the following RCF function accepts currently configured routes:
# Accept all routes as they are
function ACCEPT_ALL() {
return true;
}
The following RCF Function rejects all currently configured routes:
# Reject all routes unconditionally
function DENY_ALL() {
return false;
}
The following RCF Function sets the MED to 100 and accepts all routes:
# Set the med to 100 and accept all routes
function SET_MED() {
med = 100;
return true;
}

RCF Function Value Actions
- A function returns the value unknown if no explicit return statement specified.
- A return value of true from an RCF Function applied at a point where the RCF Function application accepts the route with all modifications. A return value of false or unknown rejects the route.
- If the point of the RCF Function application refers to an RCF Function not configured as part of the RCF code, all routes get rejected at that point of the RCF application. For example, if ACCEPT_ALL() applies to peer 192.168.1.1 inbound but no configuration exists for ACCEPT_ALL, the switch drops all updates from peer 192.168.1.1.
Reusing RCF Functions with Other RCF Functions
- Make conditional code executions using if or else.
# DEFAULT_ROUTE() returns if the prefix is 0.0.0.0/0 or ::/0 function DEFAULT_ROUTE() { return prefix is 0.0.0.0/0 or prefix is ::/0; } # All routes are accepted by FUNC_A(). If the route under review # is the default route, then the med is set to 100. function FUNC_A() { if DEFAULT_ROUTE() { med = 100; } return true; } - Delegate return value evaluation.
function DEFAULT_ROUTE() { return prefix is 0.0.0.0/0 or prefix is ::/0; } # Only accepts the default route. All other prefixes are rejected function FUNC_A() { # some RCF code return DEFAULT_ROUTE(); } - Apply a common set of path attribute modifications.
# Modify LOCAL_PREF and AS_PATH attributes. Note that # TAG_PEERS() returns 'unknown' implicitly since # no explicit 'return true' or 'return false' is # specified. function TAG_PEERS() { local_preference = 1000; as_path prepend 64501 64502; } # Reuse TAG_PEERS to apply a common set of path attribute # modifications. The return value of 'unknown' from # TAG_PEERS() is ignored. function FUNC_A() { TAG_PEERS(); return true; }
The RCF return value at the point of application maps to accepting routes, where the return value equals true, or rejecting routes, where the return value equals false or unknown. However, the return value of reused RCF functions does not have to accept or reject routes, as shown in the following example:

# Returns if the MULTI_EXIT_DISC is 200 after incrementing
# it by 100
function IS_INC_MED_200() {
med += 100;
return med is 200;
}
# MED_TEST() demonstrates that even though IS_INC_MED_200
# returns true, the route gets rejected because of the
# decision made in MED_TEST()
function MED_TEST() {
if IS_INC_MED_200() {
return false;
}
return true;
}
# Sets LOCAL_PREF for all routes (in the RCF evaluation
# engine) to 100. Return true only for 0.0.0.0/0; false
# for all other routes
function SET_LOCAL_PREF_IS_DEFAULT() {
local_preference = 100;
return prefix is 0.0.0.0/0;
}
# The return value (true/false) is returned as is from
# LOCAL_PREF_TEST() and thus accepts or rejects routes
function LOCAL_PREF_TEST() {
# some RCF code
return SET_LOCAL_PREF_IS_DEFAULT();
}
The RCF function allows reusing policy containers such as AS path lists, community lists, IPv4 prefix lists, or IPv6 prefix lists. If an RCF function contains references to undefined AS path lists, community lists, or prefix lists, the switch drops all routes evaluated at this point of RCF function application. Reusing RCF functions allows the use of arbitrary levels of if or else.
function COND_EXAMPLE() {
if med >= 100 {
if prefix is 0.0.0.0/0 {
local_preference = 200;
} else {
local_preference = 100;
}
return true;
} else {
return false;
}
}
RCF functions also support logical expressions using and, or, and not. These expressions return a value of true or false.
function EXPR_EXAMPLE() {
return not ( med >= 100 and ( not prefix match prefix_list_v4 DEFAULT_ROUTE or community match community_list CLIST ) );
}
The expressions can be short circuited in the following ways:
- With the and operator, if the first operand returns false or unknown, no evaluation of the second operand occurs.
function SET_MED() { med = 100; return true; } function SHORT_CIRCUITING_1() { return false and SET_MED(); # SET_MED() is never # evaluated } - With the or operator, if the first operand returns true, no evaluation of the second operand occurs.
function SET_MED() { med = 100; return true; } function SHORT_CIRCUITING_2() { return true or SET_MED(); # SET_MED() is never # evaluated }
By default, RCF functions run comparisons against modified path attributes. All modifications of path attributes take immediate effect inside the RCF evaluation engine. All subsequent reads and comparisons of the path attribute return the modified value.
function MOD_COMP_EXAMPLE() {
local_preference = 150;
return local_preference is 150; # Compares against modified value of local_preference
}
In addition, values of unmodified path attributes can be determined.
# FUNC() is applied as inbound RCF function
function FUNC() {
med = 10;
return input.med is 5 and # Compare the unmodified value and
med is 10; # the modified value. 'med is 10' is true.
}
RCF functions have the ability to perform sequential modifications of the same attribute in a user-defined order:
function COMM_MODIFICATIONS() {
community add community_list COMM_LIST1; # Add communities from COMM_LIST1
community remove community_list COMM_LIST2; # Next, remove communities from COMM_LIST2
return true;
}
Understanding RCF Language and Syntax
This topic contains the following sections:
- Comments
- Functions
- RCF Function Calls
- RCF Function Arguments
- Trilean Logic States
- Expressions
- Fallback Operator
- Logical Operators
- Sequential Operators
- Numerical Operators
- Return Statements
- Exit Statements
- Attribute Modification Statements
- if Conditions
- Immediate Values
- Attributes and Functions
- External References to EOS Policy Constructs
- External Reference Compilation Checks
- Using the input Attribute Scope
- Built-in Functions
Comments
Comments begin with a hash tag (#) character and continue to the end of the line. Comments can be placed anywhere in the code.
# This comment appears before a function
function DENY_ALL() {
# comments can appear inside functions too!
return false; # This function always returns false
}
Functions
The function syntax has the following format:
function <FUNCTION_NAME>() {
# statements
}
A function name can only contain letters, a-z, A-Z, numbers 0-9, and the underscore ( _ ) character and must start with a letter or an underscore.
Valid Name Examples
- MY_FUNCTION_11
- MyFunction11
- _good_function_11
Invalid Name Examples
- 9badFunctionName
- Bad Function Name
- -Bad-Function-Name
Function Calls
An RCF function (callee) can be called from another RCF function (caller), and an RCF function call can be used as part of an expression.
<CALLEE_FUNCTION_NAME>();
For example, the RCF function call has the following syntax:
function SET_MED() { med = 100; }
function ACCEPT_ALL() { return true; }
function CALLER() { return local_preference is 10 or ACCEPT_ALL(); }
When used as a standalone statement, it must be followed by a semicolon (;).
function SET_MED() { med = 100; }
function CALLER() {
SET_MED();
return true;
}
Function Arguments
RCF functions can optionally accept one or more comma-separated arguments. Functions that accept arguments cannot apply to a point of RCF application.
Define a function argument using one of the following:
- Argument Type
- Argument Name
An argument name must start with a dollar ($) sign followed by letters, a-z, A-Z, numbers 0-9 and the underscore ( _ ) character, such as $GoodArgument or $Good_Argument_11.
Apply functions that accept arguments at some points of the RCF application.
Functions reference arguments by name only and can be used in any of the following ways:
- To the right of a comparison operation
- To the left of a comparison operation
- To the right of a modification operation
- As an argument to a function call
In addition, a trilean type function argument can be used inside of logical and sequential expressions or as a return or exit value.
Use function arguments in the body of the function that defines them. For example,
function SET_MED( int_type $arg ) {
med = $arg;
}
An RCF function (caller) calling another RCF function that expects arguments (callee) must satisfy the following requirements:
- Number of passed arguments equals the number of callee arguments.
- Arguments passed in order.
- Caller argument types compatible with the expected argument types of the callee.
Example
Passing an immediate value as a function argument:
function SET_MED( int_type $arg, prefix_list_type $list ) {
if prefix match $list {
med = $arg;
}
}
function CALLER() {
SET_MED( 100, prefix_list_v4 KNOWN_V4_PREFIXES );
SET_MED( 100, prefix_list_v6 KNOWN_V6_PREFIXES );
return true;
}
Example
Passing an attribute as a function argument:
function PREPEND_ATTRIBUTE_REPEAT_4( as_number_type $arg ) {
as_path prepend $arg $arg $arg $arg;
}
function CALLER() {
PREPEND_ATTRIBUTE_REPEAT_4( med );
return true;
}
Example
Passing another function argument as a function argument:
function FUNC_C( int_type $arg ) {
local_preference = $arg;
}
function FUNC_B( int_type $arg ) {
FUNC_C( $arg );
}
function FUNC_A() {
FUNC_B( 100 );
return true;
}
Trilean Logic States
RCF functions support true, false, and unknown as trilean values.
Expressions
RCF functions use expressions composed of clauses of the following types:
- Comparisons
- local_preference is 100
- Match operations
- prefix match prefix_list_v4 ALLOW_ROUTES
- Function calls
- DEFAULT_ROUTE()
- Sequential operator expressions
- FUNC_A() ?? FUNC_B() ?? true
Fallback Operator
<FUNC1_NAME() fallback <FUNC2_NAME>()
<FUNC1_NAME>() fallback <FUNC2_NAME>() fallback <FUNC3_NAME>() fallback ...
- If the function invocation returns true, the evaluation of the expression terminates and the entire expression returns true.
- If the function invocation returns false, the evaluation of the expression terminates and the entire expression returns false.
- If the function invocation returns unknown, the fallback operator evaluation proceeds to the next term and repeats.
In summary, if a function can neither make a true or a false decision and returns unknown, the evaluation proceeds to the next term. If this process reaches the last term in the sequence, then the expression returns the value from the last function.
function PEER_192_168_1_1_IN() {
### RCF function for peer 192.168.1.1.
# If FUNC_GLOBAL() returns true (or false), accept (or reject) the
# route immediately.
# Otherwise, if FUNC_ASN100() returns true (or false), accept (or
# reject) the route immediately.
# Otherwise, return the result from evaluating FUNC_192_168_1_1_IN().
return FUNC_GLOBAL() fallback FUNC_ASN100() fallback FUNC_192_168_1_1_IN();
}
The trailing term can also be true, false, unknown, or a trilean argument. This allows defining the default return value when all function invocations return unknown.
function PEER_192_168_1_1_IN() {
### RCF function for peer 192.168.1.1.
# If the 3 function calls don't return an an explicit true or false,
# accept the route.
return FUNC_GLOBAL() fallback FUNC_ASN100() fallback FUNC_192_168_1_1_IN() fallback true;
}
function PEER_192_168_1_2_IN( trilean_type $arg ) {
### RCF function for peer 192.168.1.2.
return FUNC_GLOBAL() fallback FUNC_ASN100() fallback FUNC_192_168_1_2_IN() fallback $arg;
}
<FUNC1_NAME>() fallback <FUNC2_NAME>() is <true | false | unknown | <ARGUMENT>>
Comparing fallback operator, logical and, logical or, and statements
Use the four syntaxes with fallback operator fallback and, or, and functions in statements with (;) can be used to achieve different goals with function invocations. The following examples illustrate the difference.
| Function Example | Description |
|---|---|
function SEQ_OP() {
return FUNC1() fallback FUNC2();
}
|
FUNC2() evaluates conditionally and the result returned by SEQ_OP() only if FUNC1() evaluation returns unknown. |
function AND() {
return FUNC1() and FUNC2();
}
|
FUNC2() evaluates conditionally and the result returned by AND() only if FUNC1() returns true. |
function OR() {
return FUNC1() or FUNC2();
}
|
FUNC2() evaluates conditionally and the result returned by OR() only if FUNC1() returns false or unknown. |
function STMT() {
FUNC1();
return FUNC2();
}
|
FUNC1() always evaluated, and does not use the return value from this invocation. FUNC2()also always evaluates and the result returned by STMT(). |
Logical Operators
Combine expressions using logical operators such as and, or, and not to form complex expressions. Use parentheses () for grouping and setting precedence. The RCF evaluation engine evaluates the expression from left to right and honors the decreasing precedence of the evaluation:
- parentheses "( )"
- not
- and
- or
Examples
- local_preference is 100
- not prefix match prefix_list_v4 PREFIX_LIST_NAME
- DEFAULT_ROUTE() and ( local_preference >= 100 and community match community_list COMM_LIST ) or $arg
The not operator inverts the result of an expression.
| NOT | Operand | true | false | unknown |
|---|---|---|---|---|
| Result | false | true | true | |
Example
not prefix match prefix_list_v4 PREFIX_LIST_NAME
| AND | RHS | true | false | unknown |
|---|---|---|---|---|
| LHS | ||||
| true | true | false | false | |
| false | false | false | false | |
| unknown | false | false | false |
If the left operand of an and operation evaluates to false or unknown, no evaluation of the second operand occurs.
The and operator combines expressions so that both expressions must evaluate to true for the entire expression to evaluate to true.
| OR | RHS | true | false | unknown |
|---|---|---|---|---|
| LHS | ||||
| true | true | true | true | |
| false | true | false | false | |
| unknown | true | false | false |
If the left operand of an or operation evaluates to true, no evaluation of the second operand occurs.
The or operator combines expressions so that either of the expressions must evaluate to true for the entire expression to evaluate to true.
Sequential Operators
The sequential operator, ?? allows the conditional evaluation of functions in a sequence and has the following syntax:
<FUNC1_NAME>() ?? <FUNC2_NAME>()
The operator can be repeated to form longer sequences of function invocations:
<FUNC1_NAME>() ?? <FUNC2_NAME>() ?? <FUNC3_NAME>() ?? <FUNC4_NAME>()
The sequential operator evaluates the first function and takes one of the following actions:
- If the function invocation returns true, the evaluation of the expression terminates and the entire expression returns true.
- If the function invocation returns false, the evaluation of the expression terminates and the entire expression returns false.
- If the function invocation returns unknown, the sequential operator proceeds to the next function and repeats.
In summary, if a function cannot return a true or false decision, but returns an unknown decision, then the evaluation process proceeds to the next function. When the process reaches the last function in the sequence, the expression returns the value from the last function. For example,
function PEER_192_168_1_1_IN() {
### RCF function for peer 192.168.1.1.
# If FUNC_GLOBAL() returns true (or false), accept (or reject) the
# route immediately.
# Otherwise, if FUNC_ASN100() returns true (or false), accept (or
# reject) the route immediately.
# Otherwise, return the result from evaluating FUNC_192_168_1_1_IN().
return FUNC_GLOBAL() ?? FUNC_ASN100() ?? FUNC_192_168_1_1_IN();
}
The trailing term can be true, false, unknown or a trilean logic state. This allows defining the default return value when all function invocations return unknown.
function PEER_192_168_1_1_IN() {
### RCF function for peer 192.168.1.1.
# If the 3 function calls don't return an an explicit true or false,
# accept the route.
return FUNC_GLOBAL() ?? FUNC_ASN100() ?? FUNC_192_168_1_1_IN() ?? true;
}
function PEER_192_168_1_2_IN( trilean_type $arg ) {
### RCF function for peer 192.168.1.2.
return FUNC_GLOBAL() ?? FUNC_ASN100() ?? FUNC_192_168_1_2_IN() ?? $arg;
}
Comparing Sequential Expressions, Logical and Expressions, Logical or Expressions, and Statements
Use the four syntaxes with the sequential operator ??, and, or, and functions in statements with (;) to achieve different goals with function invocations. The following table illustrates the difference between the functions:
function SEQ_OP() {
return FUNC1() ?? FUNC2();
}
|
FUNC2() evaluates conditionally and returns the result by SEQ_OP() only if FUNC1() evaluation returns unknown. |
function AND() {
return FUNC1() and FUNC2();
}
|
FUNC2() evaluates conditionally and returns the result by AND() only if FUNC1() evaluation returns true. |
function OR() {
return FUNC1() or FUNC2();
}
|
FUNC2() evaluates conditionally and returns the result by OR() only if FUNC1() evaluation returns false or unknown. |
function STMT() {
FUNC1();
return FUNC2();
}
|
FUNC1() always evaluates. The return value from this invocation is not used. FUNC2() also always evaluates and returns a result by STMT(). |
Numerical Operators
Modification operators on numerical attributes do not allow the result to exceed the range of values valid for the attribute. For example, the result of local_preference += 100 becomes bounded by 4294967295 and med -= 10000 becomes bounded by 0.
Return Statements
The return statement returns the provided immediate value or the result from evaluating the provided expression to the caller.
return true | false | unknown | <ARGUMENT> | <EXPRESSION>;
The return statement requires a semicolon (;) at the end of the statement.
Example
function ALWAYS_TRUE() {
# Example of returning an immediate value
return true;
}
function DEFAULT_ROUTE() {
# Example of returning a comparison
return prefix is 0.0.0.0/0;
}
function RETURN_EXPR() {
# Example of returning the result of an expression
return ALWAYS_TRUE() and DEFAULT_ROUTE();
}
function RETURN_ARGUMENT( trilean_type $arg ) {
# Example of returning an argument
return $arg;
}
Exit Statements
The exit statement immediately stops the RCF evaluation and returns the provided immediate value or the result from evaluating the provided expression to the point of application. Use this value at the point of application to accept or reject the route.
exit true | false | unknown | <EXPRESSION>;
Examples
function MAYBE_EXIT_TRUE() {
# Example of function that may immediately exit true
if prefix is 1.2.3.0/24 {
exit true;
}
}
function MAYBE_SET_MED() {
# If MAYBE_EXIT_TRUE() exits, med does not set and the policy evaluates to
# true even though we do not explicitly handle it.
MAYBE_EXIT_TRUE();
med = 10;
return false;
}
Attribute Modification Statements
Attribute modification statements use the following syntax:
<ATTRIBUTE> <OPERATION> <VALUE>;
The statement requires a semicolon (;) at the end.
if Conditions
RCF allows an if construct followed by an optional else if and concluding with an optional else clause.
An if syntax without an else block:
if <EXPRESSION> {
# if block
}
An if syntax with an else block:
if <EXPRESSION> {
# if block
} else {
# else block
}
An if syntax with an else if block:
if <EXPRESSION1> {
# if block
} else if <EXPRESSION2> {
# else if block
} else {
# else block
}
Immediate Values
asdot notation
For operations that include AS number immediate values, four (4) byte AS numbers can be given in the asdot notation specified in RFC5396. For example,
as_path.origin_as is 1.10
Bandwidth Values
For operations that include bandwidth values, immediate values can be expressed as a number immediately followed by a unit. Supported units include bps, Bps, Kbps, Mbps, Gbps, KBps, MBps, and GBps. For example,
ecmp.aggregate_link_bandwidth is 200GBps ecmp.aggregate_link_bandwidth >= 12.25Mbps
MAC Address Notation
For operations that include MAC addresses, immediate values can use colon or dot notation. For example,
evpn.mac_ip_route.mac_address is 1a:2b:3c:4d:5e:6f evpn.mac_ip_route.mac_address is 1a2b.3c4d.5e6f
Ethernet Segment Identifier Notation
For operations that include Ethernet Segment Identifiers, structure immediate values as 5 groups of 4 hex characters each, delimited by colons. For example,
evpn.mac_ip_route.esi is AAAA:BBBB:CCCC:DDDD:EEEE
Sets
RCF functions support a set collection. A set consists of a collection of unique values. When multiple instances of the same value appear, only one takes effect.
community add { 100, 200, 300 }
community add { 100, 200, igp.tag }
Ranges
RCF supports a range construct with a lower and upper bound value. A value matches against a range if the following parameters true:
- The parameter has a value greater than or equal to the lower bound value.
- The parameter has a value less than or equal to the upper bound value.
If the lower bound value has a greater value than the upper bound value in a given range, no value matches against it. A range can be defined as part of a set collection. For example,
as_path.origin_as in { 64500, 64505 to 64510, 64503, 64515 to 64520 }
Attributes and Functions
The RCF function language provides a list of supported attributes that can be compared against values or modified. The language also includes built-in functions that provide some predefined functionality.
External References to EOS Policy Constructs
The RCF function can refer to policy constructs in the running config external to the RCF configuration called external references. Examples include AS path lists (as_path_list), route origin authorization (ROA) tables (roa_table), community lists (community_list), and extended/large community lists.
Refer to the following examples:
return prefix match prefix_list_v4 TEST_PREFIX_LIST; community add community_list TEST_COMM_LIST;
Define the policy constructs in the running config before referencing them in an RCF Function.
External Reference Compilation Checks
The command rcf external reference unconfigured action error command in the Router General Configuration Mode directs the RCF compiler to treat missing external references as compilation errors in all RCF configuration workflows.
switch(config)# router general switch(config-router-general)# command rcf external reference unconfigured action error
EOS disables this feature by default. When disabled, the RCF compiler treats missing external references as errors in interactive workflows such as configuring from the CLI or using configure sessions, and ignores missing external references in non-interactive workflows such as copying or replacing configurations. The following table provides a description of RCF behavior across various workflows:
| RCF Compilation Workflows | Default State/Disabled | Enabled |
|---|---|---|
| CLI | Error | Error |
| Configure session | Error | Error |
| Copy | Ignored | Error |
| Config replace | Ignored | Error |
| eAPI | Ignored | Error |
| OpenConfig | Ignored | Error |
Using the input Attribute Scope
The RCF evaluation engine provides access to the unmodified attribute values, as seen by the evaluation engine at the point of application, during the evaluation of the function.
router general
control-functions
code
function INPUT_AND_MODIFIED_LP_CHECK() {
return input.local_preference is 500 and
local_preference is 1000;
}
function INBOUND_POLICY() {
local_preference = 1000;
return INPUT_AND_MODIFIED_LP_CHECK();
}
EOF
!
In the example, local_preference modifies to 1000 for all paths in the INBOUND_POLICY(). However, INPUT_AND_MODIFIED_LP_CHECK() returns true only if thelocal_preference value at the start of the RCF evaluation has a value of 500.
Built-in Functions
The help function FUNCTION_NAME command displays information about a specified built-in function. For example, the help function set_next_hop_self displays the following output:
switch(config-router-general-control-functions)# help function set_next_hop_self
# set_next_hop_self
The set_next_hop_self function sets the NEXT_HOP to self for BGP advertisements. This unsets the value of the next_hop attribute.
This function is supported for IPv4 paths advertised out to peers with extended next hop support (RFC5549) negotiated.
## Return value
Type: trilean_type
This function returns true if it's invoked at a supported point of application, otherwise false.
## Example
function EXAMPLE() {
return set_next_hop_self();
}
Configuring RCF Functions
The EOS configuration contains the RCF unction code, and the supported workflows allow adding, modifying, and removing RCF function configurations. Perform RCF function code operations in the Router-General Configuration Mode using the control-functions configuration commands.
Adding RCF Function Code to the EOS Configuration
Use the following commands to add RCF function code to a pending buffer:
- edit - Write RCF function code using Nano, a built-in text editor.
- pull - Load RCF function code from a file.
- code - Provide RCF function code directly from the CLI.
- compile - Compile the RCF function code in the pending buffer of the CLI.
- commit - Commit the RCF function code in the pending buffer of the CLI into the running configuration after successfully compiling the code.
Use the following workflow to add the RCF Function configuration:

Modifying RCF Function Code
To modify the RCF function code, push the RCF function code to an external source where you can edit the code, and then pull the modified code into the pending buffer. Next, compile the code successfully and commit the successfully compiled code to the running-configuration.

Working with RCF Function Code Units
Organize RCF function code into named code units which consist of zero or more RCF functions. RCF function code units provide the smallest unit of RCF function configuration that you can commit to the running configuration. After compiling the RCF function code units, run the commit command to update all modified code units in the running configuration. RCF function code units have the following properties:
- Functions in one code unit may invoke functions in another code unit.
- Function names must be unique across all code units.
The following code example displays the usage of RCF function code units:
router general
control-functions
code unit COMMON
function DEFAULT_ROUTE() {
return prefix is 0.0.0.0/0 or prefix is ::/0;
}
EOF
code unit AS_65535_FUNCTIONS
function AS_65535_IN() {
# Rejects default route, accepts all other routes
if DEFAULT_ROUTE() {
return false;
}
return true;
}
function AS_65535_OUT() {
# Add a community and advertise all routes
community add { 64500:200 };
return true;
}
EOF
RCF Configuration Examples
Once RCF code units commit to the running configuration, they appear in the show running-config output. This preserves the ease of provisioning devices by EOS and keeps all system configurations in a single file.
Pulling, Compiling, and Committing an RCF Code Unit Example
The following example demonstrates RCF pulling, compiling, and then committing two RCF code units to a switch:
switch(config)# router general Arista(config-router-general)# control-functions Arista(config-router-general-control-functions)# pull unit A replace http://192.168.1.1/rcf-code-unit-a.txt Arista(config-router-general-control-functions)# pull unit B replace http://192.168.1.1/rcf-code-unit-b.txt Arista(config-router-general-control-functions)# compile Compilation successful Arista(config-router-general-control-functions)# commit Arista(config-router-general-control-functions)#
The router general command enters the Router General Configuration Mode, and the control-functions command enters the Control Functions Configuration Mode. The two pull commands retrieve the RCF code unit text from the specified locations. The compile command processes the RCF code units successfully, and the commit command puts the configuration into the running-config file.
Modifying and Committing an RCF Code Unit Example
The following example demonstrates taking an RCF code unit from the running-config file, modifying it, addressing any compilation errors, and committing the RCF code unit to the running-config file.
switch(config)# router general
switch(config-router-general)# control-functions
switch(config-router-general-control-functions)# push unit A flash:rcf-code-unit-a.txt
switch(config-router-general-control-functions)# bash vi /mnt/flash/rcf-code-unit-a.txt ! edit the contents
switch(config-router-general-control-functions)# pull unit A replace flash:rcf-code-unit-a.txt
h(config-router-general-control-functions)# compile
% Error (syntax): line 1:13: mismatched input '{' expecting '('
switch(config-router-general-control-functions)# push unit A flash:rcf-code-unit-a.txt ! optionally push the RCF code unit again
switch(config-router-general-control-functions)# bash vi /mnt/flash/rcf-code-unit-a.txt ! edit the contents to fix compilation errors
switch(config-router-general-control-functions)# pull unit A replace flash:rcf-code-unit-a.txt
switch(config-router-general-control-functions)# compile
Compilation successful
switch(config-router-general-control-functions)# commit
switch(config-router-general-control-functions)#
The router general command enters the Router-General Configuration Mode, and the control-functions command enters the Control-Functions Configuration Mode. The push command pushes the code unit to an external file, then executing the bash command allows editing of the code unit.The two pull commands retrieve the RCF code unit text from the specified location. The compile command runs unsuccessfully and exposes an error in the syntax of the code.
The next two commands push the RCF code to the specified destination where you can modify and fix any errors. The next pull command retrieves the corrected file and then the compile command reruns the compilation of the new code successfully. The modified RCF code unit replaces the previous code in the running-config.
Modifying an RCF Code Unit in the CLI
Add and modify RCF code units directly from the CLI using the edit unit unit_name command to open the GNU Nano text editor with the specified RCF code unit content or create a new one. Saving the file and closing the editor writes the content to the pending buffer.
switch(config)# router general switch(config-router-general)# control-functions switch(config-router-general-control-functions)# edit unit A ! edit the contents of a code unit switch(config-router-general-control-functions)# compile Compilation successful switch(config-router-general-control-functions)# commit switch(config-router-general-control-functions)#
The router general command enters the Router-General Configuration Mode, and the control-functions command enters the Control-Functions Configuration Mode. The edit unit A command opens the Nano editor to edit or add RCF code unit text. Once saved to the buffer, the compile command compiles the code and then the commit command adds the RCF code unit to the running-config.
Configuring RCF Points of Application
- Function Arguments - Invoke RCF Functions with one or more arguments.
- Functioning Sequencing with Fallback - Invoke multiple RCF functions using the Fallback Operator with support for passing arguments to each function.
Using RCF Code with Configuration Sessions
Add, modify, or delete RCF code using the configure session command described in the Configuration Sessions topic in the EOS User Guide. At the end of the session, use the commit command to add the changes to the running-config on the switch. You must commit the RCF changes while in the Router General Control Functions Configuration Mode and then again after exiting the configure session. If you exit the session before committing the changes, you lose the RCF code changes. The following example demonstrates using a configure session to commit RCF changes to the running-config:
switch(config)# configure session
switch(config-s-sess-2)# router general
switch(config-s-sess-2-router-general)# control-functions
switch(config-s-sess-2-router-general-control-functions)# pull unit A replace flash:rcf-code-unit-a.txt
switch(config-s-sess-2-router-general-control-functions)# compile
Compilation successful
switch(config-s-sess-2-router-general-control-functions)#commit ! RCF code commit
switch(config-s-sess-2-router-general-control-functions)#show session-config
...
router general
control-functions
code unit A
function ACCEPT_ALL() {
# Accepts all routes
return true;
}
function DENY_ALL() {
# Rejects all routes
return false;
}
EOF
...
switch(config-s-sess-2-router-general-control-functions)# exit
switch(config-s-sess-2-router-general)# commit ! session commit
Replacing the RCF Configuration
Use the configure replace url to replace the running configuration with contents from the specified URL. If the configuration from the URL fails to compile, the entire configure replace fails to complete and generates an error log at the end of the command execution.
Copying the RCF Configuration
Use the copy src_url running-config and copy src_url session-config commands to replace the full RCF code at the destination with the RCF code available at the source if the code compiles successfully. If the RCF code does not compile successfully, EOS ignores the configuration from the source URL. Compilation errors in the RCF code do not affect the copying of other configuration parameters present at the source.
RCF Compilation Errors
This topic contains the following sections:
- Missing Semicolon
- Missing Curly Brace
- Missing Operator
- Mismatching Types
- Mismatching Set Contents
- Undefined Reference
- Function Redefinition
- Function Call Cycles
RCF compilation provides some verification of the RCF code to ensure successful evaluation. When EOS invokes compilation for malformed RCF code, the code returns errors. The following sections describe some of the errors returned by EOS for malformed RCF code.
Missing Semicolon
router general
control-functions
code unit COMPILATION_ERROR
function SET_MED() {
med = 10
return true;
}
EOF
When compiled, the output contains the following error message:
% Error unit COMPILATION_ERROR line 2:17: missing ';'
2 med = 10
^
3 return true;
Missing Curly Brace
router general
control-functions
code unit COMPILATION_ERROR
function CHECK_MED() {
return med is 10;
function SET_MED() {
med = 10;
}
EOF
When compiled, the output contains the following error message:
% Error unit COMPILATION_ERROR line 3:6: missing '}' at 'function SET_MED'
2 return med is 10;
3 function SET_MED() {
^~~~~~~~~~~~~~~~
Missing Operator
If an expression lacks an operator, RCF cannot determine how to process the function. The following example has a expression without an operator between the attribute med and the value 10.
router general
control-functions
code unit COMPILATION_ERROR
function CHECK_MED() {
return med 10;
}
EOF
When compiled, the output contains the following error message:
% Error unit COMPILATION_ERROR line 2:20: no viable alternative at input 'med 10'
2 return med 10;
^~
Mismatching Types
The left and right side of an RCF operator must have interoperable types for the operator. The following example has a expression that compares a community set with an integer.
router general
control-functions
code unit COMPILATION_ERROR
function CHECK_COMMUNITY() {
return community is 10;
}
EOF
When compiled, the output contains the following error message:
% Error unit COMPILATION_ERROR line 2:16 (function 'CHECK_COMMUNITY'): invalid operation 'is' between 'community_type' and 'int_type'
2 return community is 10;
^~~~~~~~~~~~~~~
Mismatching Set Contents
An RCF must contain values with interoperable types. The following expressions defines a community set with invalid values or values from other set types.
router general
control-functions
code unit COMPILATION_ERROR
function SET_COMMUNITY() {
community = { MINE, 100, 200, 300, LINK-BANDWIDTH-AS:101:100.101MBps,
LEVEL2, 100:100:100
};
}
EOF
When compiled, the output contains the following error message:
% Error unit COMPILATION_ERROR line 2:23 (function 'SET_COMMUNITY'): invalid immediate values '{MINE, LINK-BANDWIDTH-AS:101:100.101MBps, LEVEL2, 100:100:100}' in an immediate community set
2 community = { MINE, 100, 200, 300, LINK-BANDWIDTH-AS:101:100.101MBps,
^~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 LEVEL2, 100:100:100
^~~~~~ ^~~~~~~~~~~
4 };
Undefined Reference
router general
control-functions
code unit COMPILATION_ERROR
function SET_AS_PATH() {
aspath prepend 10;
}
EOF
When compiled, the output contains the following error message:
% Error unit COMPILATION_ERROR line 2:8 (function 'SET_AS_PATH'): undefined reference to attribute 'aspath'
2 aspath prepend 10;
^~~~~~
Function Redefinition
For an RCF expression, define a function only once. The following expression defines two functions with the same name.
router general
control-functions
code unit FIRST_DEFINITION
function CHECK_MED() {
if med is 10 {
return true;
}
}
EOF
code unit SECOND_DEFINITION
function CHECK_MED() {
if med is 20 {
return false;
}
}
EOF
When compiled, the output contains the following error message:
% Error unit FIRST_DEFINITION line 1:6: redefinition of function 'CHECK_MED'
1 function CHECK_MED() {
^~~~~~~~~~~~~~~~~~
Previously defined in code unit SECOND_DEFINITION:
1 function CHECK_MED() {
^~~~~~~~~~~~~~~~~~
Function Call Cycles
An RCF function cannot directly or indirectly call itself as displayed in the following expression:
router general
control-functions
code unit UNIT_A
function A() {
return B();
}
EOF
code unit UNIT_B
function B() {
return true or C();
}
EOF
code unit UNIT_C
function C() {
if ( false or A() or false) {
return true;
}
}
EOF
When compiled, the output contains the following error message:
% Error: cycle found in function callgraph 'A -> B -> C -> A'
Code unit UNIT_A
1 function A() {
^~~~~~~~~~
2 return B();
^~~
Code unit UNIT_B
1 function B() {
^~~~~~~~~~
2 return true or C();
^~~
Code unit UNIT_C
1 function C() {
^~~~~~~~~~
2 if ( false or A() or false) {
^~~
Code unit UNIT_A
1 function A() {
^~~~~~~~~~
RCF Function Show Commands
Displaying Pending RCF Function Configurations
The show router rcf pending command in the Global Configuration Mode or the show pending in the Router General Control Functions Configuration Mode displays the contents of the CLI session pending buffer. The output also displays the source of the RCF code unit pull at the top of the uncommitted RCF code.
These commands also display the contents of all RCF code units that take effect after committing the code. The output displays all code units whether or not changes have occurred in the pending buffer.
If the code has no pending changes to commit, the output displays the message, No pending routing control function changes at the top of the show command output.
switch(config)# router general
switch(config-router-general)# control-functions
switch(config-router-general-control-functions)# pull unit A replace flash:rcf-code-unit-a.txt
switch(config-router-general-control-functions)# show pending
code unit A
! Source: file:/tmp/rcf-code-unit-a.txt
function ACCEPT_ALL() {
# Accepts all routes
return true;
}
function DENY_ALL() {
# Rejects all routes
return false;
}
EOF
switch(config-router-general-control-functions)# compile
Compilation successful
switch(config-router-general-control-functions)# commit
switch(config-router-general-control-functions)# show pending
No pending routing control function changes
code unit A
! Source: file:/tmp/rcf-code-unit-a.txt
function ACCEPT_ALL() {
# Accepts all routes
return true;
}
function DENY_ALL() {
# Rejects all routes
return false;
}
EOF
switch(config-router-general-control-functions)#
Displaying the Difference between the Pending Buffer and the Running Configuration
The show diff command in the Router General Control Functions Configuration Mode displays the difference between the RCF Function code units in the pending buffer and the RCF Function code units in the running-config.
switch(config-router-general-control-functions)# pull unit A replace file:/tmp/rcf-code-unit-a-2.txt
switch(config-router-general-control-functions)# compile
Compilation successful
switch(config-router-general-control-functions)# show diff
--- running-config: code unit A
+++ pending: code unit A
@@ -7,3 +7,7 @@
# Rejects all routes
return false;
}
+
+function DEFAULT_ROUTE() {
+ return prefix is 0.0.0.0/0 or prefix is ::/0;
+}
switch(config-router-general-control-functions)#
Displaying an Active RCF Configuration
The show active command in the Router General Control Functions Configuration Mode displays the configured RCF Function code units in the running-config.
switch(config-router-general-control-functions)# show active
router general
control-functions
code unit A source pulled-from flash:rcf-code-unit-a.txt
code unit A
function ACCEPT_ALL() {
# Accepts all routes
return true;
}
function DENY_ALL() {
# Rejects all routes
return false;
}
EOF
switch(config-router-general-control-functions)#
Displaying RCF Code Units
The show router rcf code unit unit_name command in the Router General Control Functions Configuration Mode displays the committed RCF code units in the running-config. RCF code units committed in a configure session only display when the configure session commits changes.
switch(config-router-general-control-functions)# show router rcf code unit A
function ACCEPT_ALL() {
# Accepts all routes
return true;
}
Displaying RCF Functions
The show router rcf function func_name command displays the committed RCF function definition in the running configuration. The RCF functions committed in a config session display only after committing the config session.
Example
Configure the following RCF functions and then display the configuration. Specifying a built-in function or a non-existent function returns an error.
router general
control-functions
code
function testA() {
med = 10;
return true;
}
EOF
code unit unit2
function testC() {
med = 20;
return true;
}
function testB() {
med = 30;
return true;
}
EOF
code unit unit3
function testD() {
return true;
}
EOF
Use the following commands to display the functions:
Arista(config-router-general-control-functions)# show router rcf function testA
function testA() {
med = 10;
return true;
}
Arista(config-router-general-control-functions)# show router rcf function testB
function testB() {
med = 30;
return true;
}
Arista(config-router-general-control-functions)# show router rcf function testC
function testC() {
med = 20;
return true;
}
Arista(config-router-general-control-functions)# show router rcf function testD
function testD() {
return true;
}
Displaying RCF Function Locations
The show router rcf function location function function_name unit unit_name command displays the code unit name and starting line number within the code unit for committed RCF function definitions.
Sample RCF Function Configuration
router general
control-functions
code
function testA() {
med = 10;
return true;
}
EOF
code unit unit2
function testC() {
med = 20;
return true;
}
function testB() {
med = 30;
return true;
}
EOF
code unit unit3
function testD() {
return true;
}
EOF
The show output displays all RCF functions across all code units:
switch(config-router-general-control-functions)# show router rcf function location Function Name Code Unit Line Number ------------- ----------------- ----------- testA unnamed code unit 1 testB unit2 6 testC unit2 1 testD unit3 1
Locate all functions in an RCF code unit by adding the unit unit_name filter to the command
switch(config-router-general-control-functions)# show router rcf function location unit unit2 Function Name Code Unit Line Number ------------- --------- ----------- testB unit2 6 testC unit2 1
Router Control Functions Commands
Router General Configuration Mode
Router Control Functions Commands
Show Commands
code
The code command allows you to add RCF code directly to the switch through the CLI. Access the command through the Router General Control Functions Configuration Mode. Enter the RCF code and type EOF to return to the CLI to end the code entry.
Command Mode
Router General Control Functions Configuration
Command Syntax
code
Example
switch(config)# router general
switch(config-router-general)# control-functions
switch(config-router-general-control-function)# code
Enter RCF code. Type 'EOF' on its own line to end.
# Accept all routes as they are
function ACCEPT_ALL() {
return true;
}
# Reject all routes unconditionally
function DENY_ALL() {
return false;
}
# Set the med to 100 and accept all routes
function SET_MED() {
med = 100;
return true;
}
EOF
switch(config-router-general-control-function)#
The example code accepts and rejects routes based on the configuration.
code unit
The code unit command allows the organization of RCF code into named code units. A code unit consists of zero or more RCF functions and provides the smallest unit of RCF configuration to commit to the running-config. Access this command through the Router General Control Functions Configuration Mode.
Command Mode
Router General Control Functions Configuration Mode
Command Syntax
code unit unit_name
Parameters
- code unit unit_name - Enter a name for the code unit function. Function names must be unique across all RCF code units.
Example
Use the following commands to create an RCF code unit with the name BGPRoute:
switch(config)# router general
switch(config-router-general)# control-functions
switch(config-router-general-control-function)# code unit BGPRoute
Enter RCF code. Type 'EOF' on its own line to end.
function AS_65535_OUT() {
# Add a community and advertise all routes
community add { 64500:200 };
return true;
}
EOF
switch(config-router-general-control-function)#
commit
The commit command adds all modified code units from the pending buffer to the running-config. Access this command in the Router General Control Functions Configuration Mode.
Command Mode
Router General Control Functions Configuration Mode
Command Syntax
commit
Example
switch(config)# router general switch(config-router-general)# control-functions switch(config-router-general-control-functions)# commit
compile
The compile command compiles all modified code units from the pending buffer and unmodified code units from the running configuration. Access this command in the Router General Control Functions Configuration Mode.
Command Mode
Router General Control Functions Configuration Mode
Command Syntax
compile
Example
switch(config)# router general switch(config-router-general)# control-functions switch(config-router-general-control-functions)# compile Compilation successful
control-functions
The control-functions command enters the Router Control Functions Configuration Mode. From this configuration mode, configure Router Control Functions.
Command Mode
Router General Configuration Mode
Command Syntax
control-functions
Example
switch(config)# router general switch(config-router-general)# control-functions switch(config-router-general-control-functions)#
discard
The discard command discards the contents of the pending buffer for the specified code unit, or all code units if specified. Access the command through the Router General Control Functions Configuration Mode.
Command Mode
Router General Control Functions Configuration Mode
Command Syntax
discard [unit unit_name | all
Parameters
- unit unit_name - Specify the name of the code unit to discard changes from the pending buffer.
- all - Specify to discard all changes from the pending buffer.
- Use the following command to discard changes for code unit, TestB, from the pending buffer.
switch(config-router-general-control-functions)# discard TestB
- Use the following command to discard all changes from the pending buffer:
switch(config-router-general-control-functions)# discard all
edit
The edit command allows you to edit RCF code using a GNU nano text editor. Access the command through the Router General Control Functions Configuration Mode. Enter the RCF code and type EOF to end the code entry. Exit the nano editor using the keyboard command Ctrl+X.
Command Mode
Router General Control Functions Configuration Mode
Command Syntax
edit
Example
switch(config)# router general switch(config-router-general)# control-functions switch(config-router-general-control-function)# edit

switch(config-router-general-control-functions)#
help attribute
The help attribute command in the Router General Control Functions Configuration Mode displays information about a specified attribute in an RCF function.
Command Mode
Router General Control Functions Configuration
Command Syntax
help attribute attribute_name
Parameters
help attribute attribute_name - Specify an attribute name in an RCF function and display help information about it.
Example
Use the following command to display help information about the attribute med:
switch(config)# router general
switch(config-router-general)# control-functions
switch(config-router-general-control-function)# help attribute med
# med
The med attribute will contain the MULTI_EXIT_DISC as defined in RFC4271 section 5.1.4.
The med attribute can be modified.
input.med provides the unmodified attribute value.
Type: int_type
A whole number.
Attributes and arguments of type as_number_type can be used in operations that support this type.
Attributes, arguments, and immediate values of this type can be passed as arguments to functions expecting an argument of type int_type.
Example function argument usage with comparison operation:
function CALLEE( int_type $argument ) {
return med is $argument;
}
function CALLER() {
return CALLEE( 42 );
}
Example immediate values:
* 1
* 10
* 255
+----------------------------------------------+--------------------------------------+
| Condition operations | Example |
+----------------------------------------------+--------------------------------------+
| med is <int_type> | function EXAMPLE() { |
| | return med is 0; |
| Evaluates to true if the left side is equal | } |
| to the right side. | |
+----------------------------------------------+--------------------------------------+
+--------------------------------------------------------------+----------------------+
| Modification operations | Example |
+--------------------------------------------------------------+----------------------+
| med = <int_type> | function EXAMPLE() { |
| | med = 1024; |
| Assigns the value of the right side to the left side. | return true; |
| | } |
+--------------------------------------------------------------+----------------------+
help function
The help function command in the Router General Control Functions Configuration Mode displays information about a specified built-in function.
Command Mode
Router General Control Functions Configuration
Command Syntax
help function function_name
Parameters
help function function_name - Specify a built-in function name and display help information about it.
Example
Use the following command to display help information about the function set_next_hop_self:
Arista(config-router-general-control-functions)# help function set_next_hop_self
# set_next_hop_self
The set_next_hop_self function sets the NEXT_HOP to self for BGP advertisements. This unsets the value of the next_hop attribute.
This function is supported for IPv4 paths advertised out to peers with extended next hop support (RFC5549) negotiated.
## Return value
Type: trilean_type
This function returns true if it's invoked at a supported point of application, otherwise false.
## Example
function EXAMPLE() {
return set_next_hop_self();
}
pull
The pull command allows the population of the pending buffer for the specified code unit with the contents of the file located at the specified URL. Pulling in unnamed code units compiles the code automatically. Access the command through the Router General Control Functions Configuration.
Command Mode
Router General Control Functions Configuration
Command Syntax
pull arg
Parameters
arg - Enter a URL or other file location to pull the RCF code. to the switch.
Example
switch(config)# router general
switch(config-router-general)# control-functions
switch(config-router-general-control-function)# pull http://www.mysite.com/file
Saving config with label http://www.mysite.com/file.2025-03-24-1719.txt and timestamp to startup-config.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
> copy tftp://tactools.sjc.aristanetworks.com/configs/push-pull/tg213.http://www.mysite.com/file.2025-03-24-1719.txt..txt flash:startup-config
switch(config-router-general-control-function)#
The example code pulls the RCF code with the filename, file.2025-03-24-1719.txt, from an external site. Compile the RCF code and commit the code to the running configuration.
push
The push command pushes the content of the specified code unit from the pending buffer to the location identified by the URL. If the contents have not changed,the switch uses the code unit contents from the running-config. Access the command through the Router General Control Functions Configuration Mode.
Command Mode
Router General Control Functions Configuration Mode
Command Syntax
push arg
Parameters
push arg - Enter a URL or other file location to push the RCF for editing externally.
Example
switch(config)# router general switch(config-router-general)# control-functions switch(config-router-general-control-function)# push http://www.mysite.com/file Attempting to save configuration using label "http://www.mysite.com/file" and timestamp 2025-03-24-1719 Saving to tftp://tactools.sjc.aristanetworks.com/configs/push-pull/tg213.http://www.mysite.com/file.2025-03-24-1719.txt Restore this configuration by executing "pull http://www.mysite.com/file 2025-03-24-1719" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 3757 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 3757 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 > copy running-config tftp://tactools.sjc.aristanetworks.com/configs/push-pull/tg213.http://www.mysite.com/file.2025-03-24-1719.txt switch(config-router-general-control-function)#
The example code pushes the RCF code to an external site with the filename file.2025-03-24-1719.txt. Edit the file using a text editor and then use the pull command to add the modified configuration to the switch.
show active
The show active command in the Router General Control Functions Configuration Mode displays the configured RCF Functions on the switch.
Command Mode
Router General Control Functions Configuration Mode
Command Syntax
show active [all]
Parameters
all - Displays configuration with default values.
Example
switch(config-router-general-control-functions)# show active
router general
control-functions
code unit A source pulled-from flash:rcf-code-unit-a.txt
code unit A
function ACCEPT_ALL() {
# Accepts all routes
return true;
}
function DENY_ALL() {
# Rejects all routes
return false;
}
EOF
switch(config-router-general-control-functions)#
The output displays code unit A in the configuration.
show diff
The show diff command in the Router General Control Functions Configuration Mode displays the difference between the RCF code units in the pending buffer and the RCF code units in the running configuration.
Command Mode
Router General Control Functions Configuration
Command Syntax
show diff
Example
switch(config-router-general-control-functions)# pull unit A replace file:/tmp/rcf-code-unit-a-2.txt
switch(config-router-general-control-functions)# compile
Compilation successful
switch(config-router-general-control-functions)# show diff
--- running-config: code unit A
+++ pending: code unit A
@@ -7,3 +7,7 @@
# Rejects all routes
return false;
}
+
+function DEFAULT_ROUTE() {
+ return prefix is 0.0.0.0/0 or prefix is ::/0;
+}
switch(config-router-general-control-functions)#
From the output, the difference, DEFAULT_ROUTE,displays in text surrounded by a plus (+) sign.
show pending
The show pending command in the Router General Control Functions Configuration mode displays the contents of the CLI session pending buffer. The output also displays the source of the RCF code unit pull at the top of the uncommitted RCF code unit.
These commands also display the contents of all RCF code units that take effect after committing the code. The output displays all code units whether or not changes have occurred in the pending buffer.
If the code has no pending changes to commit, the output displays the message, No pending routing control function changes at the top of the show command output.
Command Mode
Router General Control Functions Configuration Mode
Command Syntax
show pending
Example
switch(config)# router general
switch(config-router-general)# control-functions
switch(config-router-general-control-functions)# pull unit A replace flash:rcf-code-unit-a.txt
switch(config-router-general-control-functions)# show pending
code unit A
! Source: file:/tmp/rcf-code-unit-a.txt
function ACCEPT_ALL() {
# Accepts all routes
return true;
}
function DENY_ALL() {
# Rejects all routes
return false;
}
EOF
switch(config-router-general-control-functions)# compile
Compilation successful
switch(config-router-general-control-functions)# commit
switch(config-router-general-control-functions)# show pending
No pending routing control function changes
code unit A
! Source: file:/tmp/rcf-code-unit-a.txt
function ACCEPT_ALL() {
# Accepts all routes
return true;
}
function DENY_ALL() {
# Rejects all routes
return false;
}
EOF
switch(config-router-general-control-functions)#
The output displays code unit A as pending in the CLI session buffer. Executing the compile command invokes the RCF compilation engine and compiles the code unit. Executing the commit command saves the changes to the running-config. Rerunning the show pending displays the No pending routing control function changes at the top of the show command output.
show router rcf code unit
The show router rcf code unit unit_name command in the Router General Control Functions Configuration Mode displays the committed RCF code units in the running-config. RCF code units committed in a configure session only display when the configure session commits changes.
Command Mode
Router General Control Functions Configuration Mode
Command Syntax
show router rcf code unit unit_name
Parameters
unit_name - Specify the name of the RCF code unit to display information.
Example
switch(config-router-general-control-functions)# show router rcf code unit A
function ACCEPT_ALL() {
# Accepts all routes
return true;
}
show router rcf function location
The show router rcf function location function function_name unitunit_name command in the Router General Control Functions Configuration Mode displays the code unit name and starting line number within the code unit for committed RCF function definitions.
Command Mode
Router General Control Functions Configuration Mode
Command Syntax
show router rcf function location [function function_name][unitunit_name]
Parameters
- function function_name - Filter the output by RCF function.
- unit unit_name - Filter the output by RCF code unit.
Example
router general
control-functions
code
function testA() {
med = 10;
return true;
}
EOF
code unit unit2
function testC() {
med = 20;
return true;
}
function testB() {
med = 30;
return true;
}
EOF
code unit unit3
function testD() {
return true;
}
EOF
switch(config-router-general-control-functions)# show router rcf function location Function Name Code Unit Line Number ------------- ----------------- ----------- testA unnamed code unit 1 testB unit2 6 testC unit2 1 testD unit3 1
switch(config-router-general-control-functions)# show router rcf function location unit unit2 Function Name Code Unit Line Number ------------- --------- ----------- testB unit2 6 testC unit2 1
RCF - BGP Agent Support
This section covers the following topics:
- Configuring an RCF Function for BGP Points of Applications
- Displaying the Operational Status of the RCF
Configuring RCF for BGP Points of Applications
RCF functions filter routes and update route attributes at different points of application in BGP.
Configuring an Instance
The following configuration statements allow filtering and modifying path attributes while instantiating IPv4 Unicast and IPv6 Unicast AFI/SAFI paths from the respective sources such as the RIB, VPN AFI/SAFI, and more.
Redistribute Statement
| Syntax | Example |
|---|---|
router bgp ASN
[ vrf NAME ]
redistribute connected rcf FUNCTION_NAME()
|
router bgp 64500 redistribute connected rcf CONNECTED_POLICY() |
| Syntax | Example |
|---|---|
router bgp ASN
[ vrf NAME ]
redistribute dynamic rcf FUNCTION_NAME()
|
router bgp 64500 redistribute dynamic rcf DYNAMIC_POLICY() |
| Syntax | Example |
|---|---|
router bgp ASN
[ vrf NAME ]
redistribute user rcf FUNCTION_NAME()
|
router bgp 64500 redistribute user rcf EOS_SDK_POLICY() |
| Syntax | Example |
|---|---|
router bgp ASN
[ vrf NAME ]
redistribute isis ( level-1 | level-2 | level-1-2 ) rcf
FUNCTION_NAME()
|
router bgp 64500 redistribute isis level-1 rcf LEVEL_1_POLICY() |
| Syntax | Example |
|---|---|
router bgp ASN
[ vrf NAME ]
redistribute ospf [match (internal | external | nssa-external)]
rcf ()
|
router bgp 64500 redistribute ospf ospf external rcf EXTERNAL_POLICY() |
| Syntax | Example |
|---|---|
router bgp ASN
[ vrf NAME ]
redistribute static rcf FUNCTION_NAME()
|
router bgp 64500 redistribute static rcf STATIC_POLICY() |
MPLS L3 VPN import
The IMPORT_FUNCTION_NAME() function applies to the unicast route created on import. The unicast route attributes populate with the BGP Customer Attribute Set per RFC 6368 if it exists, otherwise, the function uses the VPN path attributes.
The VPN_FUNCTION_NAME() function applies to the VPN route imported using the provider attributes. Modifications to path attributes in the VPN_FUNCTION_NAME() function don't apply to the provider path.
| Syntax | Example |
|---|---|
router bgp ASN
[ vrf NAME ]
route-target import ( vpn-ipv4 | vpn-ipv6 ) rcf IMPORT_FUNCTION_NAME()
[ vpn-route filter-rcf VPN_FUNCTION_NAME() ]
|
router bgp 64500
vrf VRF1
route-target import vpn-ipv4 rcf IMPORT_POLICY() vpn-route
filter-rcf FILTER_VPN_ROUTES()
|
MPLS L3 VPN export
The EXPORT_FUNCTION_NAME() function applies to the unicast route created on export. The unicast route path attributes populate a BGP Customer Attribute Set if the iBGP as PE-CE Protocol fr BGP/MPLS L3 VPNS configured per RFC 6368, these attributes do not modify in the policy.
The VPN_FUNCTION_NAME() function applies to the VPN route exported. Modifications to path attributes in the VPN_FUNCTION_NAME() function apply to the provider path.
| Syntax | Example |
|---|---|
router bgp ASN
[ vrf NAME ]
route-target export ( vpn-ipv4 | vpn-ipv6 )
rcf EXPORT_FUNCTION_NAME()
[ vpn-route filter-rcf VPN_FUNCTION_NAME() ]
|
router bgp 64500
vrf VRF1
route-target export vpn-ipv4 rcf EXPORT_POLICY() vpn-route
filter-rcf FILTER_VPN_ROUTES()
route-target export vpn-ipv6 rcf EXPORT_POLICY() vpn-route
filter-rcf FILTER_VPN_ROUTES()
|
L3 EVPN import
The IMPORT_FUNCTION_NAME() function applies to the unicast route created on import.
| Syntax | Example |
|---|---|
router bgp ASN
[ vrf NAME ]
route-target import evpn rcf IMPORT_FUNCTION_NAME()
|
router bgp 64500
vrf VRF1
route-target import evpn rcf IMPORT_POLICY()
|
L3 EVPN export
The EXPORT_FUNCTION_NAME() function applies to the EVPN route created on export.
| Syntax | Example |
|---|---|
router bgp ASN
[ vrf NAME ]
route-target export evpn rcf EXPORT_FUNCTION_NAME()
|
router bgp 64500
vrf VRF1
route-target export evpn rcf IMPORT_POLICY()
|
EVPN VPWS Route Export
| Syntax | Example |
|---|---|
router bgp ASN
vpws evpn instance
route-target export evpn rcf FUNCTION_NAME()
|
router bgp 1
vpws evi1
route-target export evpn rcf EX PORT_POLICY()
|
Aggregate-Address Configuration
The AGGREGATE_ATTRIBUTES_FUNCTION_NAME() function uses the generated aggregate route and the aggregate path attributes of the aggregate contributor roles as input to the function.
| Syntax | Example |
|---|---|
router bgp ASN
aggregate-address prefix as-set attribute rcf
AGGREGATE_ATTRIBUTES_FUNCTION_NAME()
|
router bgp 64500
aggregate-address 192.0.2.0/24 attribute rcf AGGREGATE_FUNCTION()
|
IPv4 and IPv6 Labeled Unicast
Inbound BGP Neighbor Application
| Syntax | Example |
|---|---|
address-family ( ipv4 | ipv6 ) labeled-unicast
neighbor ( NEIGHBOR> | PEER_GROUP ) rcf in FUNCTION_NAME()
|
router bgp 64500
address-family ipv4 labeled-unicast
neighbor 192.0.2.1 rcf in INBOUND_POLICY()
address-family ipv6 labeled-unicast
neighbor 192.0.2.1 rcf in INBOUND_POLICY()
|
Outbound BGP Neighbor Application
| Syntax | Example |
|---|---|
address-family ( ipv4 | ipv6 ) labeled-unicast neighbor ( NEIGHBOR> | PEER_GROUP ) rcf out FUNCTION_NAME() |
router bgp 64500
address-family ipv4 labeled-unicast
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY()
address-family ipv6 labeled-unicast
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY()
|
LDP Tunnel Distribution
Only the IPv4 Labeled Unicast Address Family supports LDP tunnel redistribution.
| Syntax | Example |
|---|---|
address-family ipv4 labeled-unicast tunnel source-protocol ldp rcf FUNCTION_NAME() |
router bgp 64500
address-family ipv4 labeled-unicast
tunnel source-protocol ldp rcf LDP_POLICY()
|
IS-IS Segment Routing Tunnel Redistribution
Only the IPv4 Labeled Unicast Address Family supports IS-IS Segment Routing Tunnel Redistribution.
| Syntax | Example |
|---|---|
address-family ipv4 labeled-unicast tunnel source-protocol isis segment-routing rcf FUNCTION_NAME() |
router bgp 64500
address-family ipv4 labeled-unicast
tunnel source-protocol isis segment-routing rcf SR_POLICY()
|
IPv4 and IPv6 Unicast Address Family
This topic contains the following sections:
- Unicast Aggregate-Address Attribute
- Unicast Aggregate-Address Match
- Unicast Default Route Export to L3 EVPN
- Unicast Default Route Export to MPLS L3 VPN
- Unicast Dynamic Prefix List
- Unicast Export Filter to MPLS L3 VPN
- Unicast Export to EVPN VPWS
- Unicast Export to L3 EVPN
- Unicast Export to MPLS L3 VPN
- Unicast Import Filter From MPLS L3 VPN
- Unicast Import from L3 EVPN
- Unicast Import From MPLS L3 VPN
- Unicast Inbound BGP Neighbor Application
- Unicast Outbound BGP Neighbor Application
- Unicast Redistribute Connected
- Unicast Redistribute Dynamic
- Unicast Redistribute EOS SDK
- Unicast Redistribute gRIBI
- Unicast Redistribute IS-IS
- Unicast Redistribute Leaked BGP
- Unicast Redistribute OSPF
- Unicast Redistribute Static
- Unicast Network Statement
- Unicast Outbound BGP Neighbor Default Route Originate Application
- Next Hop Resolution RIBS
Unicast Aggregate-Address Attribute
EOS evaluates the RCF based on the generated route.
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
[ address-family ( ipv4 | ipv6 ) ]
aggregate-address <prefix> [ as-set ] attribute rcf <FUNCTION_NAME>()
|
router bgp 64500
vrf VRF1
address-family ipv4
aggregate-address 192.0.2.0/24 attribute rcf AGGREGATE_ATTRIBUTES_FUNCTION()
|
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| aigp.metric | Write |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.prefix_sid.index | Read/Write |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read/Write |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Write |
| med | Write |
| next_hop | Write |
| next_hop.ip_version | Read |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read/Write |
| route.priority | Write |
| source_protocol | Read |
| weight | Write |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
Unicast Aggregate-Address Match
EOS evaluates the RCF to determine which routes contribute to an aggregate route.
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
[ address-family ( ipv4 | ipv6 ) ]
aggregate-address <prefix> [ as-set ] match rcf <FUNCTION_NAME>()
|
router bgp 64500
vrf VRF1
address-family ipv4
aggregate-address 192.0.2.0/24 match rcf AGGREGATE_MATCH_FUNCTION()
|
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| aigp.metric | Read |
| as_path | Read |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.aggregate | Read |
| bgp.route_source | Read |
| community | Read |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read |
| large_community.count | Read |
| local_preference | Read |
| med | Read |
| next_hop | Read |
| next_hop.ip_version | Read |
| origin | Read |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| source_protocol | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read |
Unicast Default Route Export to L3 EVPN
| Syntax | Example |
|---|---|
router bgp <ASN>
vrf <NAME>
[ address-family ( ipv4 | ipv6 ) ]
default-route export evpn [ always ] rcf <FUNCTION_NAME>()
|
router bgp 64500
vrf VRF1
default-route export evpn always rcf DEFAULT_EXPORT_POLICY()
|
| Attribute | Support |
|---|---|
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| evpn.ip_prefix_route.prefix | Read |
| evpn.ip_prefix_route.prefix.ip_version | Read |
| evpn.ip_prefix_route.prefix.length | Read |
| evpn.route_type | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| origin | Read/Write |
| route.priority | Write |
| source_protocol | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
Unicast Default Route Export to MPLS L3 VPN
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
default-route export ( vpn-ipv4 | vpn-ipv6 ) [ always ] rcf <FUNCTION_NAME>()
|
router bgp 64500
vrf VRF1
default-route export vpn-ipv4 always rcf DEFAULT_EXPORT_POLICY()
|
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Read/Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| source_protocol | Read |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
Unicast Dynamic Prefix List
EOS evaluates the RCF on BGP routes for a specified VRF to determine the dynamic prefix list state.
| Syntax | Example |
|---|---|
dynamic prefix-list <DYN_PFX_LIST> match [vrf <VRF_NAME>] rcf <FUNCTION_NAME>() |
dynamic prefix-list DYN1 match rcf TRIGGERING_ROUTE_EXISTS() |
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| aigp.metric | Read |
| as_path | Read |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read |
| community.count | Read |
| ext_community | Read |
| ext_community.count | Read |
| instance.as | Read |
| large_community | Read |
| large_community.count | Read |
| local_preference | Read |
| med | Read |
| next_hop | Read |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read |
| origin | Read |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Read |
| source_protocol | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read |
Unicast Export Filter to MPLS L3 VPN
The filter-rcf RCF applies to unicast routes eligible for export. The RCF applies to the customer attributes on a Unicast route. Modifications to the path attributes in the filter-rcf RCF do not apply to the provided path.
| Syntax | Example |
|---|---|
router bgp <ASN>
vrf <NAME>
[ address-family ( ipv4 | ipv6 ) ]
route-target export ( vpn-ipv4 | vpn-ipv6 ) rcf <EXPORT_FUNCTION_NAME>() vpn-route filter-rcf <FUNCTION_NAME>()
|
router bgp 64500
vrf VRF1
route-target export vpn-ipv6 rcf EXPORT_POLICY() vpn-route filter-rcf EXPORT_POLICY_FILTER()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy export vpn-route filter-rcf ( ipv4 unicast | ipv6 unicast ) [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>
Example Output
switch# show bgp debug policy export vpn-route filter-rcf ipv4 unicast vrf RED 0.0.0.0/0
Path with RD: 64500:1, IPv4 prefix 0.0.0.0/0, exported to VPN-IPv4
The path was allowed by the evaluation of EXPORT_POLICY_FILTER().
code unit DEBUG
1 function EXPORT_POLICY_FILTER() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read |
| community.count | Read |
| ext_community | Read |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read |
| large_community.count | Read |
| local_preference | Read |
| med | Read |
| next_hop | Read |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read |
| origin | Read |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| source_protocol | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
Unicast Export to EVPN VPWS
| Syntax | Example |
|---|---|
router bgp <ASN>
vpws <evpn instance>
route-target export evpn rcf <FUNCTION_NAME>()
|
router bgp 64500
vpws evi2
route-target export evpn rcf EXPORT_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy export evpn vpws VPWS [ rcf <FUNCTION_NAME>() ] etid ETID [ esi ESI ] route ( local | remote ) domain ( local | remote ) [ rd RD ]
Example Output
switch# show bgp debug policy export evpn vpws evi2 etid 1001 route local domain local
Path with NLRI ETID: 1001 RD: 10.1.1.1:1 ESI: 0000:0000:0000:0000:0000 RouteType: local RouteDomain: local, exported to EVPN
The path was allowed by the evaluation of EXPORT_POLICY().
code unit DEBUG
1 function EXPORT_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| origin | Read/Write |
| rib.preference | Read |
| route.priority | Write |
| source_protocol | Read |
| weight | Read |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
Unicast Export to L3 EVPN
EOS applies the RCF to the EVPN route created after exporting it to the specific domain, and adds the unicast route path attributes to the BGP Customer Attribute Set if the iBGP has the PE-CE protocol for BGP/MPLS L3 VPN defined. You can specify the domain to export the route and if not specified, it uses the local domain.
| Syntax | Example |
|---|---|
router bgp <ASN>
vrf <NAME>
route-target export evpn [ domain ( remote | all ) ] rcf <FUNCTION_NAME>()
|
router bgp 64500
vrf VRF1
route-target export evpn rcf EXPORT_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy export evpn [ domain ( remote | all ) ] [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <NLRI>
Example Output
switch# show bgp debug policy export evpn vrf RED 0.0.0.0/0
Path with NLRI RD: 1:10 ip-prefix 0.0.0.0/0, exported to EVPN domain local
The path was allowed by the evaluation of EXPORT_POLICY().
code unit DEBUG
1 function EXPORT_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
Unicast Export to MPLS L3 VPN
EOS applies the RCF to the VPN route created on export, and pushes the unicast route path attribute into the BGP Customer Attribute Set if you configured the iBGP as PE-CE Protocol for BGP/MPLS L3 VPN, as defined in RFC6368 section 5.
| Syntax | Example |
|---|---|
router bgp <ASN>
vrf <NAME>
[ address-family ( ipv4 | ipv6 ) ]
route-target export ( vpn-ipv4 | vpn-ipv6 ) rcf <FUNCTION_NAME>()
|
router bgp 64500
vrf VRF1
route-target export vpn-ipv6 rcf EXPORT_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy export ( vpn-ipv4 | vpn-ipv6 ) [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>
Example Output
switch# show bgp debug policy export vpn-ipv4 vrf RED 0.0.0.0/0
Path with RD: 64500:1, IPv4 prefix 0.0.0.0/0, exported to VPN-IPv4
The path was allowed by the evaluation of EXPORT_POLICY().
code unit DEBUG
1 function EXPORT_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
Unicast Import Filter From MPLS L3 VPN
EOS applies the filter-rcf to VPN-IPv4 and VPN-IPv6 candidates for import, and then applies it to the VPN path provider attributes. Modifications to path attributes in the filter-rcf RCF do not apply to the provided path.
| Syntax | Example |
|---|---|
router bgp <ASN>
vrf <NAME>
[ address-family ( ipv4 | ipv6 ) ]
route-target import ( vpn-ipv4 | vpn-ipv6 ) rcf <IMPORT_FUNCTION_NAME>() vpn-route filter-rcf <FUNCTION_NAME>()
|
router bgp 64500 vrf VRF1 route-target import vpn-ipv6 rcf IMPORT_POLICY() vpn-route filter-rcf FILTER_VPN_ROUTES() |
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy import vpn-route filter-rcf ( vpn-ipv4 | vpn-ipv6 ) [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX> rd <RD>
Example Output
switch# show bgp debug policy import vpn-route filter-rcf vpn-ipv4 vrf RED 0.0.0.0/0 rd 64500:1
Path with RD: 64500:1, IPv4 prefix 0.0.0.0/0, imported from VPN-IPv4
The path was allowed by the evaluation of FILTER_VPN_ROUTES().
code unit DEBUG
1 function FILTER_VPN_ROUTES() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read |
| community.count | Read |
| ext_community | Read |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read |
| large_community.count | Read |
| local_preference | Read |
| med | Read |
| next_hop | Read |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read |
| origin | Read |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read |
Unicast Import from L3 EVPN
The RCF applies to the unicast route created on import from the specified domain. The unicast route attribute populates with the BGP Customer Attribute Set, as defined in RFC6368 section 5, if it exists, otherwise uses the VPN path attributes.
| Syntax | Example |
|---|---|
router bgp <ASN>
vrf <NAME>
route-target import evpn [ domain ( remote | all ) ] rcf <FUNCTION_NAME>()
|
router bgp 64500
vrf VRF1
route-target import evpn rcf IMPORT_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy import ( ipv4 unicast | ipv6 unicast ) [ domain ( remote | all ) ] [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <NLRI>
Example Output
switch# show bgp debug policy import ipv4 unicast vrf RED 0.0.0.0/0 rd 64500:1
Path with NLRI 0.0.0.0/0, imported from EVPN domain local
The path was allowed by the evaluation of IMPORT_POLICY().
code unit DEBUG
1 function IMPORT_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| fec.recmp | Read/Write |
| igp.tag | Read/Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read |
| origin | Read |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
Unicast Import From MPLS L3 VPN
The RCF applies to the unicast route created on import. The unicast route attribute populates with the BGP Customer Attribute Set, as defined in RFC6368 section 5, if it exists, otherwise uses the VPN path attributes.
| Syntax | Example |
|---|---|
router bgp <ASN>
vrf <NAME>
[ address-family ( ipv4 | ipv6 ) ]
route-target import ( vpn-ipv4 | vpn-ipv6 ) rcf <FUNCTION_NAME>()
|
router bgp 64500
vrf VRF1
route-target import vpn-ipv4 rcf IMPORT_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy import ( ipv4 unicast | ipv6 unicast ) [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX> rd <RD
Example Output
switch# show bgp debug policy import ipv4 unicast 0.0.0.0/0 rd 64500:1
Path with RD: 64500:1, IPv4 prefix 0.0.0.0/0, imported from VPN-IPv4
The path was allowed by the evaluation of IMPORT_POLICY().
code unit DEBUG
1 function IMPORT_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| fec.recmp | Read/Write |
| igp.tag | Read/Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read |
| origin | Read |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
Unicast Inbound BGP Neighbor Application
| Syntax | Example |
|---|---|
router bgp <ASN> address-family ( ipv4 | ipv6 ) neighbor (NEIGHBOR | PEER_GROUP ) rcf in FUNCTION_NAME>() |
router bgp 64500
address-family ipv4
neighbor 192.0.2.1 rcf in INBOUND_POLICY()
address-family ipv6
neighbor 2001:db8::1428:57ab rcf in INBOUND_POLICY()
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
[ vrf <NAME> ]
address-family ( ipv4 | ipv6 ) labeled-unicast
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback
...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family ipv4 labeled-unicast
neighbor 192.0.2.1 rcf in INBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family ipv4 labeled-unicast
neighbor 192.0.2.1 rcf in INBOUND_POLICY() fallback INBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy inbound neighbor ( <NEIGHBOR> | all ) ( ipv4 | ipv6 ) unicast [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX> [ path-id <RX_PATH_ID> ]
Example Output
switch# show bgp debug policy inbound neighbor 192.0.2.1 ipv4 unicast 0.0.0.0/0
Path with NLRI 0.0.0.0/0, received from 192.0.2.1
The path was allowed by the evaluation of INBOUND_POLICY().
code unit DEBUG
1 function INBOUND_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| aigp.metric | Read/Write |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.prefix_sid.index | Read/Write |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
Unicast Outbound BGP Neighbor Application
| Syntax | Example |
|---|---|
router bgp <ASN> address-family ( ipv4 | ipv6 ) neighbor (NEIGHBOR | PEER_GROUP ) rcf out FUNCTION_NAME>() |
router bgp 64500
address-family ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY()
address-family ipv6
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY()
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
[ vrf <NAME> ]
address-family ( ipv4 | ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY() fallback OUTBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy outbound neighbor <NEIGHBOR> ( ipv4 | ipv6 ) unicast [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>
Example Output
switch# show bgp debug policy outbound neighbor 192.0.2.1 ipv4 unicast 0.0.0.0/0
Path with NLRI 0.0.0.0/0, to 192.0.2.1
The path was allowed by the evaluation of OUTBOUND_POLICY().
code unit DEBUG
1 function OUTBOUND_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| aigp.accumulation.metric | Read/Write |
| aigp.metric | Read/Write |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.aggregate | Read |
| bgp.aggregate_contributor | Read |
| bgp.best_path | Read/Write |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| destination_session.local.as | Read |
| destination_session.router_id_group.bandwith | Read |
| ecmp.aggregate_link_bandwidth | Read |
| ecmp.aggregate_source_interface_bandwidth | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.metric | |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rpki.origin_as_validity | |
| source_protocol | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | |
| as_path.remove | |
| as_path.replace | |
| set_next_hop_self | |
| set_next_hop_self_interface |
Unicast Redistribute Connected
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
[ address-family ( ipv4 | ipv6 ) ]
redistribute connected [ include leaked ] rcf <FUNCTION_NAME>()
|
router bgp 64500
address-family ipv4
redistribute connected rcf CONNECTED_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy redistribute ( ipv4 | ipv6 ) unicast [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>
Example Output
switch# show bgp debug policy redistribute ipv4 unicast 192.0.2.0/24
Path with NLRI 192.0.2.0/24, redistributed from CONNECTED
The path was allowed by the evaluation of CONNECTED_POLICY().
code unit DEBUG
1 function CONNECTED_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Write |
| community.count | Read |
| connected_interface | Read |
| destination_session.router_id_group.bandwith | Read |
| ecmp.aggregate_link_bandwidth | Read |
| ecmp.aggregate_source_interface_bandwidth | Read |
| ext_community | Write |
| ext_community.count | Read |
| igp.tag | Read/Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rpki.origin_as_validity | Write |
| source_protocol | Read |
| weight | Read/Write |
Unicast Redistribute Dynamic
| Syntax | Example |
|---|---|
router bgp <ASN> [ vrf <NAME> ] [ address-family ( ipv4 | ipv6 ) ] redistribute dynamic rcf <FUNCTION_NAME>() |
router bgp 64500
address-family ipv4
redistribute dynamic rcf DYNAMIC_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy redistribute ( ipv4 | ipv6 ) unicast [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>
Example Output
switch# show bgp debug policy redistribute ipv4 unicast 192.0.2.0/24
Path with NLRI 192.0.2.0/24, redistributed from DYNAMIC
The path was allowed by the evaluation of DYNAMIC_POLICY().
code unit DEBUG
1 function DYNAMIC_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Write |
| community.count | Read |
| connected_interface | Read |
| destination_session.router_id_group.bandwith | Read |
| ecmp.aggregate_link_bandwidth | Read |
| ecmp.aggregate_source_interface_bandwidth | Read |
| ext_community | Write |
| ext_community.count | Read |
| igp.tag | Read/Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rpki.origin_as_validity | Write |
| source_protocol | Read |
| weight | Read/Write |
Unicast Redistribute EOS SDK
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
[ address-family ( ipv4 | ipv6 ) ]
redistribute user rcf <FUNCTION_NAME>()
|
router bgp 64500
address-family ipv4
redistribute user rcf EOS_SDK_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy redistribute ( ipv4 | ipv6 ) unicast [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>>
Example Output
switch# show bgp debug policy redistribute ipv4 unicast 192.0.2.0/2
Path with NLRI 192.0.2.0/24, redistributed from EOS SDK
The path was allowed by the evaluation of EOS_SDK_POLICY().
code unit DEBUG
1 function EOS_SDK_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Write |
| community.count | Read |
| ext_community | Write |
| ext_community.count | Read |
| igp.tag | Read/Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rpki.origin_as_validity | Write |
| source_protocol | Read |
| weight | Read/Write |
Unicast Redistribute gRIBI
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
[ address-family ( ipv4 | ipv6 ) ]
redistribute gribi rcf <FUNCTION_NAME>()
|
router bgp 64500
address-family ipv4
redistribute gribi rcf GRIBI_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy redistribute ( ipv4 | ipv6 ) unicast [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>
Example Output
switch# show bgp debug policy redistribute ipv4 unicast 192.0.2.0/24
Path with NLRI 192.0.2.0/24, redistributed from gRIBI
The path was allowed by the evaluation of GRIBI_POLICY().
code unit DEBUG
1 function GRIBI_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Write |
| community.count | Read |
| ext_community | Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Write |
| large_community.count | Read |
| local_preference | Write |
| med | Write |
| next_hop | Write |
| next_hop.ip_version | Read |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rpki.origin_as_validity | Write |
| source_protocol | Read |
| weight | Read/Write |
Unicast Redistribute IS-IS
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
[ address-family ( ipv4 | ipv6 ) ]
redistribute isis ( level-1 | level-2 | level-1-2 ) [ include leaked ] rcf <FUNCTION_NAME>()
|
router bgp 64500
address-family ipv4
redistribute level-1 rcf ISIS_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy redistribute ( ipv4 | ipv6 ) unicast [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>
Example Output
switch# show bgp debug policy redistribute ipv4 unicast 192.0.2.0/24
Path with NLRI 192.0.2.0/24, redistributed from IS-IS
The path was allowed by the evaluation of ISIS_POLICY().
code unit DEBUG
1 function ISIS_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Write |
| community.count | Read |
| ext_community | Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Write |
| large_community.count | Read |
| local_preference | Write |
| med | Write |
| next_hop | Write |
| next_hop.ip_version | Read |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rpki.origin_as_validity | Write |
| source_protocol | Read |
| weight | Read/Write |
Unicast Redistribute Leaked BGP
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
[ address-family ( ipv4 | ipv6 ) ]
redistribute bgp leaked rcf <FUNCTION_NAME>()
|
router bgp 64500
address-family ipv4
redistribute bgp leaked rcf LEAKED_BGP_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy redistribute ( ipv4 | ipv6 ) unicast [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>
Example Output
switch# show bgp debug policy redistribute ipv4 unicast 192.0.2.0/24
Path with NLRI 192.0.2.0/24, redistributed from Leaked Bgp
The path was allowed by the evaluation of LEAKED_BGP_POLICY().
code unit DEBUG
1 function LEAKED_BGP_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Write |
| community.count | Read |
| ext_community | Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Write |
| large_community.count | Read |
| local_preference | Write |
| med | Write |
| next_hop | Write |
| next_hop.ip_version | Read |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rpki.origin_as_validity | Write |
| source_protocol | Read |
| weight | Read/Write |
Unicast Redistribute OSPF
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
[ address-family ( ipv4 | ipv6 ) ]
redistribute ( ospf | ospfv3 ) [ match ( internal | external | nssa-external ) [ include leaked ]
rcf <FUNCTION_NAME>()
|
router bgp 64500
address-family ipv4
redistribute ospf rcf OSPF_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy redistribute ( ipv4 | ipv6 ) unicast [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>
Example Output
switch# show bgp debug policy redistribute ipv4 unicast 192.0.2.0/24
Path with NLRI 192.0.2.0/24, redistributed from OSPF EXTERNAL
The path was allowed by the evaluation of OSPF_POLICY().
code unit DEBUG
1 function OSPF_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Write |
| community.count | Read |
| ext_community | Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Write |
| large_community.count | Read |
| local_preference | Write |
| med | Write |
| next_hop | Write |
| next_hop.ip_version | Read |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rpki.origin_as_validity | Write |
| source_protocol | Read |
| weight | Read/Write |
Unicast Redistribute Static
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
[ address-family ( ipv4 | ipv6 ) ]
redistribute static [ include leaked ] rcf <FUNCTION_NAME>()
|
router bgp 64500
address-family ipv4
redistribute static rcf STATIC_POLICY()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy redistribute ( ipv4 | ipv6 ) unicast [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>
Example Output
switch# show bgp debug policy redistribute ipv4 unicast 192.0.2.0/24
Path with NLRI 192.0.2.0/24, redistributed from Static
The path was allowed by the evaluation of STATIC_POLICY().
code unit DEBUG
1 function STATIC_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Write |
| community.count | Read |
| ext_community | Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Write |
| large_community.count | Read |
| local_preference | Write |
| med | Write |
| next_hop | Write |
| next_hop.ip_version | Read |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rpki.origin_as_validity | Write |
| source_protocol | Read |
| weight | Read/Write |
Unicast Network Statement
The NETWORK_FUNCTION() evaluates the route injected into BGP through the network statement.
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME>
address-family ( ipv4 | ipv6 )
network prefix rcf FUNCTION_NAME>()
|
router bgp 64500
address-family ipv4
network 192.0.2.0/24 rcf NETWORK_FUNCTION()
address-family ipv6
network 2001:DB8::/32 rcf NETWORK_FUNCTION()
|
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy redistribute ( ipv4 | ipv6 ) unicast [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] <PREFIX>
Example Output
switch# show bgp debug policy redistribute ipv4 unicast 192.0.2.0/24
Path with NLRI 192.0.2.0/24, network statement (Static)
The path was allowed by the evaluation of NETWORK_POLICY().
code unit DEBUG
1 function NETWORK_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Write |
| community.count | Read |
| ext_community | Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Write |
| large_community.count | Read |
| local_preference | Write |
| med | Write |
| next_hop | Write |
| next_hop.ip_version | Read |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rpki.origin_as_validity | Write |
| source_protocol | Read |
| weight | Read/Write |
Unicast Outbound BGP Neighbor Default Route Originate Application
The neighbor default-originate feature advertises a default route to the neighbor (peer or peer-group) even when no default route exists in the BGP RIB.
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
address-family ( ipv4 | ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) default-originate [ always ] rcf <FUNCTION_NAME>()
|
router bgp 64500
address-family ipv4
neighbor 192.0.2.1 default-originate always rcf DEFAULT_ORIGINATE_POLICY()
|
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| aigp.accumulation_metric | Read/Write |
| aigp.metric | Read/Write |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| destination_session.local.as | Read |
| ecmp.aggregate_link_bandwidth | Read |
| ecmp.aggregate_source_interface_bandwidth | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Read/Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read |
| origin | Read |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rpki.origin_as_validity | Read/Write |
| source_protocol | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
Next Hop Resolution RIBS
If configuring an inbound policy for the same VRF and address-family, the RESOLUTION_RIBS_POLICY() function applies to the result of the inbound policy. Otherwise, the function applies directly to inbound routes.
- Returns false.
- Returns no value
- Does not modify the resolution_routes attribute.
| Syntax | Example |
|---|---|
address-family ( ipv4 | ipv6 ) next-hop resolution ribs rcf FUNCTION_NAME() |
router bgp 64500
vrf VRF1
address-family ipv4
next-hop resolution ribs rcf RESOLUTION_RIBS_POLICY()
address-family ipv6
next-hop resolution ribs rcf RESOLUTION_RIBS_POLICY()
|
IPv4 and IPv6 Multicast Address Family
Aggregate Address Configuration
The generated aggregate route evaluates the AGGREGATE_ATTRIBUTES_FUNCTION_NAME() function. The aggregate path attributes of the aggregate contributor routes takes the function as input.
| Syntax | Example |
|---|---|
router bgp <ASN>
[ vrf <NAME> ]
address-family ( ipv4 | ipv6 ) multicast
aggregate-address prefix [ as-set ] attribute rcf AGGREGATE_ATTRIBUTES_FUNCTION_NAME()
|
router bgp 64500 address-family ipv4 multicast aggregate-address 192.0.2.0/24 attribute rcf AGGREGATE_ATTRIBUTES_FUNCTION() |
Multicast Redistribution Unicast
EOS redistributes Unicast routes into BGP IPv4 Multicast and IPv6 Multicast from the RIB. The RIB does not contain BGP attributes, suchas community, and become unavailable to the POA.
| Syntax | Example |
|---|---|
router bgp <ASN> [ vrf <NAME> ] address-family ( ipv4 | ipv6 ) multicast route input address-family ( ipv4 | ipv6 ) unicast rcf ROUTE_INPUT_FUNCTION_NAME() |
router bgp 64500 address-family ipv4 multicast route input address-family ipv4 unicast rcf ROUTE_INPUT_FUNCTION() |
EVPN Address Family
Inbound BGP Neighbor Application
| Syntax | Example |
|---|---|
address-family evpn neighbor ( NEIGHBOR | PEER_GROUP ) rcf in FUNCTION_NAME() |
router bgp 64500
address-family evpn
neighbor 192.0.2.1 rcf in INBOUND_POLICY()
|
Inbound BGP Neighbor Function Arguments and Function Sequencing with Fallback
BGP Neighbor Function Arguments Commands
router bgp ASN
address-family evpn
neighbor ( NEIGHBOR | PEER_GROUP ) rcf in FUNCTION_NAME()
neighbor ( NEIGHBOR | PEER_GROUP ) rcf in FUNCTION_NAME( [ ARGUMENTS ] )
neighbor ( NEIGHBOR | PEER_GROUP ) rcf in FUNCTION_NAME() fallback ( true | false )
neighbor ( NEIGHBOR | PEER_GROUP ) rcf in FUNCTION_NAME() fallback FUNCTION_NAME()
neighbor ( NEIGHBOR | PEER_GROUP ) rcf in FUNCTION_NAME() fallback FUNCTION_NAME() fallback ( true | false )
neighbor ( NEIGHBOR | PEER_GROUP ) rcf in FUNCTION_NAME() fallback FUNCTION_NAME() fallback FUNCTION_NAME() fallback
...
neighbor ( NEIGHBOR | PEER_GROUP ) rcf in FUNCTION_NAME( [ ARGUMENTS ] ) fallback
...
neighbor ( NEIGHBOR | PEER_GROUP ) rcf in ( true | false )
Specify a maximum of 16 RCF functions using function sequencing with fallback.
Example Function Arguments
switch(config)# router bgp 64500
address-family evpn
neighbor 192.0.2.1 rcf in INBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example Function Sequencing with Fallback
switch(config)# router bgp 64500
address-family evpn
neighbor 192.0.2.1 rcf in INBOUND_POLICY() fallback INBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
Outbound BGP Neighbor Application
| Syntax | Example |
|---|---|
address-family evpn neighbor ( NEIGHBOR | PEER_GROUP ) rcf out FUNCTION_NAME() |
router bgp 64500
address-family evpn
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY()
|
Outbound BGP Neighbor Function Arguments and Function Sequencing with Fallback
BGP Neighbor Function Arguments Commands
router bgp ASN
address-family evpn
neighbor ( NEIGHBOR | PEER_GROUP ) rcf out FUNCTION_NAME()
neighbor ( NEIGHBOR | PEER_GROUP ) rcf out FUNCTION_NAME( [ ARGUMENTS ] )
neighbor ( NEIGHBOR | PEER_GROUP ) rcf out FUNCTION_NAME() fallback ( true | false )
neighbor ( NEIGHBOR | PEER_GROUP ) rcf out FUNCTION_NAME() fallback FUNCTION_NAME()
neighbor ( NEIGHBOR | PEER_GROUP ) rcf out FUNCTION_NAME() fallback FUNCTION_NAME() fallback ( true | false )
neighbor ( NEIGHBOR | PEER_GROUP ) rcf out FUNCTION_NAME() fallback FUNCTION_NAME() fallback FUNCTION_NAME() fallback
...
neighbor ( NEIGHBOR | PEER_GROUP ) rcf out FUNCTION_NAME( [ ARGUMENTS ] ) fallback
...
neighbor ( NEIGHBOR | PEER_GROUP ) rcf out ( true | false )
Specify a maximum of 16 RCF functions using function sequencing with fallback.
Example Function Arguments
switch(config)# router bgp 64500
address-family evpn
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example Function Sequencing with Fallback
switch(config)# router bgp 64500
address-family evpn
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY() fallback INBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
Default Route Originate Neighbor Application
| Syntax | Example |
|---|---|
address-family evpn
neighbor ( NEIGHBOR | PEER_GROUP ) default-route [rcf FUNCTION_NAME()
|
router bgp 64500
address-family evpn
neighbor 192.0.2.1 default-route rcf out DEFAULT_ORIGINATE_POLICY()
|
MPLS L3 VPN IPv4 and IPv6 Address Family
MPLS L3 VPN Inbound BGP Neighbor
| Syntax | Example |
|---|---|
router bgp <ASN>
address-family ( vpn-ipv4 | vpn-ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>()
|
router bgp 64500
address-family vpn-ipv4
neighbor 192.0.2.1 rcf in INBOUND_POLICY()
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
address-family ( vpn-ipv4 | vpn-ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family vpn-ipv4
neighbor 192.0.2.1 rcf in INBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family vpn-ipv4
neighbor 192.0.2.1 rcf in INBOUND_POLICY() fallback INBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback fals
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy inbound neighbor ( <NEIGHBOR> | all ) ( vpn-ipv4 | vpn-ipv6 ) [ rcf <FUNCTION_NAME>() ] <PREFIX> rd <RD>
Example Output
switch# show bgp debug policy inbound neighbor 192.0.2.1 vpn-ipv4 0.0.0.0/0 rd 64500:1
Path with NLRI RD: 64500:1 IPv4 prefix 0.0.0.0/0, received from 192.0.2.1
The path was allowed by the evaluation of INBOUND_POLICY().
code unit DEBUG
1 function INBOUND_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| destination_session.local.as | Read |
| destination_session.router_id_group.bandwidth | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hope.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
| set_next_hop_self | Yes |
MPLS L3 VPN Outbound BGP Neighbor
| Syntax | Example |
|---|---|
router bgp <ASN>
address-family ( vpn-ipv4 | vpn-ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>()
|
router bgp 64500
address-family vpn-ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY()
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
address-family ( vpn-ipv4 | vpn-ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family vpn-ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family vpn-ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY() fallback OUTBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy outbound neighbor ( <NEIGHBOR> | all ) ( vpn-ipv4 | vpn-ipv6 ) [ rcf <FUNCTION_NAME>() ] <PREFIX> rd <RD>
Example Output
switch# show bgp debug policy outbound neighbor 192.0.2.1 vpn-ipv4 0.0.0.0/0 rd 64500:1
Path with NLRI RD: 64500:1 IPv4 prefix 0.0.0.0/0, to 192.0.2.1
The path was allowed by the evaluation of OUTBOUND_POLICY().
code unit DEBUG
1 function OUTBOUND_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| destination_session.local.as | Read |
| destination_session.router_id_group.bandwidth | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hope.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
| set_next_hop_self | Yes |
Default Route Originate BGP Neighbor Application
| Syntax | Example |
|---|---|
router bgp <ASN>
address-family ( vpn-ipv4 | vpn-ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) default-route rcf <FUNCTION_NAME>()
|
router bgp 64500
address-family vpn-ipv4
neighbor 192.0.2.1 default-route rcf DEFAULT_ORIGINATE_POLICY()
|
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| destination_session.local.as | Read |
| destination_session.router_id_group.bandwidth | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hope.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
| set_next_hop_self | Yes |
Route-Target Membership Address Family
Route-Target Membership Inbound BGP Neighbor
| Syntax | Example |
|---|---|
router bgp <ASN>
address-family rt-membership
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>()
|
router bgp 64500
address-family rt-membership
neighbor 192.0.2.1 rcf in INBOUND_POLICY()
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
address-family rt-membership
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family rt-membership
neighbor 192.0.2.1 rcf in INBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family rt-membership
neighbor 192.0.2.1 rcf in INBOUND_POLICY() fallback INBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy inbound neighbor ( <NEIGHBOR> | all ) rt-membership [ rcf <FUNCTION_NAME>() ] origin-as ( <ASN> | none ) route-target <RT>
Example Output
switch# show bgp debug policy inbound neighbor 192.0.2.1 rt-membership origin-as 64500 route-target 64500:1
Path with NLRI Origin AS: 64500 Route target: 64500:1/64, received from 192.0.2.1
The path was allowed by the evaluation of INBOUND_POLICY().
code unit DEBUG
1 function INBOUND_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| source_protocol | Read |
| rt_membership.origin_as | Read |
| rt_membership.route_target | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | |
| as_path.remove | |
| as_path.replace |
Route-Target Membership Outbound BGP Neighbor
| Syntax | Example |
|---|---|
router bgp <ASN>
address-family rt-membership
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>()
|
router bgp 64500
address-family rt-membership
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY())
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
address-family rt-membership
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family rt-membership
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family rt-membership
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY() fallback OUTBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy outbound neighbor <NEIGHBOR> rt-membership [ rcf <FUNCTION_NAME>() ] origin-as ( <ASN> | none ) route-target <RT>
Example Output
switch# show bgp debug policy outbound neighbor 192.0.2.1 rt-membership origin-as 64500 route-target 64500:1
Path with NLRI Origin AS: 64500 Route target: 64500:1/64, to 192.0.2.1
The path was allowed by the evaluation of OUTBOUND_POLICY().
code unit DEBUG
1 function OUTBOUND_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| destination_session.local.as | Read |
| destination_session.router_id_group.bandwidth | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| route.priority | Write |
| rt_membership.origin_as | Read |
| rt_membership.route_target | Read |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | |
| as_path.remove | |
| as_path.replace |
IPv4 and IPv6 Unicast Flowspec Address Family
| Syntax | Example |
|---|---|
router bgp <ASN> address-family flow-spec ( ipv4 | ipv6 ) neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() |
router bgp 64500
address-family flow-spec ipv4
neighbor 192.0.2.1 rcf in INBOUND_POLICY()
router bgp 64500
address-family flow-spec ipv6
neighbor 2001:db8:85a3::8a2e:370:7334 rcf in INBOUND_POLICY()
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
address-family flow-spec ( ipv4 | ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback
...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family flow-spec ipv4
neighbor 192.0.2.1 rcf in INBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family flow-spec ipv4
neighbor 192.0.2.1 rcf in INBOUND_POLICY() fallback INBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy inbound neighbor ( <NEIGHBOR> | all ) flow-spec ( ipv4 | ipv6 ) [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] rule <RULE>
Example Output
switch# show bgp debug policy inbound neighbor 192.0.2.1 flow-spec ipv4 rule 192.0.2.2/32;*;
Path with NLRI 192.0.2.2/32;*;, received from 192.0.2.1
The path was allowed by the evaluation of INBOUND_POLICY().
code unit DEBUG
1 function INBOUND_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| flowspec.destination.prefix | Read |
| flowspec.destination.prefix.ip_version | Read |
| flowspec.destination.prefix.length | Read |
| flowspec.source.prefix | Read |
| flowspec.source.prefix.ip_version | Read |
| flowspec.source.prefix.length | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
Unicast Flowspec Outbound BGP Neighbor Application
| Syntax | Example |
|---|---|
router bgp <ASN>
address-family flow-spec ( ipv4 | ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>()
|
router bgp 64500
address-family flow-spec ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY()
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
address-family flow-spec ( ipv4 | ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family flow-spec ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family flow-spec ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY() fallback OUTBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy outbound neighbor ( <NEIGHBOR> | all ) flow-spec ( ipv4 | ipv6 ) [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] rule <RULE>
Example Output
switch# show bgp debug policy outbound neighbor 192.0.2.1 flow-spec ipv4 rule 192.0.2.2/32;*;
Path with NLRI 192.0.2.2/32;*;, to 192.0.2.1
The path was allowed by the evaluation of OUTBOUND_POLICY().
code unit DEBUG
1 function OUTBOUND_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| flowspec.destination.prefix | Read |
| flowspec.destination.prefix.ip_version | Read |
| flowspec.destination.prefix.length | Read |
| flowspec.source.prefix | Read |
| flowspec.source.prefix.ip_version | Read |
| flowspec.source.prefix.length | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
IPv4 and IPv6 VPN Flowspec Address Family
VPN Flowspec Inbound BGP Neighbor
| Syntax | Example |
|---|---|
router bgp <ASN>
address-family flow-spec ( vpn-ipv4 | vpn-ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>()
|
router bgp 64500
address-family flow-spec vpn-ipv4
neighbor 192.0.2.1 rcf in INBOUND_POLICY()
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
address-family flow-spec ( vpn-ipv4 | vpn-ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family flow-spec vpn-ipv4
neighbor 192.0.2.1 rcf in INBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family flow-spec vpn-ipv4
neighbor 192.0.2.1 rcf in INBOUND_POLICY() fallback INBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy inbound neighbor ( <NEIGHBOR> | all ) flow-spec ( ipv4 | ipv6 ) [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] rule <RULE>
Example Output
switch# show bgp debug policy inbound neighbor 192.0.2.1 flow-spec ipv4 rule 192.0.2.2/32;*;
Path with NLRI RD:1:2;192.0.2.2/32;*;, received from 192.0.2.1
The path was allowed by the evaluation of INBOUND_POLICY().
code unit DEBUG
1 function INBOUND_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| flowspec.destination.prefix | Read |
| flowspec.destination.prefix.ip_version | Read |
| flowspec.destination.prefix.length | Read |
| flowspec.source.prefix | Read |
| flowspec.source.prefix.ip_version | Read |
| flowspec.source.prefix.length | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| origin | Read/Write |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
PN Flowspec Outbound BGP Neighbor
| Syntax | Example |
|---|---|
router bgp <ASN>
address-family flow-spec ( vpn-ipv4 | vpn-ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>()
|
router bgp 64500
address-family flow-spec vpn-ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY()
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
address-family flow-spec ( vpn-ipv4 | vpn-ipv6 )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family flow-spec vpn-ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family flow-spec vpn-ipv4
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY() fallback OUTBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
EOS supports debugging the RCF evaluation at this point of application using the following command:
show bgp debug policy outbound neighbor ( <NEIGHBOR> | all ) flow-spec ( ipv4 | ipv6 ) [ vrf <NAME> ] [ rcf <FUNCTION_NAME>() ] rule <RULE>
Example Output
switch# show bgp debug policy outbound neighbor 192.0.2.1 flow-spec ipv4 rule 192.0.2.2/32;*;
Path with NLRI RD:1:2;192.0.2.2/32;*;, to 192.0.2.1
The path was allowed by the evaluation of OUTBOUND_POLICY().
code unit DEBUG
1 function OUTBOUND_POLICY() {
--------
2 med = 10;
T----- T---
3 return true;
| Attribute | Support |
|---|---|
| afi | Read |
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| destination._session.local.as | Read |
| destination._session.router_id_group.bandwidth | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| flowspec.destination.prefix | Read |
| flowspec.destination.prefix.ip_version | Read |
| flowspec.destination.prefix.length | Read |
| flowspec.source.prefix | Read |
| flowspec.source.prefix.ip_version | Read |
| flowspec.source.prefix.length | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| origin | Read/Write |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read |
| Function | Support |
|---|---|
| as_path.left_trim | Yes |
| as_path.remove | Yes |
| as_path.replace | Yes |
VPLS Address Family
Inbound BGP Neighbor Application
| Syntax | Example |
|---|---|
router bgp <ASN>
address-family vpls
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>()
|
router bgp 64500
address-family vpls
neighbor 192.0.2.1 rcf in INBOUND_POLICY()
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
address-family vpls
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf in ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family vpls
neighbor 192.0.2.1 rcf in INBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family vpls
neighbor 192.0.2.1 rcf in INBOUND_POLICY() fallback INBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
| Attribute | Support |
|---|---|
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| rib.preference | Read |
| route.priority | Write |
| source_protocol | Read |
| source_session.interface.bandwidth | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | |
| as_path.remove | |
| as_path.replace |
Outbound BGP Neighbor Application
| Syntax | Example |
|---|---|
router bgp <ASN>
address-family vpls
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>()
|
router bgp 64500
address-family vpls
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY()
|
- Function arguments
- Function sequencing with fallback
router bgp <ASN>
address-family vpls
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback ...
neighbor ( <NEIGHBOR> | <PEER_GROUP> ) rcf out ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
router bgp 64500
address-family vpls
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
router bgp 64500
address-family vpls
neighbor 192.0.2.1 rcf out OUTBOUND_POLICY() fallback OUTBOUND_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
| Attribute | Support |
|---|---|
| afi_safi | Read |
| as_path | Read/Write |
| as_path.last_as | Read |
| as_path.length | Read |
| as_path.origin_as | Read |
| bgp.route_source | Read |
| community | Read/Write |
| community.count | Read |
| destination_session.local.as | Read |
| destination_session.router_id_group.bandwidth | Read |
| ext_community | Read/Write |
| ext_community.count | Read |
| igp.tag | Write |
| instance.as | Read |
| large_community | Read/Write |
| large_community.count | Read |
| local_preference | Read/Write |
| med | Read/Write |
| next_hop | Read/Write |
| next_hop.ip_version | Read |
| next_hop_best_path_metric | Read/Write |
| origin | Read/Write |
| route.priority | Write |
| source_protocol | Read |
| source_session.remote.as | Read |
| source_session.remote.ip_address | Read |
| source_session.remote.router_id | Read |
| weight | Read/Write |
| Function | Support |
|---|---|
| as_path.left_trim | |
| as_path.remove | |
| as_path.replace |
Configuring Dynamic Prefix Lists
| Syntax | Example |
|---|---|
dynamic prefix-list DYN_PFX_LIST
match [vrf vrf-name] rcf DPL_FUNCTION_NAME>()
|
dynamic prefix-list DYN1
match vrf vrfA rcf TRIGGERING_ROUTE_EXISTS()
|
Configuring Maintenance Mode
EOS evaluates the RCF on BGP routes affected by the Maintenance BGP profile. Configuring the direction to inout applies the RCF to both inbound and outbound directions.
| Syntax | Example |
|---|---|
maintenance
profile bgp <BGP_PROFILE_NAME>
initiator rcf ( in | out | inout ) <FUNCTION_NAME>()
|
maintenance
profile bgp BP1
initiator rcf in MAINT_POLICY()
|
- Function arguments
- Function sequencing with fallback
maintenance
profile bgp <BGP_PROFILE_NAME>
initiator rcf ( in | out | inout ) <FUNCTION_NAME>()
initiator rcf ( in | out | inout ) <FUNCTION_NAME>( [ ARGUMENTS ] )
initiator rcf ( in | out | inout ) <FUNCTION_NAME>() fallback ( true | false )
initiator rcf ( in | out | inout ) <FUNCTION_NAME>() fallback <FUNCTION_NAME>()
initiator rcf ( in | out | inout ) <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ( true | false )
initiator rcf ( in | out | inout ) <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback <FUNCTION_NAME>() fallback ...
initiator rcf ( in | out | inout ) <FUNCTION_NAME>( [ ARGUMENTS ] ) fallback ...
initiator rcf ( in | out | inout ) ( true | false )
EOS supports a maximum of 16 RCF functions using function sequencing with fallback.
Example CLI Usage with Function Arguments
maintenance
profile bgp BP1
initiator rcf in MAINT_POLICY_2( 100, prefix_list_v4 PFX_LIST )
Example CLI Usage with Function Sequencing with Fallback
maintenance
profile bgp BP1
initiator rcf in MAINT_POLICY() fallback MAINT_POLICY_2( 200, prefix_list_v6 PFX_LIST ) fallback false
Displaying RCF BGP Status
To view the status of RCF functions for BGP, use the show bgp rcf function_name:
switch# show bgp rcf Function Status Detail ------------------------------ ------------------------------ ------------------------------ ACCEPT_ALL() active DENY_ALL() active USES_MISSING_PFXL() prefix_list_v4 not found MISSING_PFXL switch# show bgp rcf ACCEPT_ALL() FunctionStatus Detail ------------------------------ ------------------------------ ------------------------------ ACCEPT_ALL() active
- active - The RCF has a valid configuration and available for use.
- reference not found - The RCF refers to an external construct such as an undefined AS path list, community list, or prefix. The configuration does not accept routes evaluated against the RCF. The undefined reference can be found in the Details column.
- missing symbol - The RCF has a status of getting programmed on the switch. This appears only transiently and not persistently.
switch# show bgp rcf detail Function: ACCEPT_ALL Status: active Update count: 1 Last updated: 00:00:41 ago Last update reason: function definition change Function: USES_MISSING_PFXL Status: inactive (prefix_list_v4 MISSING_PFXL missing) Update count: 2 Last updated: 00:02:41 ago Last update reason: external reference change
- Update count - Displays the total number of updates to the RCF.
- Last updated - Displays the time elapsed as HH:MM:SS if the last update occurred less than 24 hours ago. Otherwise, the time displays as DD:HH:MM.
- Last update reason - Displays the reason for the last update:
- function definition change - the RCF recompiled with a different definition.Recompiling the RCF by only adding white space does not increment the update count.
- external reference change - One of the RCF referenced external policy constructs has been added, removed, or modified.
The show bgp neighbors indicates if the RCF or route-map applied at the inbound or outbound BGP neighbors has a configuration for the point of application but not defined.
switch# show bgp neighbors BGP neighbor is 1.0.1.2, remote AS 500, internal link … Outbound route map is RM1 (configured but not defined) Inbound RCF function for IPv4 unicast is rcf1() (configured but not defined) …
RCF - IpRIB Agent Support
This topic contains the following sections:
- Applying RCF to IpRib Points of Application
- Dynamic Prefix List
- Filtered Unicast RIBs
- Next Hop Resolution Policy
Applying RCF to IpRib Points of Application
Dynamic Prefix List
EOS evaluates the RCF on RIB winning routes from all source protocols on a VRF to determine the dynamic prefix list state.
| Syntax | Example |
|---|---|
dynamic prefix-list <DYN_PFX_LIST> match vrf <VRF_NAME> source-protocol any rcf <FUNCTION_NAME>() |
dynamic prefix-list DPL_MATCH_ANY_PROTOCOL match vrf default source-protocol any rcf MATCH_ISIS_TAG() |
| Attribute | Support |
|---|---|
| aigp.metric | Read |
| igp.metric | Read |
| igp.tag | Read |
| isis.metric | Read |
| med | Read |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| source_protocol | Read |
Filtered Unicast RIBs
Use this feature to create subsets of the IPv4 or IPv6 Unicast RIB from routes matching the RCF to become members of the subset.
| Syntax | Example |
|---|---|
router general
vrf default
unicast-rib ( ipv4 | ipv6 ) NAME
match rcf FUNCTION_NAME()
|
router general
vrf default
unicast-rib ipv4 BACKBONE_COND
match rcf ROUTE_TO_BACKBONE()
|
| Attribute | Support |
|---|---|
| aigp.metric | Read |
| bgp.route_source | Read |
| igp.metric | Read |
| isis.metric | Read |
| med | Read |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| source_protocol | Read |
Next Hop Resolution Policy
The RCF evaluates RIB routes used for recursive resolution to determine if their dependent routes should be resolved.
| Syntax | Example |
|---|---|
router general
vrf <VRF_NAME>
rib ( ipv4 | ipv6 ) resolution policy rcf <FUNCTION_NAME>()
|
router general
vrf default
rib ipv4 resolution policy rcf ONLY_STATIC_OR_CONNECTED()
|
| Attribute | Support |
|---|---|
| aigp.metric | Read |
| bgp.route_source | Read |
| igp.metric | Read |
| isis.metric | Read |
| med | Read |
| prefix | Read |
| prefix.ip_version | Read |
| prefix.length | Read |
| rib.preference | Read |
| source_protocol | Read |
RCF - IS-IS Agent Support
This chapter covers the following topics:
- Configuring an RCF for IS-IS points of application.
- Displaying operational status and visibility into IS-IS configurations.
Applying an RCF to IS-IS Instance Points of Application
Use RCFs to filter routes and updating route attributes at different points of application in an IS-IS instance configuration.
BGP IPv4 Labeled Unicast Tunnel End-Point Redistribution
The RCF accepts BGP IPv4 Labeled Unicast tunnels end-point IP addresses and redistributes them into IS-IS.
| Syntax | Example |
|---|---|
router isis WORD [ vrf NAME ]
address-family ipv4 unicast
tunnel source-protocol bgp ipv4 labeled-unicast rcf FUNCTION_NAME()
|
router isis inst1
address-family ipv4 unicast
tunnel source-protocol bgp ipv4 labeled-unicast rcf ISIS_POLICY()
|
Redistribute Statement
| Syntax | Example |
|---|---|
router isis WORD [ vrf NAME ]
redistribute static rcf FUNCTION_NAME()
|
router isis default redistribute static rcf STATIC_POLICY() |
| Syntax | Example |
|---|---|
router isis WORD [ vrf NAME ]
redistribute connected rcf FUNCTION_NAME()
|
router isis default redistribute connected rcf CONNECTED_POLICY() |
| Syntax | Example |
|---|---|
router isis WORD [ vrf NAME ]
redistribute bgp rcf FUNCTION_NAME()
|
router isis default redistribute bgp rcf BGP_POLICY() |
IPv4 Unicast and IPv6 Unicast Address Family
Redistribute Statement
| Syntax | Example |
|---|---|
router isis NAME> [ vrf WORD ]
address-family ( ipv4 | ipv6 ) unicast
redistribute static rcf FUNCTION_NAME>()
|
router isis default
address-family ipv4 unicast
redistribute static rcf STATIC_POLICY()
address-family ipv6 unicast
redistribute static rcf STATIC_POLICY()
|
| Syntax | Example |
|---|---|
router isis NAME> [ vrf WORD ]
address-family ( ipv4 | ipv6 ) unicast
redistribute bgp rcf FUNCTION_NAME>()
|
router isis default
address-family ipv4 unicast
redistribute bgp rcf REDIST_POLICY()
address-family ipv6 unicast
redistribute bgp rcf REDIST_POLICY()
|
Displaying BGP-labeled Unicast Redistribution RCF Function Information
Apply the BGP-labeled tunnel redistribution RCF function to the BGP agent, and display the status using the show bgp rcf function_name command:
switch# show bgp rcf
Function Status Details
------------------------------ ------------------------------ ------------------------------
ACCEPT_ALL active
DENY_ALL active
USES_MISSING_PFXL prefix_list_v4 not found MISSING_PFXL
switch# show bgp rcf ACCEPT_ALL
Function Status Details
------------------------------ ------------------------------ ------------------------------
ACCEPT_ALL active
switch#
Displaying RCF IS-IS Agent Status
The implementation detail for this particular IS-IS point of policy application, where a route transitioning from a BGP route to a IS-IS route, RCF performs the policy application within the BGP agent. Use the show bgp rcf command to query the BGP agent state, rather than IS-IS agent state.
To view the status of RCF functions for BGP, use the show bgp rcf function_name:
switch# show bgp rcf
Function Status Detail
------------------------------ ------------------------------ ------------------------------
ACCEPT_ALL() active
DENY_ALL() active
USES_MISSING_PFXL() prefix_list_v4 not found MISSING_PFXL
switch# show bgp rcf ACCEPT_ALL()
FunctionStatus Detail
------------------------------ ------------------------------ ------------------------------
ACCEPT_ALL() active
- active - The RCF has a valid configuration and available for use.
- reference not found - The RCF refers to an external construct such as an undefined AS path list, community list, or prefix. The configuration does not accept routes evaluated against the RCF. The undefined reference can be found in the Details column.
- missing symbol - The RCF has a status of getting programmed on the switch. This appears only transiently and not persistently.
switch# show bgp rcf detail Function: ACCEPT_ALL Status: active Update count: 1 Last updated: 00:00:41 ago Last update reason: function definition change Function: USES_MISSING_PFXL Status: inactive (prefix_list_v4 MISSING_PFXL missing) Update count: 2 Last updated: 00:02:41 ago Last update reason: external reference change
- Update count - Displays the total number of updates to the RCF.
- Last updated - Displays the time elapsed as HH:MM:SS if the last update occurred less than 24 hours ago. Otherwise, the time displays as DD:HH:MM.
- Last update reason - Displays the reason for the last update:
- function definition change - the RCF recompiled with a different definition.Recompiling the RCF by only adding white space does not increment the update count.
- external reference change - One of the RCF referenced external policy constructs has been added, removed, or modified.
The show bgp neighbors indicates if the RCF or route-map applied at the inbound or outbound BGP neighbors has a configuration for the point of application but not defined.
switch# show bgp neighbors BGP neighbor is 1.0.1.2, remote AS 500, internal link … Outbound route map is RM1 (configured but not defined) Inbound RCF function for IPv4 unicast is rcf1() (configured but not defined) …
RCF - KernelFib Agent Support
This chapter covers the following topics:
- Configuring an RCF for KernelFib points of application.
- Displaying operational status and visibility into KernelFib configurations.
Applying RCF to KernelFib Points of Application
Use RCF functions to filter routes and control programming routes into the kernel at various points of applications.
IPv4 and IPv6 VRF Address Family
The following configurations allow the filtering of routes and modifying attributes while creating IPv4 and IPv6 Unicast routes in the kernel for a VRF, default or others.
Offloading Route Hardware
If a FUNCTION_NAME() returns true. the KernelFib agent uses a forwarding device instance as the next-hop interface of the kernel route, instead of the regular next-hop interface in the FIB route, when programming the FIB route into the kernel routing table for the VRF network namespace.
Packets sent over the forwarding device inset into the ingress pipeline of harware forwarding, and cause the necessary route lookup and forwarding in hardware instead of the kernel. Kernel traffic covered by this type of route benefits from all of the convergence optimizations and functionality provided by hardware forwarding.
| Syntax | Example |
|---|---|
software forwarding hardware offload route rcf FUNCTION_NAME() |
router kernel vrf ABC
address-family ipv4
software forwarding hardware offload route rcf OFFLOAD_POLICY()
|
Displaying RCF KernelFib Status
Use the show kernelfib rcf detail FUNCTION_NAME command to display the status of RCF functions in the KernelFib agent.
switch# show kernelfib rcf Function Status Details ------------------------------ ------------------------------ ------------------------------ ACCEPT_ALL active DENY_ALL active USES_MISSING_PFXL prefix_list_v4 not found MISSING_PFXL switch# show kernelfib rcf ACCEPT_ALL Function Status Details ------------------------------ ------------------------------ ------------------------------ ACCEPT_ALL active
- active - The RCF has a valid configuration and available for use.
- reference not found - The RCF refers to an external construct such as an undefined AS path list, community list, or prefix. The configuration does not accept routes evaluated against the RCF. The undefined reference can be found in the Details column.
- missing symbol - Programming currently in progress for the RCF. This status appears transiently and not persistently in the output.
Use the detail parameter to view information on function updates:
switch# show kernelfib rcf detail Function: ACCEPT_ALL Status: active Update count: 1 Last updated: 00:00:41 ago Last update reason: function definition change Function: USES_MISSING_PFXL Status: inactive (prefix_list_v4 MISSING_PFXL missing) Update count: 2 Last updated: 00:02:41 ago Last update reason: external reference change
- Update count - Displays the total number of updates to the RCF.
- Last updated - Displays the time elapsed as HH:MM:SS if the last update occurred less than 24 hours ago. Otherwise, the time displays as DD:HH:MM.
- Last update reason - Displays the reason for the last update:
- function definition change - the RCF recompiled with a different definition. Recompiling the RCF by only adding white space does not increment the update count.
- external reference change - One of the RCF referenced external policy constructs has been added, removed, or modified.
RCF - LDP Agent Support
This chapter covers the following topics:
- Configuring an RCF for LDP points of application.
- Displaying operational status and visibility into LDP configurations.
Applying an RCF to LDP Points of Application
Use RCFs to filter routes and updating route attributes at different points of application in LDP configuration.
BGP IPv4 Labeled Unicast Tunnel End-Point Redistribution
The RCF accepts BGP IPv4 Labeled Unicast tunnels end-point IP addresses and redistributes them into LDP.
| Syntax | Example |
|---|---|
tunnel source-protocol bgp ipv4 labeled-unicast rcf FUNCTION_NAME |
mpls ldp tunnel source-protocol bgp ipv4 labeled-unicast rcf LDP_POLICY() |
Displaying RCF LDP Status
To view the status of RCF functions in the LdpAgent, use the show mpls ldp rcf detail FUNCTION_NAME command.
switch# show mpls ldp rcf Function Status Details ------------------------------ ------------------------------ ------------------------------ ACCEPT_ALL active DENY_ALL active
- active - The RCF has a valid configuration and available for use.
- reference not found - The RCF refers to an external construct such as an undefined AS path list, community list, or prefix. The configuration does not accept routes evaluated against the RCF. The undefined reference can be found in the Details column.
- missing symbol - Programming currently in progress for the RCF. This status appears transiently and not persistently in the output.
Use the detail parameter to view information on function updates:
switch# show mpls ldp rcf detail Function: ACCEPT_ALL Status: active Update count: 1 Last updated: 00:00:41 ago Last update reason: function definition change Function: USES_MISSING_PFXL Status: inactive (prefix_list_v4 MISSING_PFXL missing) Update count: 2 Last updated: 00:02:41 ago Last update reason: external reference change switch#
- Update count - Displays the total number of updates to the RCF.
- Last updated - Displays the time elapsed as HH:MM:SS if the last update occurred less than 24 hours ago. Otherwise, the time displays as DD:HH:MM.
- Last update reason - Displays the reason for the last update:
- function definition change - the RCF recompiled with a different definition. Recompiling the RCF by only adding white space does not increment the update count.
- external reference change - One of the RCF referenced external policy constructs has been added, removed, or modified.
RCF - VrfLeak Agent Support
This chapter covers the following topics:
- Configuring an RCF for VRF Leaking points of application.
- Displaying operational status and visibility into VRF Leak Status.
Applying a RCF to VRF Leaking Points of Application
VRF Leaking allows a route in one VRF to specify a next-hop in another VRF and install routes in the RIB and FIB tables. RCF functions can be used for filtering routes and controlling certain attributes of routes when leaked from one VRF to another using the VrfLeak Agent.
| Syntax | Example |
|---|---|
router general
vrf vrf_name
leak routes source-vrf vrf_name subscribe rcf function_name()
|
router kernel vrf ABC
address-family ipv4
software forwarding hardware offload route rcf OFFLOAD_POLICY()
|
Displaying VrfLeak Agent Status
Use the show vrf leak rcf function_name to display the status of the RCF VrfLeak agent on the switch.
switch# show vrf leak rcf Function Status Details ------------------------------ ------------------------------ ------------------------------ ACCEPT_ALL active DENY_ALL active USES_MISSING_PFXL prefix_list_v4 not found MISSING_PFXL switch# show vrf leak rcf ACCEPT_ALL Function Status Details ------------------------------ ------------------------------ ------------------------------ ACCEPT_ALL active
- active - RCF fully configured and available for use.
- reference not found - The RCF contains an external reference to an undefined EOS policy construct such as an AS path list, community list, or prefix list. The RCF does not accept the evaluated routes. Locate the undefined reference in the Details column. In the example, the RCF USES_MISSING_PFXL cannot locate the prefix list, prefix_list_v4.
- missing symbol - Programming currently in progress for the RCF. This status appears transiently and not persistently in the output.