nat position

Function

The nat position command configures a NAT flexible flow log or user log template.

The undo nat position command deletes a NAT flexible flow log or user log template.

By default, no NAT flexible flow log template is configured.

This command is supported only on the NetEngine 8000 F1A.

Format

nat position position-number fixed-string interval-string [ create | free ]

nat position position-number { timestamp-year | timestamp-month | timestamp-date | timestamp-hour | timestamp-minute | timestamp-second | starttime-year | starttime-month | starttime-date | starttime-hour | starttime-minute | starttime-second | timestamp-month-en | timestamp-month-abbreviation | timestamp-second-dec | timestamp-second-hex | starttime-month-en | starttime-month-abbreviation | starttime-second-dec | starttime-second-hex | endtime-second-dec | endtime-second-hex | host-ip | app-name | scene | source-ip | destination-ip | vpn-id | session-id | protocol | nat-source-ip | source-port | nat-source-port | destination-port | instance-id | pool-id | slot-id | cpu-id | sequence-hex | sequence-dec | cgn-ip | extend-first | extend-second | extend-third | extend-fourth | extend-fifth | extend-sixth | extend-seventh | extend-eighth } [ interval-string ] [ create | free ]

undo nat position position-number [ { timestamp-year | timestamp-month | timestamp-date | timestamp-hour | timestamp-minute | timestamp-second | starttime-year | starttime-month | starttime-date | starttime-hour | starttime-minute | starttime-second | timestamp-month-en | timestamp-month-abbreviation | timestamp-second-dec | timestamp-second-hex | starttime-month-en | starttime-month-abbreviation | starttime-second-dec | starttime-second-hex | endtime-second-dec | endtime-second-hex | host-ip | app-name | scene | source-ip | destination-ip | vpn-id | session-id | protocol | nat-source-ip | source-port | nat-source-port | destination-port | instance-id | pool-id | slot-id | cpu-id | sequence-hex | sequence-dec | cgn-ip | fixed-string | extend-first | extend-second | extend-third | extend-fourth | extend-fifth | extend-sixth | extend-seventh | extend-eighth } [ interval-string ] [ create | free ] ]

Parameters

Parameter Description Value
position-number

Specifies the ID of a field.

The value is an integer ranging from 0 to 63.

timestamp-year

Indicates the year in a timestamp.

-

timestamp-month

Indicates the month in a timestamp.

-

timestamp-date

Indicates the day in a timestamp.

-

timestamp-hour

Indicates the hour in a timestamp.

-

timestamp-minute

Indicates the minute in a timestamp.

-

timestamp-second

Indicates the second in a timestamp.

-

starttime-year

Indicates the start year.

-

starttime-month

Indicates the start month.

-

starttime-date

Indicates the start date.

-

starttime-hour

Indicates the start hour.

-

starttime-minute

Indicates the start minute.

-

starttime-second

Indicates the start second.

-

timestamp-month-en

Indicates the month in a timestamp abbreviation.

-

timestamp-month-abbreviation

Indicates the month in a timestamp abbreviation.

-

timestamp-second-dec

Indicates the second in a timestamp in decimal notation.

-

timestamp-second-hex

Indicates the second in a timestamp in hexadecimal notation.

-

starttime-month-en

Month in the start timein full spelling.

-

starttime-month-abbreviation

Month in the start time in abbreviated form.

-

starttime-second-dec

Indicates the second in a start time in decimal notation.

-

starttime-second-hex

Indicates the second in a start time in hexadecimal notation.

-

endtime-second-dec

Indicates the second in an end time in decimal notation.

-

endtime-second-hex

Indicates the second in an end time in hexadecimal notation.

-

host-ip

Indicates a device IP address that can be configured using the nat log host command.

-

app-name

Indicates the name of a log server.

-

scene

Indicates a scenario.

-

source-ip

Indicates the source IP address.

-

vpn-id

Indicates the ID of a user VPN.

-

session-id

Indicates the ID of a session table.

-

nat-source-ip

Indicates the source IP address after NAT is implemented.

-

instance-id

Indicates the ID of a instance.

-

pool-id

Indicates the ID of an address pool.

-

slot-id

Indicates a slot ID.

-

cpu-id

Indicates the ID of a CPU.

-

sequence-hex

Indicates a sequence number in hexadecimal notation.

-

sequence-dec

Indicates a sequence number in decimal notation.

-

cgn-ip

Indicates the management IP address of a CGN device.

This field is optional for the logs directly forwarded by the CGN device and is mandatory for the logs forwarded by an intermediate device.

-

extend-first

Indicates reserved field 1.

-

extend-second

Indicates reserved field 2.

-

extend-third

Indicates reserved field 3.

-

extend-fourth

Indicates reserved field 4.

-

extend-fifth

Indicates reserved field 5.

-

extend-sixth

Indicates reserved field 6.

-

extend-seventh

Indicates reserved field 7.

-

extend-eighth

Indicates reserved field 8.

-

create

Allocates ports to users or creates a flow table.

-

free

Releases user ports or makes a flow table age out.

-

fixed-string interval-string

Specifies a fixed character string of the flexible log template, such as the priority and version. For details, see "User Syslog Format" and "Flow Syslog Format" in Feature Description.

The value is a string of 1 to 31 case-sensitive characters. The value starts with and ends at a double quotation mark (") and at least one character must be within the double quotation marks (").

destination-ip

Indicates the destination IP address.

-

protocol

Indicates a protocol.

-

source-port

Indicates the source port number in packets.

-

nat-source-port

Indicates the source port after NAT is implemented.

-

destination-port

Indicates the destination port number in packets.

-

Views

Flexible log template view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
nat write

Usage Guidelines

The NAT syslog format can be customized based on the customer log system. To enable customization of log formats, run the nat position command to configure a flexible flow log format.

Example

# Configure a flexible log template with the session log format as 1 2014 Oct 8 14:04:17 10.1.1.31 cnelog - NAT444:SessionbasedW [17 172.16.178.228 - 192.168.17.234 1024 4097 -].
<HUAWEI> system-view
[~HUAWEI] nat syslog flexible template session
[*HUAWEI-nat-syslog-template-session] nat position 0 fixed-string  "<134> 1 "
[*HUAWEI-nat-syslog-template-session] nat position 1 timestamp-year " "
[*HUAWEI-nat-syslog-template-session] nat position 2 timestamp-month-en " "
[*HUAWEI-nat-syslog-template-session] nat position 3 timestamp-date " "
[*HUAWEI-nat-syslog-template-session] nat position 4 timestamp-hour ":"
[*HUAWEI-nat-syslog-template-session] nat position 5 timestamp-minute  ":"
[*HUAWEI-nat-syslog-template-session] nat position 6 timestamp-second " "
[*HUAWEI-nat-syslog-template-session] nat position 7 host-ip " "
[*HUAWEI-nat-syslog-template-session] nat position 8 app-name " - "
[*HUAWEI-nat-syslog-template-session] nat position 9 scene ":"
[*HUAWEI-nat-syslog-template-session] nat position 10 fixed-string  "SessionbasedA [" create
[*HUAWEI-nat-syslog-template-session] nat position 10 fixed-string  "SessionbasedW [" free
[*HUAWEI-nat-syslog-template-session] nat position 11 protocol " "
[*HUAWEI-nat-syslog-template-session] nat position 12 source-ip " - "
[*HUAWEI-nat-syslog-template-session] nat position 13 destination-ip " "
[*HUAWEI-nat-syslog-template-session] nat position 14 source-port " "
[*HUAWEI-nat-syslog-template-session] nat position 15 destination-port " -]"
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >