az network lb inbound-nat-rule

Manage inbound NAT rules of a load balancer.

Commands

az network lb inbound-nat-rule create

Create an inbound NAT rule.

az network lb inbound-nat-rule delete

Delete an inbound NAT rule.

az network lb inbound-nat-rule list

List inbound NAT rules.

az network lb inbound-nat-rule show

Get the details of an inbound NAT rule.

az network lb inbound-nat-rule update

Update an inbound NAT rule.

az network lb inbound-nat-rule create

Create an inbound NAT rule.

az network lb inbound-nat-rule create --backend-port
                                      --frontend-port
                                      --lb-name
                                      --name
                                      --protocol {All, Tcp, Udp}
                                      --resource-group
                                      [--enable-tcp-reset {false, true}]
                                      [--floating-ip {false, true}]
                                      [--frontend-ip-name]
                                      [--idle-timeout]
                                      [--subscription]

Examples

Create a basic inbound NAT rule for port 80.

az network lb inbound-nat-rule create -g MyResourceGroup --lb-name MyLb -n MyNatRule \
    --protocol Tcp --frontend-port 80 --backend-port 80

Create a basic inbound NAT rule for a specific frontend IP and enable floating IP for NAT Rule.

az network lb inbound-nat-rule create -g MyResourceGroup --lb-name MyLb -n MyNatRule --protocol Tcp \
    --frontend-port 5432 --backend-port 3389 --frontend-ip-name MyFrontendIp --floating-ip true

Required Parameters

--backend-port

Port number.

--frontend-port

Port number.

--lb-name

The load balancer name.

--name -n

The name of the inbound NAT rule.

--protocol

Network transport protocol.

accepted values: All, Tcp, Udp
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--enable-tcp-reset

Receive bidirectional TCP reset on TCP flow idle timeout or unexpected connection termination. Only used when protocol is set to TCP.

accepted values: false, true
--floating-ip

Enable floating IP.

accepted values: false, true
--frontend-ip-name

The name of the frontend IP configuration. If only one exists, omit to use as default.

--idle-timeout

Idle timeout in minutes.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az network lb inbound-nat-rule delete

Delete an inbound NAT rule.

az network lb inbound-nat-rule delete --lb-name
                                      --name
                                      --resource-group
                                      [--subscription]

Examples

Delete an inbound NAT rule.

az network lb inbound-nat-rule delete -g MyResourceGroup --lb-name MyLb -n MyNatRule

Required Parameters

--lb-name

The name of the load balancer.

--name -n

The name of the inbound NAT rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az network lb inbound-nat-rule list

List inbound NAT rules.

az network lb inbound-nat-rule list --lb-name
                                    --resource-group
                                    [--query-examples]
                                    [--subscription]

Examples

List inbound NAT rules.

az network lb inbound-nat-rule list -g MyResourceGroup --lb-name MyLb -o table

Required Parameters

--lb-name

The name of the load balancer.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az network lb inbound-nat-rule show

Get the details of an inbound NAT rule.

az network lb inbound-nat-rule show --lb-name
                                    --name
                                    --resource-group
                                    [--query-examples]
                                    [--subscription]

Examples

Get the details of an inbound NAT rule.

az network lb inbound-nat-rule show -g MyResourceGroup --lb-name MyLb -n MyNatRule

Required Parameters

--lb-name

The name of the load balancer.

--name -n

The name of the inbound NAT rule.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az network lb inbound-nat-rule update

Update an inbound NAT rule.

az network lb inbound-nat-rule update [--add]
                                      [--backend-port]
                                      [--enable-tcp-reset {false, true}]
                                      [--floating-ip {false, true}]
                                      [--force-string]
                                      [--frontend-ip-name]
                                      [--frontend-port]
                                      [--idle-timeout]
                                      [--ids]
                                      [--lb-name]
                                      [--name]
                                      [--protocol {All, Tcp, Udp}]
                                      [--remove]
                                      [--resource-group]
                                      [--set]
                                      [--subscription]

Examples

Update an inbound NAT rule to disable floating IP and modify idle timeout duration.

az network lb inbound-nat-rule update -g MyResourceGroup --lb-name MyLb -n MyNatRule \
    --floating-ip false --idle-timeout 5

Update an inbound NAT rule. (autogenerated)

az network lb inbound-nat-rule update --backend-port 3389 --frontend-port 5432 --lb-name MyLb --name MyNatRule --protocol Udp --resource-group MyResourceGroup

Update an inbound NAT rule. (autogenerated)

az network lb inbound-nat-rule update --lb-name MyLb --name MyNatRule --resource-group MyResourceGroup --set tags.CostCenter=MyBusinessGroup

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--backend-port

Port number.

--enable-tcp-reset

Receive bidirectional TCP reset on TCP flow idle timeout or unexpected connection termination. Only used when protocol is set to TCP.

accepted values: false, true
--floating-ip

Enable floating IP.

accepted values: false, true
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--frontend-ip-name

The name of the frontend IP configuration.

--frontend-port

Port number.

--idle-timeout

Idle timeout in minutes.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--lb-name

The load balancer name.

--name -n

The name of the inbound NAT rule.

--protocol

Network transport protocol.

accepted values: All, Tcp, Udp
--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.