Fortinet white logo
Fortinet white logo

Administration Guide

AS path lists

AS path lists

AS path lists use regular expressions to compare and match the AS_PATH attribute for a BGP route. They can be used to filter inbound or outbound routes from a BGP neighbor, or as matching criteria in a route map to match an AS_PATH in a BGP route.

To configure an AS path list:
config router aspath-list
    edit <name>
        config rule
            edit <id>
                set action {deny | permit}
                set regexp <string>
            next
        end
    next
end
To use an AS path list in BGP:
config router bgp
    config neighbor
        edit <ip>
            set filter-list-in <string>
            set filter-list-in6 <string>
            set filter-list-out <string>
            set filter-list-out6 <string>
        next
    end
end

filter-list-in <string>

Enter the BGP filter for IPv4 inbound routes.

filter-list-in6 <string>

Enter the BGP filter for IPv6 inbound routes.

filter-list-out <string>

Enter the BGP filter for IPv4 outbound routes.

filter-list-out6 <string>

Enter the BGP filter for IPv6 outbound routes.

To use an AS path list in a route map:
config router route-map
    edit <name>
        config rule
            edit <id>
                set match-as-path <string>
            next
        end
    next
end

match-as-path <string>

Match a BGP AS path list.

AS path lists

AS path lists

AS path lists use regular expressions to compare and match the AS_PATH attribute for a BGP route. They can be used to filter inbound or outbound routes from a BGP neighbor, or as matching criteria in a route map to match an AS_PATH in a BGP route.

To configure an AS path list:
config router aspath-list
    edit <name>
        config rule
            edit <id>
                set action {deny | permit}
                set regexp <string>
            next
        end
    next
end
To use an AS path list in BGP:
config router bgp
    config neighbor
        edit <ip>
            set filter-list-in <string>
            set filter-list-in6 <string>
            set filter-list-out <string>
            set filter-list-out6 <string>
        next
    end
end

filter-list-in <string>

Enter the BGP filter for IPv4 inbound routes.

filter-list-in6 <string>

Enter the BGP filter for IPv6 inbound routes.

filter-list-out <string>

Enter the BGP filter for IPv4 outbound routes.

filter-list-out6 <string>

Enter the BGP filter for IPv6 outbound routes.

To use an AS path list in a route map:
config router route-map
    edit <name>
        config rule
            edit <id>
                set match-as-path <string>
            next
        end
    next
end

match-as-path <string>

Match a BGP AS path list.