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

Name | Type | Description | Required? | Pipeline Input | Default Value
--- | --- | --- | --- | --- | ---
VMHostRoute | VMHostRoute[] | Specifies the route you want to modify. | true | true (ByValue)
Confirm | SwitchParameter | If 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. | false | false
Destination | IPAddress | Changes the destination IP address of the route. | false | false
Gateway | IPAddress | Changes the gateway IP address of the route. | false | false
PrefixLength | Int32 | Modifies 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. | false | false
WhatIf | SwitchParameter | Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. | false | false

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.