New-AzFirewallNatRule
Creates a Firewall NAT Rule.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
New-AzFirewallNatRule
-Name <String>
[-Description <String>]
[-SourceAddress <String[]>]
[-SourceIpGroup <String[]>]
-DestinationAddress <String[]>
-DestinationPort <String[]>
-Protocol <String[]>
[-TranslatedAddress <String>]
[-TranslatedFqdn <String>]
-TranslatedPort <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-AzFirewallNatRule cmdlet creates a NAT rule for Azure Firewall.
Examples
Example 1: Create a rule to DNAT all TCP traffic from 10.0.0.0/24 with destination 10.1.2.3:80 to destination 10.4.5.6:8080
New-AzFirewallNatRule -Name "dnat-rule" -Protocol "TCP" -SourceAddress "10.0.0.0/24" -DestinationAddress "10.1.2.3" -DestinationPort "80" -TranslatedAddress "10.4.5.6" -TranslatedPort "8080"
This example creates a rule which will DNAT all traffic originating in 10.0.0.0/24 with destination 10.1.2.3:80 to 10.4.5.6:8080
Example 2
Creates a Firewall NAT Rule. (autogenerated)
New-AzFirewallNatRule -DestinationAddress '10.0.0.1' -DestinationPort '443' -Name 'dnat-rule' -Protocol Any -SourceIpGroup <String[]> -TranslatedAddress '10.0.0.2' -TranslatedPort '8080'
Parameters
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies an optional description of this rule.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The destination addresses of the rule
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The destination ports of the rule
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of this NAT rule. The name must be unique inside a rule collection.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the type of traffic to be filtered by this rule. The supported protocols are TCP and UDP. A special value "Any" is allowed, meaning it will match both TCP and UDP, but no other protocols.
| Type: | String[] |
| Accepted values: | Any, TCP, UDP |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The source addresses of the rule
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The source ipgroup of the rule
| Type: | String[] |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the desired result of the address translation
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The translated FQDN for this NAT rule
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the desired result of the port translation
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Inputs
None