< Home

pppoe intermediate-agent information format

Function

The pppoe intermediate-agent information format command configures the format of fields added to PPPoE packets.

The undo pppoe intermediate-agent information format command restores the format of fields added to PPPoE packets to default values.

By default, the format of fields circuit-id and remote-id added to PPPoE packets is common.

Format

pppoe intermediate-agent information [ vlan vlan-id ] [ ce-vlan cevlan-id ] format { circuit-id | remote-id } { common | extend | user-defined text }

undo pppoe intermediate-agent information format all

undo pppoe intermediate-agent information [ vlan vlan-id ] [ ce-vlan cevlan-id ] format { circuit-id | remote-id }

Parameters

Parameter

Description

Value

vlan vlan-id

Indicates the outer VLAN ID.

NOTE:

This parameter is not supported in the system view.

The value is an integer that ranges from 1 to 4094.

ce-vlan cevlan-id

Indicates the end inner VLAN ID.

NOTE:

This parameter is not supported in the system view.

The value is an integer that ranges from 1 to 4094.

circuit-id

Indicates the circuit ID (CID).

-

remote-id

Indicates the remote ID (RID).

-

common

Indicates the standard fill format.

  • CID format: {eth|trunk}slot ID/subcard ID/port ID:svlan.cvlan host name0/0/0/0/0, in ASCII format
  • RID format: device MAC address (6 bytes), in ASCII format

-

extend

Indicates the extended format.

  • CID format: circuit-id type (0) + length (4) + S-VLAN ID (2 bytes) + slot ID (5 bits) + subslot ID (3 bits) + port (1 byte), in hexadecimal notation

  • RID format: remote-id type (0) + length (6) + MAC address (6 bytes), in hexadecimal notation

In the format of the CID or RID, the values in parentheses without a unit are fixed values of the fields, and the values in parentheses with a unit indicate the length of the corresponding fields.

-

user-defined text

Indicates the user-defined format.

The text parameter specifies a user-defined format, and the value is a string of 1 to 127 characters. The details about the customized format string are provided in Precautions.

all

Indicates the all format of fields.

NOTE:

This parameter is not supported in the system view.

-

Views

System view and interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After PPPoE+ is enabled globally, the default policy for processing user-side PPPoE packets is replace. The device replaces original information fields in the PPPoE packets received at the user side with those in common format. You can run the pppoe intermediate-agent information format command to change the format of information fields.

When the policy for processing user-side PPPoE packets is replace and the pppoe intermediate-agent information format command is executed, all interfaces add fields in a specified format to received PPPoE packets in the system view.

When the pppoe intermediate-agent information format command is configured, the device uses the following matching rules to encapsulate the information fields in PPPoE packets:
  • For a double-tagged packet, the device matches the VLAN IDs in both the outer and inner VLAN tags. If the match fails, the device matches the VLAN ID in the inner VLAN tag, followed by that in the outer VLAN tag. If the match still fails, the device considers the packet does not carry a VLAN ID, and does not encapsulate the packet.
  • For a single-tagged packet, the device matches the VLAN ID in the outer VLAN tag. If the match fails, the device considers the packet does not carry a VLAN ID, and does not encapsulate the packet.

If the pppoe intermediate-agent information format command is configured in both the interface and system views, the configuration in the interface view takes effect.

Fields in PPPoE Intermediate-Agent Information packets support the following formats: common, extend, and user-defined. The formats are the same as those of DHCP Option 82. For description of the three parameters, see dhcp option82 format.

Prerequisites

PPPoE+ has been enabled globally by running the pppoe intermediate-agent information enable command.

Precautions

You can use the following keywords to define the format. The format string can use the hexadecimal notation, ASCII format, or combination of the two formats.
  • sysname: indicates the ID of the access point. This keyword is valid only in ASCII format.
  • portname: indicates the name of a port. For example, GigabitEthernet0/0/1. This keyword is valid only in ASCII format.
  • porttype: indicates the type of a port. This keyword is valid in ASCII or hexadecimal notation.
  • iftype: indicates the type of an interface. This keyword is valid only in ASCII format.
  • mac: indicates the MAC address of an interface. In ASCII format, the value is expressed as H-H-H in hexadecimal notation, and the value is a number of six bytes.
  • Slot: specifies the slot ID. This keyword is valid in ASCII or hexadecimal notation.
  • subslot: indicates the subslot ID. This keyword is valid in ASCII or hexadecimal notation.
  • port: indicates the port number. This keyword is valid in ASCII or hexadecimal notation.
  • svlan: indicates the outer VLAN ID. The value ranges from 0 to 4095. This keyword is valid in ASCII or hexadecimal notation.
  • cvlan: indicates the inner VLAN ID. The value ranges from 0 to 4095. This keyword is valid in ASCII or hexadecimal notation.
  • n: specifies the value of the svlan or cvlan keyword if the outer VLAN tag or inner VLAN tag does not exist. The n keyword is on the left of the svlan or cvlan keyword. If the corresponding VLAN does not exist, the default value of the svlan or cvlan keyword is 4096 in ASCII format and is all Fs in hexadecimal notation. If the keyword n is added to the left of the svlan or cvlan keyword, the svlan or cvlan keyword is set to 0. This keyword is valid in ASCII or hexadecimal notation.
  • length: indicates the total length of the keywords following the length keyword.
  • portdescription: indicates the interface description. It is available only in ASCII format.

Separators must be added between keywords; otherwise, they cannot be parsed. The separators cannot be numbers.

The symbols used in the format string are as follows:
  • The symbol % followed by a keyword indicates the format of the keyword.
  • A number between the % symbol and a keyword indicates the length of the keyword. In an ASCII character string, %05 has the same meaning as %05d in the C language. In a hexadecimal character string, the number indicates the length of the corresponding keyword in bits.
  • The [] symbol indicates an optional keyword. Each pair of brackets can contain only one keyword, svlan or cvlan. The keyword in the [] symbol is added to information fields only if the corresponding VLAN ID exists. To facilitate syntax check, the system does not support nested [] symbols.
  • The \ symbol is an escape character. The %, \, and [] symbols following the escape character indicate themselves. For example, \\ represents \.
  • The content in quotation marks (" ") is expressed in a character string, and the content outside the quotation marks are expressed in hexadecimal notation.
  • Other symbols are processed as common characters. The rules for setting the format string in ASCII format or hexadecimal notation are as follows:
    • An ASCII character string can contain letters, numerals, and symbols ! @ # $ % ^ & * () _ + | - = \ [] {} ; : '" / ? . , <> `.
    • By default, the length of each keyword in an ASCII character string is the actual length of the keyword.
    • A hexadecimal notation string can contain numerals, space characters, %, and the keywords.
    • In a hexadecimal notation string, numbers are encapsulated in information fields. A number in the range of 0-255 occupies one byte; a number in the range of 256-65535 occupies two bytes; a number in the range of 65536-4294967295 occupies four bytes. Numbers larger than 4294967295 are not supported. Multiple numbers must be separated by space characters; otherwise, they are considered as a number.
    • All the space characters in a hexadecimal character string are ignored.
    • By default, each slot ID, subslot ID, port number, and VLAN ID in a hexadecimal notation string occupy two bytes. The length field occupies one byte.
    • If the length of each keyword in a hexadecimal character string is specified, the total length of the hexadecimal character string must be a multiple of 8. If the specified length of a keyword is longer than 32 bits, the first 32 bits of the keyword are the actual keyword value, and other bits are set to 0.
    • A hexadecimal character string can contain only the keywords whose values are numbers. Other keywords, such as the port name, cannot be added to the hexadecimal character string.
    • If a string is not contained in quotation marks, it is encapsulated in hexadecimal notation. To encapsulate to the string in the ASCII format, add the string into a pair of quotation marks. For example, the slot ID is 3, and the port ID is 4. If the format string is %slot %port, the value of the string after encapsulation is a hexadecimal number 00030004. If the format string is "%slot %port", the value of the string after encapsulation is 3 4.
    • A format string can contain both hexadecimal strings and ASCII strings, for example, %slot %port "%sysname %portname:%svlan.%cvlan."

Example

# Configure the extended format for the remote-id field added to PPPoE packets.

<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
[HUAWEI] pppoe intermediate-agent information format remote-id extend

# Configure the user-defined format for the circuit-id field added to PPPoE packets and encapsulate the port name, outer VLAN ID, inner VLAN ID, and host name in ASCII format.

<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
[HUAWEI] pppoe intermediate-agent information format circuit-id user-defined "%portname:%svlan.%cvlan %sysname"

# Configure the extended format for the remote-id field added to PPPoE packets on GE1/0/1.

<HUAWEI> system-view
[HUAWEI] pppoe intermediate-agent information enable
[HUAWEI] interface gigabitethernet 1/0/1
[HUAWEI-GigabitEthernet1/0/1] pppoe intermediate-agent information format remote-id extend
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >