Steve,
This is a new feature of EXOS v16.1.1 and I don't have a physical switch to try it, so I don't know if this will work...
The documentation says:
"Time To Live with mask.The mask is optional, and it can be decimal value or a hexadecimal value.Only those bits of the ttl whose corresponding bit in the mask is set to 1 will be used as match criteria.This can be used to match IPv4 Time-To-Live and IPv6 Hop Limit."
So, if my undestanding of this is correct, if you were looking for 7 or less, it would be easy. Mask off the last three bits with 248 (1111 1000) and if the result is zero, you're in. It would look like
ttl 0 mask 248; # this should match 1 to 7
But "less than 6" means 5 (0101), 4 (0100), 3 (0011), 2 (0010) and 1 (0001) so you can't check that with a single mask. You have to use two, to check for 10x and 0xx.
entry test5-4_ttl_mask {
if match any {
ttl 4 mask 254; # this should match 4 and 5
} then {
deny;
}
}
entry test3-2-1_ttl_mask {
if match any {
ttl 0 mask 252; # this should match 1 to 3
} then {
deny;
}
}
Please, let me know if this works...