router : aspath-list
Use this command to set or unset BGP AS-path list parameters. By default, BGP uses an ordered list of Autonomous System (AS) numbers to describe the route that a packet takes to reach its destination. A list of these AS numbers is called the AS path. You can filter BGP routes using AS path lists.
When the FortiGate unit receives routing updates from other autonomous systems, it can perform operations on updates from neighbors and choose the shortest path to a destination. The shortest path is determined by counting the AS numbers in the AS path. The path that has the least AS numbers is considered the shortest AS path.
Use the config router aspath-list command to define an access list that examines the AS_PATH attributes of BGP routes to match routes. Each entry in the AS-path list defines a rule for matching and selecting routes based on the setting of the AS_PATH attribute. The default rule in an AS path list (which the FortiGate unit applies last) denies the matching of all routes.
config router aspath-list
edit <aspath_list_name>
config rule
edit <as_rule_id>
set action {deny | permit}
set regexp <regexp_str>
The action and regexp fields are required.
edit <aspath_list_name>
Enter a name for the AS path list.
No default.
config rule variables
edit <as_rule_id>
Enter an entry number for the rule. The number must be an integer.
No default.
action {deny | permit}
Deny or permit operations on a route based on the value of the route’s AS_PATH attribute.
No default.
regexp <regexp_str>
Specify the regular expression that will be compared to the AS_PATH attribute (for example, ^730$).
The value is used to match AS numbers. Delimit a complex regexp_str value using double-quotation marks.