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
[--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

--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
[--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

--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

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). If provided, no other 'Resource Id' arguments should be specified.

--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.