Set-VBRDefaultGateway
Short Description
Modifies cloud default gateways.
Applies to
Platform: VMware, Hyper-V
Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License
Syntax
Set-VBRDefaultGateway -Gateway <VBRDefaultGateway> [-IpAddress <string>] [-NetworkMask <string>] [<CommonParameters>] |
Detailed Description
This cmdlet modifies the default cloud gateway.
Note |
To modify settings, specify new values for the necessary parameters. The cmdlet will overwrite the previous parameters values with new values. The parameters that you omit will remain unchanged. |
Parameters
Parameter | Description | Type | Required | Position | Accept |
---|---|---|---|---|---|
Gateway | Specifies the default cloud gateway you want to modify. | Accepts the VBRDefaultGateway object. To get this object, run the Get-VBRDefaultGatewayConfiguration cmdlet. | True | Named | True (ByValue, |
IpAddress | Specifies the IP address you want to assign to the default gateway. | String | False | Named | False |
NetworkMask | Specifies the network mask you want to assign to the default gateway. | String | False | Named | False |
PassThru | Defines that the command returns the output object to the Windows PowerShell console. | SwitchParameter | False | Named | False |
<CommonParameters>
This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.
Ouput Object
Examples
Setting IP Address and Network Mask for Selected Default Gateway
This example shows how to set the IP address and the network mask of a selected default gateway.
$c = Get-VBRDefaultGatewayConfiguration $alldefaultgateways = $c.Defaultgateway.name $alldefaultgateways Hardware plan hv network 1 Hardware plan hv network 1 (internet) $defaultgateway = $c.Defaultgateway[0] Set-VBRDefaultGateway -Gateway $defaultgateway -IpAddress "172.16.2.232" -NetworkMask "255.255.0.0" |
Perform the following steps:
- Run the Get-VBRDefaultGatewayConfiguration cmdlet. Save it to $c variable.
- Get all default gateways by name. Save the array of gateways to $alldefaultgateways variable.
- Run the $alldefaultgateways variable to see all the names of all gateways available.
- Select the first default gateway from the array. Save it to $defaultgateway variable.
- Run the Set-VBRDefaultGateway cmdlet. Set the $defaultgateway variable as the Gateway parameter value. Specify the IPAddress and the NetworkMask parameter values.
Related Commands