PowerCLI Reference

Set-VMHostRoute

Synopsis

This cmdlet modifies a route in the host routing table.

Syntax

Set-VMHostRoute [-VMHostRoute] <VMHostRoute[]> [-Destination <IPAddress>] [-Gateway <IPAddress>] [-PrefixLength <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-VMHostRoute
New-VMHostRoute
Remove-VMHostRoute

Detailed Description

This cmdlet modifies a route in the host routing table.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
VMHostRouteVMHostRoute[]Specifies the route you want to modify.truetrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse
DestinationIPAddressChanges the destination IP address of the route.falsefalse
GatewayIPAddressChanges the gateway IP address of the route.falsefalse
PrefixLengthInt32Modifies the prefix length of the destination IP address. For IPv4, the valid values are from 0 to 32, and for IPv6 - from 0 to 128.falsefalse
WhatIfSwitchParameterIndicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

Zero or more modified VMHostRoute objects

Notes

Supported only on ESX 4.1/ vCenter Server 4.1 and later.

Examples

-------------- Example 1 --------------

$vmhostroute = New-VMHostRoute -VMHost 10.23.114.189 -Destination 192.168.104.101 -Gateway 10.23.84.69 -PrefixLength 32

$vmhostroute | Set-VMHostRoute -Gateway 10.23.84.70

Creates a new host route and modifies its gateway.

-------------- Example 2 --------------

$vmhostroute1 = New-VMHostRoute -VMHost 10.23.114.189 -Destination 192.168.104.101 -Gateway 10.23.84.69 -PrefixLength 32

$vmhostroute2 = New-VMHostRoute -VMHost 10.23.114.190 -Destination 192.168.104.101 -Gateway 10.23.84.70 -PrefixLength 32

Set-VMHostRoute -VMHostRoute ($vmhostroute1, $vmhostroute2) -Destination 192.168.104.0 -PrefixLength 24

Modifies the destination and the prefix length of two host routes.


Copyright © VMware, Inc. All rights reserved.