openconfig-nat

openconfig-version: 0.1.0

Description

This module defines configuration and operational state data for Network Address Translation (NAT) functionality.

NAT enables translation of IP addresses and/or ports between different network domains.

The model supports: - Source NAT (SNAT) for outbound traffic translation - Destination NAT (DNAT) for inbound traffic translation - Static and dynamic address/port mappings - Policy-based NAT using ACLs - Active translation table showing current NAT entries - Multiple address families (IPv4/NAT44, IPv6/NAT66).

Imports

ietf-inet-types
ietf-yang-types
openconfig-interfaces
openconfig-extensions
openconfig-acl

Defined types

protocol-type

description:
Protocol types supported for NAT translation.

type: enumeration

  • TCP
    Transmission Control Protocol
  • UDP
    User Datagram Protocol
  • ICMP
    Internet Control Message Protocol
  • ALL
    All protocols

nat-action

description:
Action to take for matching traffic.

type: enumeration

  • TRANSLATE
    Apply NAT translation.
  • BYPASS
    Bypass NAT translation.

log-level

description:
Logging level for NAT operations.

type: enumeration

  • NONE
    No logging
  • ERROR
    Log only errors
  • INFO
    Log informational messages
  • DEBUG
    Log debug messages

interface-type

description:
NAT interface role: INSIDE or OUTSIDE.

type: enumeration

  • INSIDE
    Source interface for NAT address translation.
  • OUTSIDE
    Destination interface for translated addresses.

Identities

base: NAT_TYPE

description:
Base identity for NAT types.

SOURCE

description:
Source NAT - translates source addresses/ports of outbound traffic.

base identity: NAT_TYPE

DESTINATION

description:
Destination NAT - translates destination addresses/ports of inbound traffic.

base identity: NAT_TYPE

base: ADDRESS_FAMILY

description:
Base identity for NAT address families.

IPV4

description:
IPv4 address family for NAT44 translations.

base identity: ADDRESS_FAMILY

IPV6

description:
IPv6 address family for NAT66 translations.

base identity: ADDRESS_FAMILY

Data elements

/
nat

description:
Top-level container for NAT.

nodetype: container (rw)

/nat/
config

description:
Global NAT configuration parameters.

nodetype: container (rw)

/nat/config/
translation-timeout

description:
Default time a NAT translation entry remains active without traffic for all NAT instances. Applies to all traffic unless specific protocol timeouts are configured.

nodetype: leaf (rw)

type: uint32

units: seconds

/nat/config/
max-translations

description:
Maximum number of concurrent translations globally across all NAT instances. When this threshold is reached, new translation requests are dropped until the total number of active translations falls below this limit.

nodetype: leaf (rw)

type: uint64

/nat/config/
log-level

description:
Global NAT logging level.

nodetype: leaf (rw)

type: log-level

/nat/
state

description:
Global NAT operational state data.

nodetype: container (ro)

/nat/state/
translation-timeout

description:
Default time a NAT translation entry remains active without traffic for all NAT instances. Applies to all traffic unless specific protocol timeouts are configured.

nodetype: leaf (ro)

type: uint32

units: seconds

/nat/state/
max-translations

description:
Maximum number of concurrent translations globally across all NAT instances. When this threshold is reached, new translation requests are dropped until the total number of active translations falls below this limit.

nodetype: leaf (ro)

type: uint64

/nat/state/
log-level

description:
Global NAT logging level.

nodetype: leaf (ro)

type: log-level

/nat/state/
memory-usage

description:
Memory used by the NAT subsystem.

nodetype: leaf (ro)

type: uint32

units: kilobytes

/nat/state/
counters

description:
Counters for global NAT operations.

nodetype: container (ro)

/nat/state/counters/
total-instances

description:
Total number of configured NAT instances.

nodetype: leaf (ro)

type: yang:counter32

/nat/state/counters/
active-instances

description:
Number of currently active NAT instances.

nodetype: leaf (ro)

type: yang:counter32

/nat/state/counters/
total-active-translations

description:
Total number of active translations across all instances.

nodetype: leaf (ro)

type: yang:counter64

/nat/state/counters/
total-translation-failures

description:
Total number of translation failures across all instances.

nodetype: leaf (ro)

type: yang:counter64

/nat/
instances

description:
NAT instance configuration and state.

nodetype: container (rw)

/nat/instances/
instance

description:
List of NAT instances.

nodetype: list (rw)

list keys: [name]

/nat/instances/instance/
name

description:
Reference to NAT instance name.

nodetype: leaf (list key) (rw)

type: leafref

  • path reference: ../config/name

/nat/instances/instance/
config

description:
Configuration parameters for the NAT instance.

nodetype: container (rw)

/nat/instances/instance/config/
name

description:
Unique name for the NAT instance.

nodetype: leaf (rw)

type: string

/nat/instances/instance/config/
type

description:
Type of NAT translation to be performed.

nodetype: leaf (rw)

type: identityref

  • base: NAT_TYPE

/nat/instances/instance/config/
address-family

description:
Address family for NAT translations - IPv4 for NAT44, IPv6 for NAT66.

nodetype: leaf (rw)

type: identityref

  • base: ADDRESS_FAMILY

/nat/instances/instance/config/
description

description:
Textual description of the NAT instance.

nodetype: leaf (rw)

type: string

/nat/instances/instance/
state

description:
Operational state data for the NAT instance.

nodetype: container (ro)

/nat/instances/instance/state/
name

description:
Unique name for the NAT instance.

nodetype: leaf (ro)

type: string

/nat/instances/instance/state/
type

description:
Type of NAT translation to be performed.

nodetype: leaf (ro)

type: identityref

  • base: NAT_TYPE

/nat/instances/instance/state/
address-family

description:
Address family for NAT translations - IPv4 for NAT44, IPv6 for NAT66.

nodetype: leaf (ro)

type: identityref

  • base: ADDRESS_FAMILY

/nat/instances/instance/state/
description

description:
Textual description of the NAT instance.

nodetype: leaf (ro)

type: string

/nat/instances/instance/state/
counters

description:
Counters for NAT instance operations.

nodetype: container (ro)

/nat/instances/instance/state/counters/
active-mappings

description:
Number of currently active NAT mappings.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/state/counters/
total-mappings

description:
Total number of NAT mappings created since instance startup.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/state/counters/
mapping-failures

description:
Number of mapping creation failures.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/
interfaces

description:
Interface configuration and state for NAT.

nodetype: container (rw)

/nat/instances/instance/interfaces/
interface

description:
List of interfaces participating in NAT.

nodetype: list (rw)

list keys: [interface]

/nat/instances/instance/interfaces/interface/
interface

description:
Reference to interface list key.

nodetype: leaf (list key) (rw)

type: leafref

  • path reference: ../config/interface

/nat/instances/instance/interfaces/interface/
config

description:
Configuration parameters for the NAT interface.

nodetype: container (rw)

/nat/instances/instance/interfaces/interface/config/
interface

description:
Reference to the interface.

nodetype: leaf (rw)

type: oc-if:base-interface-ref

/nat/instances/instance/interfaces/interface/config/
type

description:
Type of NAT interface - inside or outside.

nodetype: leaf (rw)

type: interface-type

/nat/instances/instance/interfaces/interface/
state

description:
Operational state data for the NAT interface.

nodetype: container (ro)

/nat/instances/instance/interfaces/interface/state/
interface

description:
Reference to the interface.

nodetype: leaf (ro)

type: oc-if:base-interface-ref

/nat/instances/instance/interfaces/interface/state/
type

description:
Type of NAT interface - inside or outside.

nodetype: leaf (ro)

type: interface-type

/nat/instances/instance/interfaces/interface/state/
counters

description:
Counters for NAT interface operations.

nodetype: container (ro)

/nat/instances/instance/interfaces/interface/state/counters/
packets-translated

description:
Number of packets that have been translated.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/interfaces/interface/state/counters/
bytes-translated

description:
Number of bytes that have been translated.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/interfaces/interface/state/counters/
translation-errors

description:
Number of translation errors encountered.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/
dynamic

description:
Dynamic NAT configuration and state.

nodetype: container (rw)

/nat/instances/instance/dynamic/
pool

description:
List of dynamic NAT pools.

nodetype: list (rw)

list keys: [name]

/nat/instances/instance/dynamic/pool/
name

description:
Reference to dynamic NAT pool name.

nodetype: leaf (list key) (rw)

type: leafref

  • path reference: ../config/name

/nat/instances/instance/dynamic/pool/
config

description:
Configuration parameters for the dynamic NAT pool.

nodetype: container (rw)

/nat/instances/instance/dynamic/pool/config/
name

description:
Unique name for the dynamic NAT pool.

nodetype: leaf (rw)

type: string

/nat/instances/instance/dynamic/pool/config/
start-address

description:
Starting IP address of the address range. Must match the address family configured for the NAT instance.

nodetype: leaf (rw)

type: inet:ip-address

/nat/instances/instance/dynamic/pool/config/
end-address

description:
Ending IP address of the address range. Must match the address family configured for the NAT instance.

nodetype: leaf (rw)

type: inet:ip-address

/nat/instances/instance/dynamic/pool/config/
prefix-length

description:
Prefix length for the address range. For IPv4, valid range is 1-32. For IPv6, valid range is 1-128.

nodetype: leaf (rw)

type: uint8

  • range: 1..128

/nat/instances/instance/dynamic/pool/config/
port-range-start

description:
Starting port number for NAPT translations.

nodetype: leaf (rw)

type: inet:port-number

/nat/instances/instance/dynamic/pool/config/
port-range-end

description:
Ending port number for NAPT translations.

nodetype: leaf (rw)

type: inet:port-number

/nat/instances/instance/dynamic/pool/config/
port-block-size

description:
Number of ports allocated per mapping.

nodetype: leaf (rw)

type: uint16

/nat/instances/instance/dynamic/pool/config/
acl-set

description:
Reference to ACL set that defines traffic eligible for this dynamic NAT pool.

nodetype: leaf (rw)

type: leafref

  • path reference: /acl/acl-sets/acl-set/config/name

/nat/instances/instance/dynamic/pool/config/
max-translations

description:
Maximum number of concurrent translations for this dynamic NAT pool. When this threshold is reached, new translation requests are dropped until the number of active translations falls below this limit.

nodetype: leaf (rw)

type: uint64

/nat/instances/instance/dynamic/pool/config/
address-only

description:
Enable address-only translation without port translation.

nodetype: leaf (rw)

type: boolean

/nat/instances/instance/dynamic/pool/config/
timeout

description:
Default time a NAT translation entry remains active without traffic. Applies to all traffic unless specific protocol timeouts (TCP, UDP, ICMP) are configured.

nodetype: leaf (rw)

type: uint32

units: seconds

/nat/instances/instance/dynamic/pool/config/
tcp-timeout

description:
Time a TCP NAT translation entry remains active without traffic.

nodetype: leaf (rw)

type: uint32

units: seconds

/nat/instances/instance/dynamic/pool/config/
udp-timeout

description:
Time a UDP NAT translation entry remains active without traffic.

nodetype: leaf (rw)

type: uint32

units: seconds

/nat/instances/instance/dynamic/pool/config/
icmp-timeout

description:
Time an ICMP NAT translation entry remains active without traffic.

nodetype: leaf (rw)

type: uint32

units: seconds

/nat/instances/instance/dynamic/pool/config/
overload

description:
Enable port overloading (PAT) allowing multiple internal addresses to share the same external address with different ports.

nodetype: leaf (rw)

type: boolean

/nat/instances/instance/dynamic/pool/config/
log-translations

description:
Enable logging of NAT translations.

nodetype: leaf (rw)

type: boolean

/nat/instances/instance/dynamic/pool/config/
max-translations-per-address

description:
Maximum number of concurrent translations per external address.

nodetype: leaf (rw)

type: uint32

/nat/instances/instance/dynamic/pool/
state

description:
Operational state data for the dynamic NAT pool.

nodetype: container (ro)

/nat/instances/instance/dynamic/pool/state/
name

description:
Unique name for the dynamic NAT pool.

nodetype: leaf (ro)

type: string

/nat/instances/instance/dynamic/pool/state/
start-address

description:
Starting IP address of the address range. Must match the address family configured for the NAT instance.

nodetype: leaf (ro)

type: inet:ip-address

/nat/instances/instance/dynamic/pool/state/
end-address

description:
Ending IP address of the address range. Must match the address family configured for the NAT instance.

nodetype: leaf (ro)

type: inet:ip-address

/nat/instances/instance/dynamic/pool/state/
prefix-length

description:
Prefix length for the address range. For IPv4, valid range is 1-32. For IPv6, valid range is 1-128.

nodetype: leaf (ro)

type: uint8

  • range: 1..128

/nat/instances/instance/dynamic/pool/state/
port-range-start

description:
Starting port number for NAPT translations.

nodetype: leaf (ro)

type: inet:port-number

/nat/instances/instance/dynamic/pool/state/
port-range-end

description:
Ending port number for NAPT translations.

nodetype: leaf (ro)

type: inet:port-number

/nat/instances/instance/dynamic/pool/state/
port-block-size

description:
Number of ports allocated per mapping.

nodetype: leaf (ro)

type: uint16

/nat/instances/instance/dynamic/pool/state/
acl-set

description:
Reference to ACL set that defines traffic eligible for this dynamic NAT pool.

nodetype: leaf (ro)

type: leafref

  • path reference: /acl/acl-sets/acl-set/config/name

/nat/instances/instance/dynamic/pool/state/
max-translations

description:
Maximum number of concurrent translations for this dynamic NAT pool. When this threshold is reached, new translation requests are dropped until the number of active translations falls below this limit.

nodetype: leaf (ro)

type: uint64

/nat/instances/instance/dynamic/pool/state/
address-only

description:
Enable address-only translation without port translation.

nodetype: leaf (ro)

type: boolean

/nat/instances/instance/dynamic/pool/state/
timeout

description:
Default time a NAT translation entry remains active without traffic. Applies to all traffic unless specific protocol timeouts (TCP, UDP, ICMP) are configured.

nodetype: leaf (ro)

type: uint32

units: seconds

/nat/instances/instance/dynamic/pool/state/
tcp-timeout

description:
Time a TCP NAT translation entry remains active without traffic.

nodetype: leaf (ro)

type: uint32

units: seconds

/nat/instances/instance/dynamic/pool/state/
udp-timeout

description:
Time a UDP NAT translation entry remains active without traffic.

nodetype: leaf (ro)

type: uint32

units: seconds

/nat/instances/instance/dynamic/pool/state/
icmp-timeout

description:
Time an ICMP NAT translation entry remains active without traffic.

nodetype: leaf (ro)

type: uint32

units: seconds

/nat/instances/instance/dynamic/pool/state/
overload

description:
Enable port overloading (PAT) allowing multiple internal addresses to share the same external address with different ports.

nodetype: leaf (ro)

type: boolean

/nat/instances/instance/dynamic/pool/state/
log-translations

description:
Enable logging of NAT translations.

nodetype: leaf (ro)

type: boolean

/nat/instances/instance/dynamic/pool/state/
max-translations-per-address

description:
Maximum number of concurrent translations per external address.

nodetype: leaf (ro)

type: uint32

/nat/instances/instance/dynamic/pool/state/
counters

description:
Counters for dynamic NAT pool operations.

nodetype: container (ro)

/nat/instances/instance/dynamic/pool/state/counters/
allocated-addresses

description:
Number of addresses currently allocated from this dynamic NAT pool.

nodetype: leaf (ro)

type: yang:counter32

/nat/instances/instance/dynamic/pool/state/counters/
available-addresses

description:
Number of addresses available in this dynamic NAT pool.

nodetype: leaf (ro)

type: yang:counter32

/nat/instances/instance/dynamic/pool/state/counters/
active-translations

description:
Number of currently active translations using this dynamic NAT pool.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/dynamic/pool/state/counters/
acl-hit-count

description:
Number of packets matching the ACL set.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/
static

description:
Static NAT configuration and state.

nodetype: container (rw)

/nat/instances/instance/static/
mapping

description:
List of static NAT mappings.

nodetype: list (rw)

list keys: [name]

/nat/instances/instance/static/mapping/
name

description:
Reference to static NAT mapping name.

nodetype: leaf (list key) (rw)

type: leafref

  • path reference: ../config/name

/nat/instances/instance/static/mapping/
config

description:
Configuration parameters for the static NAT mapping.

nodetype: container (rw)

/nat/instances/instance/static/mapping/config/
name

description:
Unique name for the static NAT mapping.

nodetype: leaf (rw)

type: string

/nat/instances/instance/static/mapping/config/
type

description:
Type of static NAT: source or destination.

nodetype: leaf (rw)

type: identityref

  • base: NAT_TYPE

/nat/instances/instance/static/mapping/config/
internal-address

description:
Internal (source) IP address. Must match the address family configured for the NAT instance.

nodetype: leaf (rw)

type: inet:ip-address

/nat/instances/instance/static/mapping/config/
external-address

description:
External (destination) IP address. Must match the address family configured for the NAT instance.

nodetype: leaf (rw)

type: inet:ip-address

/nat/instances/instance/static/mapping/config/
internal-port

description:
Internal port number for static NAPT mappings. When specified, this option enables port forwarding, where both the IP address and the port are translated. If omitted, only the IP address is translated.

nodetype: leaf (rw)

type: inet:port-number

/nat/instances/instance/static/mapping/config/
external-port

description:
External port number for static NAPT mappings. When specified, this option enables port forwarding, where both the IP address and the port are translated. If omitted, only the IP address is translated.

nodetype: leaf (rw)

type: inet:port-number

/nat/instances/instance/static/mapping/config/
protocol

description:
Protocol for the static NAT mapping.

nodetype: leaf (rw)

type: protocol-type

/nat/instances/instance/static/mapping/config/
acl-set

description:
Reference to ACL set for this static NAT mapping.

nodetype: leaf (rw)

type: leafref

  • path reference: /acl/acl-sets/acl-set/config/name

/nat/instances/instance/static/mapping/config/
max-translations

description:
Maximum number of concurrent translations for this static NAT mapping. When this threshold is reached, new translation requests using this mapping are dropped until the number of active translations falls below this limit.

nodetype: leaf (rw)

type: uint64

/nat/instances/instance/static/mapping/
state

description:
Operational state data for the static NAT mapping.

nodetype: container (ro)

/nat/instances/instance/static/mapping/state/
name

description:
Unique name for the static NAT mapping.

nodetype: leaf (ro)

type: string

/nat/instances/instance/static/mapping/state/
type

description:
Type of static NAT: source or destination.

nodetype: leaf (ro)

type: identityref

  • base: NAT_TYPE

/nat/instances/instance/static/mapping/state/
internal-address

description:
Internal (source) IP address. Must match the address family configured for the NAT instance.

nodetype: leaf (ro)

type: inet:ip-address

/nat/instances/instance/static/mapping/state/
external-address

description:
External (destination) IP address. Must match the address family configured for the NAT instance.

nodetype: leaf (ro)

type: inet:ip-address

/nat/instances/instance/static/mapping/state/
internal-port

description:
Internal port number for static NAPT mappings. When specified, this option enables port forwarding, where both the IP address and the port are translated. If omitted, only the IP address is translated.

nodetype: leaf (ro)

type: inet:port-number

/nat/instances/instance/static/mapping/state/
external-port

description:
External port number for static NAPT mappings. When specified, this option enables port forwarding, where both the IP address and the port are translated. If omitted, only the IP address is translated.

nodetype: leaf (ro)

type: inet:port-number

/nat/instances/instance/static/mapping/state/
protocol

description:
Protocol for the static NAT mapping.

nodetype: leaf (ro)

type: protocol-type

/nat/instances/instance/static/mapping/state/
acl-set

description:
Reference to ACL set for this static NAT mapping.

nodetype: leaf (ro)

type: leafref

  • path reference: /acl/acl-sets/acl-set/config/name

/nat/instances/instance/static/mapping/state/
max-translations

description:
Maximum number of concurrent translations for this static NAT mapping. When this threshold is reached, new translation requests using this mapping are dropped until the number of active translations falls below this limit.

nodetype: leaf (ro)

type: uint64

/nat/instances/instance/static/mapping/state/
creation-time

description:
Timestamp when the static NAT mapping was created.

nodetype: leaf (ro)

type: yang:date-and-time

/nat/instances/instance/static/mapping/state/
last-used

description:
Timestamp when the static NAT mapping was last used.

nodetype: leaf (ro)

type: yang:date-and-time

/nat/instances/instance/static/mapping/state/
counters

description:
Counters for static NAT mapping operations.

nodetype: container (ro)

/nat/instances/instance/static/mapping/state/counters/
active-translations

description:
Number of currently active translations for this static NAT mapping.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/static/mapping/state/counters/
packet-count

description:
Number of packets translated using this static NAT mapping.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/static/mapping/state/counters/
byte-count

description:
Number of bytes translated using this static NAT mapping.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/static/mapping/state/counters/
acl-hit-count

description:
Number of packets matching the ACL set.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/
translations

description:
Active NAT translation entries showing current address/port mappings.

nodetype: container (ro)

/nat/instances/instance/translations/
translation

description:
List of active NAT translation entries.

nodetype: list (ro)

list keys: [translation-id]

/nat/instances/instance/translations/translation/
translation-id

description:
Reference to translation entry identifier.

nodetype: leaf (list key) (ro)

type: leafref

  • path reference: ../state/translation-id

/nat/instances/instance/translations/translation/
state

description:
Operational state data for the NAT translation entry.

nodetype: container (ro)

/nat/instances/instance/translations/translation/state/
translation-id

description:
Unique identifier for the translation entry.

nodetype: leaf (ro)

type: uint64

/nat/instances/instance/translations/translation/state/
internal-address

description:
Internal (private) IP address being translated.

nodetype: leaf (ro)

type: inet:ip-address

/nat/instances/instance/translations/translation/state/
internal-port

description:
Internal port number being translated.

nodetype: leaf (ro)

type: inet:port-number

/nat/instances/instance/translations/translation/state/
external-address

description:
External (public) IP address used for translation.

nodetype: leaf (ro)

type: inet:ip-address

/nat/instances/instance/translations/translation/state/
external-port

description:
External port number used for translation.

nodetype: leaf (ro)

type: inet:port-number

/nat/instances/instance/translations/translation/state/
protocol

description:
Protocol of the translation entry.

nodetype: leaf (ro)

type: protocol-type

/nat/instances/instance/translations/translation/state/
creation-time

description:
Timestamp when the translation entry was created.

nodetype: leaf (ro)

type: yang:date-and-time

/nat/instances/instance/translations/translation/state/
last-activity

description:
Timestamp of the last packet activity for this translation.

nodetype: leaf (ro)

type: yang:date-and-time

/nat/instances/instance/translations/translation/state/
timeout

description:
Remaining time before this translation entry expires due to inactivity.

nodetype: leaf (ro)

type: uint32

units: seconds

/nat/instances/instance/translations/translation/state/
source-pool

description:
Name of the dynamic NAT pool that allocated this translation, if applicable.

nodetype: leaf (ro)

type: string

/nat/instances/instance/translations/translation/state/
source-mapping

description:
Name of the static NAT mapping that created this translation, if applicable.

nodetype: leaf (ro)

type: string

/nat/instances/instance/translations/translation/state/
counters

description:
Counters for NAT translation entry operations.

nodetype: container (ro)

/nat/instances/instance/translations/translation/state/counters/
packet-count-inbound

description:
Number of inbound packets (external to internal) for this translation.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/translations/translation/state/counters/
packet-count-outbound

description:
Number of outbound packets (internal to external) for this translation.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/translations/translation/state/counters/
byte-count-inbound

description:
Number of inbound bytes (external to internal) for this translation.

nodetype: leaf (ro)

type: yang:counter64

/nat/instances/instance/translations/translation/state/counters/
byte-count-outbound

description:
Number of outbound bytes (internal to external) for this translation.

nodetype: leaf (ro)

type: yang:counter64