Set-​Azure​IP​Forwarding

Enables or disables IP forwarding.

Syntax

Set-AzureIPForwarding
   [-Disable]
   [-NetworkInterfaceName <String>]
   [-PassThru]
   [-Profile <AzureSMProfile>]
   -ServiceName <String>
   -VM <PersistentVMRoleContext>
   [<CommonParameters>]
Set-AzureIPForwarding
   [-Disable]
   [-NetworkInterfaceName <String>]
   [-PassThru]
   [-Profile <AzureSMProfile>]
   -RoleName <String>
   -ServiceName <String>
   [-Slot <String>]
   [<CommonParameters>]
Set-AzureIPForwarding
   [-Enable]
   [-NetworkInterfaceName <String>]
   [-PassThru]
   [-Profile <AzureSMProfile>]
   -ServiceName <String>
   -VM <PersistentVMRoleContext>
   [<CommonParameters>]
Set-AzureIPForwarding
   [-Enable]
   [-NetworkInterfaceName <String>]
   [-PassThru]
   [-Profile <AzureSMProfile>]
   -RoleName <String>
   -ServiceName <String>
   [-Slot <String>]
   [<CommonParameters>]

Description

The Set-AzureIPForwarding cmdlet enables or disables IP forwarding for a virtual machine, for a platform as a service (PaaS) role, or a network adapter that belongs to a virtual machine or PaaS role.

Examples

Example 1: Enable IP forwarding for a virtual machine

PS C:\> Get-AzureVM -ServiceName "ContosoService" -Name "ContosoVM06" | Set-AzureIPForwarding -Enable

This command gets a virtual machine named ContosoVM06 for the service named ContosoService, and passes that virtual machine object to the current cmdlet. The current cmdlet enables IP forwarding for that virtual machine.

Example 2: Disable IP forwarding for a virtual machine

PS C:\> Get-AzureVM -ServiceName "ContosoService" -Name "ContosoVM06" | Set-AzureIPForwarding -Disable

This command gets a virtual machine named ContosoVM06 for the service named ContosoService, and passes that virtual machine object to the current cmdlet. The current cmdlet disables IP forwarding for that virtual machine.

Required Parameters

-Disable

Indicates that this cmdlet disables IP forwarding.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Enable

Indicates that this cmdlet enables IP forwarding.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RoleName

Specifies the name of a PaaS role on which this cmdlet sets IP forwarding.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ServiceName

Specifies the name of a cloud service. The PaaS role belongs to the service that this parameter specifies.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VM

Specifies the virtual machine object on which this cmdlet sets IP forwarding.

Type:PersistentVMRoleContext
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-NetworkInterfaceName

Specifies the name of the network adapter on which this cmdlet sets IP forwarding.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

Type:AzureSMProfile
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Slot

Specifies a PaaS slot. The PaaS role for which this cmdlet sets forwarding has the slot that this parameter specifies. Valid values are:- Production

  • Staging

    The default value is Production.
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

System.Boolean