You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<dev:remarks><maml:para>This example configures a network interface. The first command creates a network interface named NetworkInterface1 in resource group ResourceGroup1.
<dev:remarks><maml:para>This example configures a network interface. The first command gets a network interface named NetworkInterface1 in resource group ResourceGroup1. The second command sets the private IP address of the IP configuration. The third command sets the private IP allocation method to Static. The fourth command sets a tag on the network interface. The fifth command uses the information stored in the $Nic variable to set the network interface.
48039
48039
</maml:para>
48040
-
<maml:para>The second command sets the private IP address of the IP configuration.
48040
+
<maml:para></maml:para>
48041
+
<maml:para></maml:para>
48042
+
</dev:remarks>
48043
+
</command:example>
48044
+
<command:example><maml:title>Example 2: Change DNS settings on a network interface</maml:title>
<dev:remarks><maml:para>The first command gets a network interface named NetworkInterface1 that exists within resource group ResourceGroup1. The second command adds DNS server 192.168.1.100 to this interface. The third command applies these changes to the network interface. To remove a DNS server, follow the commands listed above, but replace ".Add" with ".Remove" in the second command.
48049
+
</maml:para>
48050
+
<maml:para></maml:para>
48051
+
<maml:para></maml:para>
48052
+
</dev:remarks>
48053
+
</command:example>
48054
+
<command:example><maml:title>Example 3: Enable IP forwading on a network interface</maml:title>
<dev:remarks><maml:para>The first command gets an existing network interface called NetworkInterface1 and stores it in the $nic variable. The second command changes the IP forwarding value to true. Finally, the third command applies the changes to the network interface. To disable IP forwarding on a network interface, follow the sample example, but be sure to change the second command to "$nic.EnableIPForwarding = 0".
48041
48059
</maml:para>
48042
-
<maml:para>The third command sets the private IP allocation method to Static.
48060
+
<maml:para></maml:para>
48061
+
<maml:para></maml:para>
48062
+
</dev:remarks>
48063
+
</command:example>
48064
+
<command:example><maml:title>Example 4: Change the subnet of a network interface</maml:title>
<dev:remarks><maml:para>The first command gets the network interface NetworkInterface1 and stores it in the $nic variable. The second command gets the virtual network associated with the subnet that the network interface is going to be associated with. The second command gets the subnet and stores it in the $subnet2 variable. The third command associated the primary private IP address of the network interface with the new subnet. Finally the last command applied these changes on the network interface.
48071
+
</maml:para>
48072
+
<maml:para>>[!NOTE] >The IP configurations must be dynamic before you can change the subnet. If you have static IP configurations, change then to dynamic before proceeding.
48043
48073
</maml:para>
48044
-
<maml:para>The fourth command sets a tag on the network interface.
48074
+
<maml:para>>[!NOTE] >If the network interface has multiple IP configurations, the forth command must be done for all these IP configurations before the final Set-AzureRmNetworkInterface command is executed. This can be done as in the forth command but by replacing "0" with the appropriate number. If a network interface has N IP configurations, then N-1 of these commands must exist.
48045
48075
</maml:para>
48046
-
<maml:para>The fifth command uses the information stored in the $Nic variable to set the network interface.
48076
+
<maml:para></maml:para>
48077
+
<maml:para></maml:para>
48078
+
</dev:remarks>
48079
+
</command:example>
48080
+
<command:example><maml:title>Example 5: Associate/Dissociate a Network Security Group to a network interface</maml:title>
<dev:remarks><maml:para>The first command gets an existing network interface called NetworkInterface1 and stores it in the $nic variable. The second command gets an existing network security group called MyNSG and stores it in the $nsg variable. The forth command assigns the $nsg to the $nic. Finally, the fifth command applies the changes to the Network interface. To dissociate network security groups from a network interface, simple replace $nsg in the forth command with $null.
The first command gets a network interface named NetworkInterface1 that exists within resource group ResourceGroup1. The second command adds DNS server 192.168.1.100 to this interface. The third command applies these changes to the network interface. To remove a DNS server, follow the commands listed above, but replace ".Add" with ".Remove" in the second command.
49
+
50
+
### Example 3: Enable IP forwading on a network interface
The first command gets an existing network interface called NetworkInterface1 and stores it in the $nic variable. The second command changes the IP forwarding value to true. Finally, the third command applies the changes to the network interface. To disable IP forwarding on a network interface, follow the sample example, but be sure to change the second command to "$nic.EnableIPForwarding = 0".
57
+
58
+
### Example 4: Change the subnet of a network interface
The first command gets the network interface NetworkInterface1 and stores it in the $nic variable. The second command gets the virtual network associated with the subnet that the network interface is going to be associated with. The second command gets the subnet and stores it in the $subnet2 variable. The third command associated the primary private IP address of the network interface with the new subnet. Finally the last command applied these changes on the network interface.
67
+
68
+
>[!NOTE]
69
+
>The IP configurations must be dynamic before you can change the subnet. If you have static IP configurations, change then to dynamic before proceeding.
70
+
71
+
>[!NOTE]
72
+
>If the network interface has multiple IP configurations, the forth command must be done for all these IP configurations before the final Set-AzureRmNetworkInterface command is executed. This can be done as in the forth command but by replacing "0" with the appropriate number. If a network interface has N IP configurations, then N-1 of these commands must exist.
73
+
74
+
### Example 5: Associate/Dissociate a Network Security Group to a network interface
The first command gets an existing network interface called NetworkInterface1 and stores it in the $nic variable. The second command gets an existing network security group called MyNSG and stores it in the $nsg variable. The forth command assigns the $nsg to the $nic. Finally, the fifth command applies the changes to the Network interface. To dissociate network security groups from a network interface, simple replace $nsg in the forth command with $null.
82
+
45
83
## PARAMETERS
46
84
47
85
### -InformationAction
@@ -115,6 +153,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
0 commit comments