RouterOS version 7.1rc6 has been released in public “development” channel!
What’s new in 7.1rc6 (2021-Nov-04 18:20):
*) bgp - fixed connection establishment if peer is in VRF;
*) bgp - fixed interface addition to “link-local” nexthops;
*) capsman - fixed CAP upgrade process when upgrading from RouterOS v6;
*) certificate - improved stability when sending bogus SCEP message;
*) certificate - resolveed issue with public key generation when digest algorithm is unspecified and processing certificate signing requests;
*) l3hw - fixed HW offloading for connected bridge routes;
*) l3hw - fixed source MAC address usage for routed packets for CRS317, CRS309, CRS312, CRS326-24S+2Q+ and CRS354 devices;
*) lte - added AT chat support for Telit LN960;
*) lte - do not allow to run “scan” and “cell-monitor” commands if SIM is not present;
*) lte - fixed modem port initialization on KNOT;
*) ospf - properly set instance after upgrade from RouterOS v6;
*) route-filters - added “suppress-hw-offload” parameter;
*) route-filters - fixed “as-path” regexp matcher;
*) ssh - made SSH work in VRF’s;
*) system - improved system stability if device is upgraded from RouterOS and/or RouterBOOT v6.41.4 or older;
*) tile - improved system stability when sending EoIP packet over interface that is being disabled;
*) wifiwave2 - fixed assignment of channel profiles to interfaces;
*) wifiwave2 - fixed interface list matching in “access-list”;
The added examples are regexp strings, but of course we already know these from RouterOS v6.
What I am looking for is the syntax for a rule matching as-path.
So like:
if ( bgp-med < 30 ) { accept }
But now with as-path instead of bgp-med. Anything I try gets rejected as a syntax error.
Also, a clarification of what this text means:
There are two common ways how to operate with AS Path data:
convert whole AS path to string and let regexp operate on the string (ROS v6 or Cisco style)
let regexp operate on each entry in the AS path as a number (ROS v7, Juniper style)
The latter method is much faster and less resource-intensive than the string matching approach.
This would seem to indicate that the as-path match gets passed a list of AS numbers and there are operators that would match one (e.g. the last) or “any item” in that list.
But the regexp examples still seem to assume the match is against an expanded numeric string of the entire path, mentioned above as “ROS v6 or Cisco style”.
So, is v7 still using that style?
No syntax error, all of provided regexp examples from the documentation works without syntax errors
This would seem to indicate that the as-path match gets passed a list of AS numbers and there are operators that would match one (e.g. the last) or “any item” in that list.
But the regexp examples still seem to assume the match is against an expanded numeric string of the entire path.
No examples represent exactly what documentation says, you should look through examples more carefully (look at what is matched and what is not matched from the example).
String matching would work differently, lets look at very basic example: regex “^1234” in ROS v7 will match AS Path that starts exactly with ASN 1234, but string matching would match string that starts with ^1234, which means that it will match AS path that could start with 1234, 12345, 1234..n
Basically on string regexp you are performing per character match, on v7 style matching you are performing per ASN match.
Ok I have been trying with regexp in { } brackets (as it was previously listed in the documentation, but that has now been removed I see) and also with the keyword “regexp” and the operator ~ and with the regexp in quotes as it is usually required.
Will try again with the form shown above, thanks for the hint.
It would not hurt to show at least one such example in the documentation…