FirewallNatRuleSpec
Desired MikroTik firewall NAT rule (/ip/firewall/nat).
|
Note
|
The trailing dst-nat fields default to empty so masquerade-shaped callers keep compiling. For a port-forward set Action = "dst-nat", Chain = "dstnat", plus Protocol, DstPort, InInterface OR InInterfaceList, ToAddresses and ToPorts. Use InInterfaceList (e.g. "WAN") when the WAN uplink may be a single iface OR a tagged VLAN sub-iface - matching the list covers whichever actually carries the traffic.
|
public sealed record FirewallNatRuleSpec : IEquatable<FirewallNatRuleSpec>
1. Constructors
1.1. FirewallNatRuleSpec(string, string, string, bool, string, string, string, string, string, string, string)
Desired MikroTik firewall NAT rule (/ip/firewall/nat).
public FirewallNatRuleSpec(string Chain, string Action, string OutInterface, bool Disabled, string Comment, string Protocol = "", string DstPort = "", string InInterface = "", string ToAddresses = "", string ToPorts = "", string InInterfaceList = "")
| Name | Type | Description |
|---|---|---|
Chain |
string |
|
Action |
string |
|
OutInterface |
string |
|
Disabled |
bool |
|
Comment |
string |
|
Protocol |
string |
|
DstPort |
string |
|
InInterface |
string |
|
ToAddresses |
string |
|
ToPorts |
string |
|
InInterfaceList |
string |
2. Properties
2.1. Action
public string Action { get; init; }
2.2. Chain
public string Chain { get; init; }
2.3. Comment
public string Comment { get; init; }
2.4. Disabled
public bool Disabled { get; init; }
2.5. DstPort
public string DstPort { get; init; }
2.6. InInterface
public string InInterface { get; init; }
2.7. InInterfaceList
public string InInterfaceList { get; init; }
2.8. OutInterface
public string OutInterface { get; init; }
2.9. Protocol
public string Protocol { get; init; }
2.10. ToAddresses
public string ToAddresses { get; init; }
2.11. ToPorts
public string ToPorts { get; init; }
3. Operators
3.1. operator !=(FirewallNatRuleSpec, FirewallNatRuleSpec)
public static bool operator !=(FirewallNatRuleSpec left, FirewallNatRuleSpec right)
| Name | Type | Description |
|---|---|---|
left |
FirewallNatRuleSpec |
|
right |
FirewallNatRuleSpec |
Returns: bool
3.2. operator ==(FirewallNatRuleSpec, FirewallNatRuleSpec)
public static bool operator ==(FirewallNatRuleSpec left, FirewallNatRuleSpec right)
| Name | Type | Description |
|---|---|---|
left |
FirewallNatRuleSpec |
|
right |
FirewallNatRuleSpec |
Returns: bool