.. _vyos.rest.vyos_nat_module: ****************** vyos.rest.vyos_nat ****************** **Manage NAT configuration on VyOS devices using REST API** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Manages NAT configuration on VyOS devices via the REST API. - Supports source, destination, static, CGNAT, NAT64, and NAT66. - Uses REST API (``connection=httpapi``) instead of CLI. - Targets VyOS 1.5+. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
dictionary
NAT configuration.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • gathered
The desired state of the NAT configuration.

Examples -------- .. code-block:: yaml - name: Merge source NAT rule vyos.rest.vyos_nat: config: nat: source: rule: - id: 100 outbound_interface: name: eth0 translation: address: masquerade state: merged - name: Delete all NAT vyos.rest.vyos_nat: state: deleted - name: Gather NAT configuration vyos.rest.vyos_nat: state: gathered Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
dictionary
when changed
NAT configuration after this module ran.

before
dictionary
always
NAT configuration before this module ran.

commands
list
always
List of API commands sent to the device.

gathered
dictionary
when state is gathered
Current NAT configuration as structured data.

saved
boolean
when changed
Whether the config was saved after changes.



Status ------ Authors ~~~~~~~ - Evgeny Molotkov (@omnom62)