Edit

Share via


New-AzFirewallPolicyNatRule

Create a new Azure Firewall Policy NAT Rule

Syntax

SourceAddressAndTranslatedAddress

New-AzFirewallPolicyNatRule
    -Name <String>
    -SourceAddress <String[]>
    -DestinationAddress <String[]>
    -DestinationPort <String[]>
    -Protocol <String[]>
    -TranslatedAddress <String>
    -TranslatedPort <String>
    [-Description <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

SourceAddressAndTranslatedFqdn

New-AzFirewallPolicyNatRule
    -Name <String>
    -SourceAddress <String[]>
    -DestinationAddress <String[]>
    -DestinationPort <String[]>
    -Protocol <String[]>
    -TranslatedFqdn <String>
    -TranslatedPort <String>
    [-Description <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

SourceIpGroupAndTranslatedAddress

New-AzFirewallPolicyNatRule
    -Name <String>
    -SourceIpGroup <String[]>
    -DestinationAddress <String[]>
    -DestinationPort <String[]>
    -Protocol <String[]>
    -TranslatedAddress <String>
    -TranslatedPort <String>
    [-Description <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

SourceIpGroupAndTranslatedFqdn

New-AzFirewallPolicyNatRule
    -Name <String>
    -SourceIpGroup <String[]>
    -DestinationAddress <String[]>
    -DestinationPort <String[]>
    -Protocol <String[]>
    -TranslatedFqdn <String>
    -TranslatedPort <String>
    [-Description <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The New-AzFirewallPolicyNatRule cmdlet creates a NAT rule for a Azure Firewall Policy.

Examples

Example 1

New-AzFirewallPolicyNatRule -Name NatRule1 -Protocol "TCP" -SourceAddress "192.168.0.0/16" -DestinationAddress 10.20.30.40 -DestinationPort 1000 -TranslatedAddress "192.168.0.1" -TranslatedPort "100"

This example creates a NAT rule with the source address, protocol, destination address, destination port, translated address, and translated port.

Example 2

New-AzFirewallPolicyNatRule -Name NatRule1 -Protocol "TCP" -SourceAddress "192.168.0.0/16" -DestinationAddress 10.20.30.40 -DestinationPort 1000 -TranslatedFqdn "internalhttp.server.net" -TranslatedPort "100"

This example creates a NAT rule with the source address, protocol, destination address, destination port, translated fqdn, and translated port.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

The description of the rule

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationAddress

The destination addresses of the rule. This has to be Public IP of the Firewall.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationPort

The destination ports of the rule

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The name of the NAT Rule Collection

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Protocol

The protocols of the rule

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SourceAddress

The source addresses of the rule

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SourceAddressAndTranslatedAddress
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SourceAddressAndTranslatedFqdn
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SourceIpGroup

The source ipgroups of the rule

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SourceIpGroupAndTranslatedAddress
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SourceIpGroupAndTranslatedFqdn
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TranslatedAddress

The translated address for this NAT rule

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SourceAddressAndTranslatedAddress
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SourceIpGroupAndTranslatedAddress
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TranslatedFqdn

The translated FQDN for this NAT rule

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SourceAddressAndTranslatedFqdn
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
SourceIpGroupAndTranslatedFqdn
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-TranslatedPort

The translated port for this NAT rule

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

PSAzureFirewallNatRule