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 peer192.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 information about using the RCF Language syntax to program RCFs and contains the following sections:
- Comments
- Functions
- Function Calls
- RCF Function Arguments
- Trilean Logic States
- Expressions
- 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
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
RCF 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;
}
RCF 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.
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 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
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:
|
FUNC2() evaluates conditionally and returns the result by SEQ_OP() only if FUNC1() evaluation returns unknown. |
|
FUNC2() evaluates conditionally and returns the result by AND() only if FUNC1() evaluation returns true. |
|
FUNC2() evaluates conditionally and returns the result by OR() only if FUNC1() evaluation returns false or unknown. |
|
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.
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.
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 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 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)#
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 |
---|---|
|
|
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
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 |
---|---|
|
|
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.
/p>Syntax | Example |
---|---|
|
|
L3 EVPN import
The IMPORT_FUNCTION_NAME() function applies to the unicast route created on import.
Syntax | Example |
---|---|
|
|
L3 EVPN export
The EXPORT_FUNCTION_NAME() function applies to the EVPN route created on export.
Syntax | Example |
---|---|
|
|
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 |
---|---|
|
|
IPv4 and IPv6 Labeled Unicast
Inbound BGP Neighbor Application
Syntax | Example |
---|---|
|
|
Outbound BGP Neighbor Application
Syntax | Example |
---|---|
|
|
LDP Tunnel Distribution
Only the IPv4 Labeled Unicast Address Family supports LDP tunnel redistribution.
Syntax | Example |
---|---|
|
|
IS-IS Segment Routing Tunnel Redistribution
Only the IPv4 Labeled Unicast Address Family supports IS-IS Segment Routing Tunnel Redistribution.
Syntax | Example |
---|---|
|
|
IPv4 and IPv6 Unicast Address Family
Inbound BGP Neighbor Application
Syntax | Example |
---|---|
|
|
Outbound BGP Neighbor Application
Syntax | Example |
---|---|
|
|
Redistribute Statement
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
Network Statement
The NETWORK_FUNCTION() evaluates the route injected into BGP through the network statement.
Syntax | Example |
---|---|
|
|
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 (RFC 6368) if it exists, otherwise uses the VPN path attributes.
The VPN_FUNCTION_NAME() applies to the VPN route imported using the provider attributes. Modifications to the path attributes in the VPN_FUNCTION_NAME() do not apply to the provider path.
Syntax | Example |
---|---|
|
|
MPLS L3 VPN Export
The EXPORT_FUNCTION_NAME() function applies to the unicast route created on export. The unicast route path attributes push into a BGP Customer Attribute Set if you configured iBGP as PE-CE for BGP/MPLS L3 VPNs. The VRF_FUNCTION_NAME() function applies to the unicast route to export. Modifications to the The VRF_FUNCTION_NAME() function do not apply to the provider path.
Syntax | Example |
---|---|
|
|
L3 EVPN Import
The IMPORT_FUNCTION_NAME() function applies to the unicast route created on import.
Syntax | Example |
---|---|
|
|
L3 EVPN Export
The EXPORT_FUNCTION_NAME() function applies to the unicast route created on export.
Syntax | Example |
---|---|
|
|
Default Route Originate Neighbor 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 |
---|---|
|
|
MPLS L3 Default Route Export
Syntax | Example |
---|---|
|
|
L3 EVPN Default Route Export
Syntax | Example |
---|---|
|
|
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 |
---|---|
|
|
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 |
---|---|
|
|
Unicast Redistribution
Syntax | Example |
---|---|
|
|
EVPN Address Family
Inbound BGP Neighbor Application
Syntax | Example |
---|---|
|
|
Outbound BGP Neighbor Application
Syntax | Example |
---|---|
|
|
Default Route Originate Neighbor Application
Syntax | Example |
---|---|
|
|
MPLS L3 VPN IPv4 and IPv6 Address Family
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
Route-Target Membership Address Family
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
IPv4 and IPv6 Unicast Flowspec Address Family
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
IPv4 and IPv6 VPN Flowspec Address Family
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
VPLS Address Family
Syntax | Example |
---|---|
|
|
Syntax | Example |
---|---|
|
|
Configuring Dynamic Prefix Lists
Syntax | Example |
---|---|
|
|
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
Applying RCF to IpRib Points of Application
Filtered Unicast RIBs
Use this feature to create subsets of the IPv4 or IPv6 Unicast RIB with routes matching the RCF become members of the subset.
Syntax | Example |
---|---|
|
|
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 |
---|---|
|
|
Redistribute
Syntax | Example |
---|---|
|
|
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 |
---|---|
|
|
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 |
---|---|
|
|
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 |
---|---|
|
|
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.