279
Predefined user roles
network-admin
Parameters
rule rule-number: Assigns the match rule an ID in the range of 1 to 16. A smaller ID represents a
higher match priority.
option option-code: Specifies a DHCPv6 option by its number in the range of 1 to 65535.
ascii ascii-string: Specifies an ASCII string of 1 to 128 characters.
offset offset: Specifies the offset in bytes after which the match operation starts. The value range is
0 to 65534. If you specify an ASCII string, a packet matches the rule if the option content after the
offset is the same as the ASCII string. If you specify a hexadecimal number, a packet matches the
rule if the option content of the specified length after the offset is the same as the hexadecimal
number.
partial: Enables partial match. A packet matches the rule if the specified option in the packet
contains the ASCII string or hexadecimal number specified in the rule. For example, if you specify
abc in the rule, option content xabc, xyzabca, xabcyz, and abcxyz all match the rule.
hex hex-string: Specifies a hexadecimal number. The length of the hexadecimal number must be an
even number in the range of 2 to 256.
mask mask: Specifies the mask for the match operation. The mask is a hexadecimal number whose
length is an even number in the range of 2 to 256 and must be the same as the hex-string length. The
DHCPv6 server selects option content of the mask length from the start and ANDs the selected
option content and the specified hexadecimal number with the mask. The packet matches the rule if
the two AND operation results are the same.
length length: Specifies the length of the option content to be matched, in the range of 1 to 128 bytes.
The length must be the same as the hex-string length.
relay-agent gateway-ipv6-address: Specifies a link-address field value. The value is an IPv6
address. A packet matches the rule if its link-address field value is the same as that in the rule.
Usage guidelines
If a DHCPv6 request sent by a DHCPv6 client matches a rule in a DHCPv6 user class, the DHCPv6
client matches the user class.
You can configure multiple match rules for a DHCPv6 user class. Each match rule is uniquely
identified by a rule ID within its type (option or relay agent address).
• If the rule that you are configuring has the same ID and type as an existing rule, the new rule
overwrites the existing rule.
• If the rule that you are configuring has the same ID as an existing rule but a different type, the
new rule takes effect and coexists with the existing rule. As a best practice, do not assign the
same ID to rules of different types.
• Rules of different IDs cannot have the same rule content.
When you configure an if-match option rule, follow these guidelines:
• To match packets that contain an option, specify only the option-code argument.
• To match a hexadecimal number by AND operations, specify the option option-code hex
hex-string mask mask options.
• To match a hexadecimal number directly, specify the option option-code hex hex-string [ offset
offset length length | partial ] options. If you do not specify the offset, length, or partial
parameter, a packet matches a rule if the option content starts with the hexadecimal number.
• To match an ASCII string, specify the option option-code ascii ascii-string [ offset offset |
partial ] options. If you do not specify the offset or partial parameter, a packet matches a rule
if the option content starts with the ASCII string.