Redigera

Dela via


New-AzFirewallPolicyNatRule

Create a new Azure Firewall Policy NAT Rule

Syntax

New-AzFirewallPolicyNatRule
   -Name <String>
   [-Description <String>]
   -SourceAddress <String[]>
   -DestinationAddress <String[]>
   -DestinationPort <String[]>
   -Protocol <String[]>
   -TranslatedAddress <String>
   -TranslatedPort <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
New-AzFirewallPolicyNatRule
   -Name <String>
   [-Description <String>]
   -SourceAddress <String[]>
   -DestinationAddress <String[]>
   -DestinationPort <String[]>
   -Protocol <String[]>
   -TranslatedFqdn <String>
   -TranslatedPort <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
New-AzFirewallPolicyNatRule
   -Name <String>
   [-Description <String>]
   -SourceIpGroup <String[]>
   -DestinationAddress <String[]>
   -DestinationPort <String[]>
   -Protocol <String[]>
   -TranslatedAddress <String>
   -TranslatedPort <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
New-AzFirewallPolicyNatRule
   -Name <String>
   [-Description <String>]
   -SourceIpGroup <String[]>
   -DestinationAddress <String[]>
   -DestinationPort <String[]>
   -Protocol <String[]>
   -TranslatedFqdn <String>
   -TranslatedPort <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.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

The description of the rule

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DestinationAddress

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

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DestinationPort

The destination ports of the rule

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the NAT Rule Collection

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Protocol

The protocols of the rule

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SourceAddress

The source addresses of the rule

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SourceIpGroup

The source ipgroups of the rule

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-TranslatedAddress

The translated address for this NAT rule

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-TranslatedFqdn

The translated FQDN for this NAT rule

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-TranslatedPort

The translated port for this NAT rule

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

PSAzureFirewallNatRule