Fortinet Document Library

Version:


Table of Contents

CLI Reference

6.0.0
Download PDF
Copy Link

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 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 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 that denies the matching of all routes, which the FortiGate applies last.

config router aspath-list
    edit {name}
    # Configure Autonomous System (AS) path lists.
        set name {string}   AS path list name. size[35]
        config rule
            edit {id}
            # AS path list rule.
                set id {integer}   ID. range[0-4294967295]
                set action {deny | permit}   Permit or deny route-based operations, based on the route's AS_PATH attribute.
                        deny    Deny route-based operations.
                        permit  Permit route-based operations.
                set regexp {string}   Regular-expression to match the Border Gateway Protocol (BGP) AS paths. size[63]
            next
    next
end

Additional information

The following section is for those options that require additional explanation.

regexp {string}

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 regular expression value using double-quotation marks.

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 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 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 that denies the matching of all routes, which the FortiGate applies last.

config router aspath-list
    edit {name}
    # Configure Autonomous System (AS) path lists.
        set name {string}   AS path list name. size[35]
        config rule
            edit {id}
            # AS path list rule.
                set id {integer}   ID. range[0-4294967295]
                set action {deny | permit}   Permit or deny route-based operations, based on the route's AS_PATH attribute.
                        deny    Deny route-based operations.
                        permit  Permit route-based operations.
                set regexp {string}   Regular-expression to match the Border Gateway Protocol (BGP) AS paths. size[63]
            next
    next
end

Additional information

The following section is for those options that require additional explanation.

regexp {string}

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 regular expression value using double-quotation marks.