REFERENCE

v6.11.0

IPv6 Firewall — NAT

IPv6 NAT rules: src-nat, dst-nat, masquerade, netmap (`/ipv6 firewall nat`).

Tools

create_ipv6_nat_rule

Create IPv6 Firewall NAT Rule · Risk: write

Creates an IPv6 NAT rule (/ipv6 firewall nat add) — the address/port translation table for IPv6 traffic, used to redirect or masquerade connections. chain: 'srcnat' (applied after routing, for outbound traffic) or 'dstnat' (applied before routing, for inbound traffic). action: masquerade/src-nat/dst-nat/netmap/redirect/accept/drop/return/jump/passthrough/log. to_address: rewrite target for src-nat/dst-nat/netmap. place_before: rule number or ID (*N) to insert before a specific position. For IPv4 NAT use create_nat_rule; for IPv6 packet filtering use create_ipv6_filter_rule; for IPv6 traffic marking use create_ipv6_mangle_rule; for IPv6 pre-connection-tracking drops use create_ipv6_raw_rule. Returns the created rule's full detail including its .id.

ParameterRequiredDefinition
chainYes{"type":"string","enum":["srcnat","dstnat"]}
actionYes{"type":"string","enum":["accept","drop","masquerade","src-nat","dst-nat","netmap","redirect","return","jump","passthrough","log","add-src-to-address-list","add-dst-to-address-list"]}
src_addressNo{"type":"string"}
dst_addressNo{"type":"string"}
src_portNo{"type":"string"}
dst_portNo{"type":"string"}
protocolNo{"type":"string"}
in_interfaceNo{"type":"string"}
out_interfaceNo{"type":"string"}
to_addressNo{"type":"string"}
to_portsNo{"type":"string"}
src_address_listNo{"type":"string"}
dst_address_listNo{"type":"string"}
in_interface_listNoIngress interface list, e.g. "WAN" or "!LAN" {"type":"string"}
out_interface_listNoEgress interface list {"type":"string"}
src_address_typeNo"unicast" / "local" / "multicast" / etc. {"type":"string"}
dst_address_typeNo"unicast" / "local" / "multicast" / etc. {"type":"string"}
src_mac_addressNoSource MAC, negate "!AA:BB:.." {"type":"string"}
portNoMatch src OR dst port (any protocol with ports) {"type":"string"}
connection_markNoMatch a connection mark set in mangle {"type":"string"}
connection_stateNoe.g. "new" / "established,related" / "!invalid" {"type":"string"}
connection_typeNoHelper-detected conn type, e.g. "ftp" / "sip" {"type":"string"}
connection_bytesNoTotal conn bytes range, e.g. "1000000-" {"type":"string"}
connection_limitNoPer-address conn limit, e.g. "100,64" {"type":"string"}
connection_rateNoConn rate range, e.g. "0-100k" {"type":"string"}
packet_markNoMatch a packet mark set in mangle {"type":"string"}
routing_markNoMatch a routing mark set in mangle {"type":"string"}
icmp_optionsNoICMPv6 type:code, e.g. "128:0" {"type":"string"}
ipsec_policyNoe.g. "in,ipsec" / "out,none" {"type":"string"}
contentNoMatch a literal string in the packet payload {"type":"string"}
dscpNoDSCP value 0-63 {"type":"string"}
priorityNoMatch packet priority (queue/VLAN) {"type":"string"}
tcp_flagsNoe.g. "syn,!ack" {"type":"string"}
tcp_mssNoTCP MSS range, e.g. "1440-1500" {"type":"string"}
packet_sizeNoPacket size range, e.g. "1500" or "0-500" {"type":"string"}
hop_limitNoIPv6 hop-limit matcher, e.g. "equal:64" {"type":"string"}
headersNoMatch IPv6 extension headers {"type":"string"}
limitNoRate limit, e.g. "10,5:packet" {"type":"string"}
dst_limitNoPer-dst rate limit, e.g. "10,5,dst-address/1m" {"type":"string"}
nthNoEvery Nth packet, e.g. "2,0" {"type":"string"}
randomNoMatch packet randomly with given probability % (1-99) {"type":"string"}
per_connection_classifierNoPCC classifier, e.g. "both-addresses:2/0" {"type":"string"}
timeNoTime/day matcher, e.g. "8h-16h,mon,tue,wed,thu,fri" {"type":"string"}
jump_targetNoTarget chain name when action=jump {"type":"string"}
address_listNoList name for add-src-to-address-list / add-dst-to-address-list {"type":"string"}
address_list_timeoutNoTimeout for the address-list entry, e.g. "1h" or "none" {"type":"string"}
commentNo{"type":"string"}
disabledYes{"default":false,"type":"boolean"}
logYes{"default":false,"type":"boolean"}
log_prefixNo{"type":"string"}
place_beforeNoRule number or ID (*N) to insert before {"type":"string"}

list_ipv6_nat_rules

List IPv6 Firewall NAT Rules · Risk: read

Lists IPv6 NAT rules (/ipv6 firewall nat print) with optional filters — use to inspect all address/port translation rules in the srcnat or dstnat chain. Filters: chain_filter, action_filter, src_address_filter, dst_address_filter, disabled_only, invalid_only, dynamic_only. For a single rule's full detail use get_ipv6_nat_rule. For IPv4 NAT use list_nat_rules; for IPv6 filter rules use list_ipv6_filter_rules; for IPv6 mangle use list_ipv6_mangle_rules; for IPv6 raw use list_ipv6_raw_rules. Returns matching rule list with .id values needed by get_ipv6_nat_rule, update_ipv6_nat_rule, remove_ipv6_nat_rule, move_ipv6_nat_rule, enable_ipv6_nat_rule, and disable_ipv6_nat_rule.

ParameterRequiredDefinition
chain_filterNo{"type":"string"}
action_filterNo{"type":"string"}
src_address_filterNo{"type":"string"}
dst_address_filterNo{"type":"string"}
disabled_onlyYes{"default":false,"type":"boolean"}
invalid_onlyYes{"default":false,"type":"boolean"}
dynamic_onlyYes{"default":false,"type":"boolean"}

get_ipv6_nat_rule

Get IPv6 Firewall NAT Rule · Risk: read

Fetches full detail of a single IPv6 NAT rule (/ipv6 firewall nat print detail where .id=...) — use when you need all fields of one rule rather than scanning the full list. rule_id takes the .id value from list_ipv6_nat_rules (e.g. "*1" or "0"). For IPv4 use get_nat_rule; for the IPv6 filter table use get_ipv6_filter_rule. Returns all fields for the matched rule, or a not-found message if the ID does not exist.

ParameterRequiredDefinition
rule_idYesRule ID from list output e.g. "*1" or "0" {"type":"string"}

update_ipv6_nat_rule

Update IPv6 Firewall NAT Rule · Risk: write-idempotent

Modifies fields of an existing IPv6 NAT rule (/ipv6 firewall nat set) — use to change action, addresses, ports, chain, or flags without removing and recreating the rule. rule_id takes the .id from list_ipv6_nat_rules. Pass "" for any optional field to clear it (e.g. to_address=""). For IPv4 use update_nat_rule; for the IPv6 filter table use update_ipv6_filter_rule. To only toggle active state use enable_ipv6_nat_rule or disable_ipv6_nat_rule. Returns the updated rule's full detail.

ParameterRequiredDefinition
rule_idYes{"type":"string"}
chainNo{"type":"string"}
actionNo{"type":"string"}
src_addressNo{"type":"string"}
dst_addressNo{"type":"string"}
src_portNo{"type":"string"}
dst_portNo{"type":"string"}
protocolNo{"type":"string"}
in_interfaceNo{"type":"string"}
out_interfaceNo{"type":"string"}
to_addressNo{"type":"string"}
to_portsNo{"type":"string"}
src_address_listNo{"type":"string"}
dst_address_listNo{"type":"string"}
in_interface_listNo{"type":"string"}
out_interface_listNo{"type":"string"}
src_address_typeNo{"type":"string"}
dst_address_typeNo{"type":"string"}
src_mac_addressNo{"type":"string"}
portNo{"type":"string"}
connection_markNo{"type":"string"}
connection_stateNo{"type":"string"}
connection_typeNo{"type":"string"}
connection_bytesNo{"type":"string"}
connection_limitNo{"type":"string"}
connection_rateNo{"type":"string"}
packet_markNo{"type":"string"}
routing_markNo{"type":"string"}
icmp_optionsNo{"type":"string"}
ipsec_policyNo{"type":"string"}
contentNo{"type":"string"}
dscpNo{"type":"string"}
priorityNo{"type":"string"}
tcp_flagsNo{"type":"string"}
tcp_mssNo{"type":"string"}
packet_sizeNo{"type":"string"}
hop_limitNo{"type":"string"}
headersNo{"type":"string"}
limitNo{"type":"string"}
dst_limitNo{"type":"string"}
nthNo{"type":"string"}
randomNo{"type":"string"}
per_connection_classifierNo{"type":"string"}
timeNo{"type":"string"}
jump_targetNo{"type":"string"}
address_listNo{"type":"string"}
address_list_timeoutNo{"type":"string"}
commentNo{"type":"string"}
disabledNo{"type":"boolean"}
logNo{"type":"boolean"}
log_prefixNo{"type":"string"}

remove_ipv6_nat_rule

Remove IPv6 Firewall NAT Rule · Risk: destructive

Permanently deletes an IPv6 NAT rule (/ipv6 firewall nat remove) — use to remove a translation entry entirely. First verifies the rule exists via a count-only check; returns a not-found message if absent. rule_id takes the .id from list_ipv6_nat_rules. For IPv4 use remove_nat_rule; for the IPv6 filter table use remove_ipv6_filter_rule. To temporarily deactivate instead of delete, use disable_ipv6_nat_rule.

ParameterRequiredDefinition
rule_idYes{"type":"string"}

move_ipv6_nat_rule

Move IPv6 Firewall NAT Rule · Risk: write-idempotent

Repositions an IPv6 NAT rule to a different ordinal slot (/ipv6 firewall nat move ... destination=N) — NAT rules are evaluated top-to-bottom so position controls which rule matches first. destination is a 0-based integer index. rule_id takes the .id from list_ipv6_nat_rules. For IPv4 use move_nat_rule; for the IPv6 filter table use move_ipv6_filter_rule. Confirms success or returns the error message from the device.

ParameterRequiredDefinition
rule_idYes{"type":"string"}
destinationYes0-based target position index {"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}

enable_ipv6_nat_rule

Enable IPv6 Firewall NAT Rule · Risk: write-idempotent

Re-activates a disabled IPv6 NAT rule (/ipv6 firewall nat set ... disabled=no) — use to restore a rule that was previously disabled without recreating it. rule_id takes the .id from list_ipv6_nat_rules. To deactivate use disable_ipv6_nat_rule; to permanently delete use remove_ipv6_nat_rule. For IPv4 NAT use enable_nat_rule. Returns the updated rule's full detail.

ParameterRequiredDefinition
rule_idYes{"type":"string"}

disable_ipv6_nat_rule

Disable IPv6 Firewall NAT Rule · Risk: write-idempotent

Temporarily deactivates an IPv6 NAT rule (/ipv6 firewall nat set ... disabled=yes) without removing it — use to suspend a translation rule while preserving its configuration. rule_id takes the .id from list_ipv6_nat_rules. To re-activate use enable_ipv6_nat_rule; to permanently delete use remove_ipv6_nat_rule. For IPv4 NAT use disable_nat_rule. Returns the updated rule's full detail.

ParameterRequiredDefinition
rule_idYes{"type":"string"}

On this page