firewall_nat_rule - Create, modify or delete a firewall NAT rule¶
Synopsis¶
Firewall NAT rules can be added or removed from either a top level policy or a sub-policy. Source, destination and service elements that have already been created can be used and referenced by their type and name. To modify NAT rules, SMC 6.4.3 or higher is required.
Options¶
| parameter | required | default | choices | comments | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| policy |
yes |
The policy on which to operate on. Any rule modifications are done in the context of this policy. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rules |
no |
Source elements to add to the rule. Elements need to specify the type of element to add. If source is not provided, the rule source cell will be set to none and the rule will effectively be disabled.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state |
no | present |
|
Create or delete a NAT rule |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sub_policy |
no |
The sub-policy on which to operate. This parameter is mutually exclusive with the policy parameter. You can operate on rules within a firewall policy or firewall sub-policy. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Examples¶
- name: Firewall NAT rule examples
firewall_nat_rule:
policy: TestPolicy
rules:
- comment: added a comment
destinations:
any: true
dynamic_src_nat:
automatic_proxy: true
translated_value:
ip_descriptor: 1.1.1.1
max_port: 60000
min_port: 1024
is_disabled: false
name: dynamic source nat with ports and IP redirect
services:
any: true
sources:
any: true
- comment: null
destinations:
any: true
dynamic_src_nat:
automatic_proxy: true
translated_value:
max_port: 65535
min_port: 1024
name: host-4.4.4.4
type: host
is_disabled: false
name: dynamic source nat with element
services:
any: true
sources:
host:
- host-3.3.3.3
- comment: testcomment
destinations:
host:
- host-3.3.3.3
is_disabled: false
name: static_dest_nat with IP redirect
services:
any: true
sources:
any: true
static_dst_nat:
automatic_proxy: true
original_value:
max_port: 90
min_port: 90
translated_value:
ip_descriptor: 1.1.1.1
max_port: 9999
min_port: 9999
used_on: ANY
- comment: null
destinations:
any: true
is_disabled: false
name: static_src_nat with IP address
services:
any: true
sources:
host:
- host-4.4.4.4
static_src_nat:
automatic_proxy: true
translated_value:
ip_descriptor: 1.1.1.1
used_on: ANY
- comment: null
destinations:
any: true
dynamic_src_nat:
automatic_proxy: true
translated_value:
max_port: 65535
min_port: 1024
name: host-4.4.4.4
type: host
is_disabled: false
name: dynamic_source_nat with element
services:
any: true
sources:
host:
- host-3.3.3.3
used_on: ANY
Return Values¶
Common return values are documented Return Values, the following are the fields unique to this module:
| name | description | returned | type | sample |
|---|---|---|---|---|
| state |
The current state of the element
|
dict | ||
| changed |
Whether or not the change succeeded
|
always | bool |
Status¶
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.