Setting an Aging Time for NAT Sessions

To accelerate aging of expired NAT sessions of a protocol, set an aging time. After the aging time elapses, NAT sessions age, and system resources are released.

Context

Perform the following steps on the router:

Procedure

  1. Run system-view

    The system view is displayed.

  2. (Optional) Run nat session long-link [ inbound | outbound ] tcp { source-ip ip-address { ip-mask | mask-length } [ source-port port-number ] [ vpn-instance vpn-instance-name ] | { destination-ip ip-address { ip-mask | mask-length } [ destination-port port-number ] | destination-port port-number } [ vpn-instance vpn-instance-name ] } *

    A policy for establishing a persistent NAT TCP connection is configured.

    After this policy is configured, the aging time of the TCP connection of the specified session is changed to 200 hours by default. To reset the aging time of the persistent TCP connection, run the nat session aging-time command.

  3. Run nat session aging-time { tcp | udp | icmp | fin-rst | syn | fragment | dns | ftp | http | rtsp | sip | pptp | tcplong-link | ip } aging-time

    An aging time is set for the sessions of a specified type.

    The changed aging time takes effect on new NAT session entries, not on existing NAT session entries.

  4. (Optional) Run nat instance instance-name [ id id ]

    The NAT instance view is displayed.

  5. (Optional) Run nat instance instance-name [ id id ]

    The NAT instance view is displayed.

  6. Run nat session aging-time { ip | fin-rst | fragment | ftp | icmp | pptp | rtsp | sip | syn | tcp | udp | dns | http } aging-time

    An aging time is set for the NAT sessions of a specified type.

    If an aging time is set in a NAT instance, the aging time takes effect on sessions established in the instance. If no aging time is set in a NAT instance, the global aging time takes effect on sessions established in the instance.

  7. Run commit

    The configuration is committed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >