< Back

Set-VMHostRoute

Sun Jan 19, 2020 7:11 pm

NAME Set-VMHostRoute



SYNOPSIS

This cmdlet modifies a route in the host routing table.





SYNTAX

Set-VMHostRoute [-VMHostRoute] <VMHostRoute[]> [-Destination <IPAddress>] [-Gateway <IPAddress>] [-PrefixLength

<Int32>] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

This cmdlet modifies a route in the host routing table.





PARAMETERS

-Destination <IPAddress>

Changes the destination IP address of the route.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Gateway <IPAddress>

Changes the gateway IP address of the route.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? 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.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-VMHostRoute <VMHostRoute[]>

Specifies the route you want to modify.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



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



Required? false

Position? named

Default value $true

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more modified VMHostRoute objects







NOTES





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



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



RELATED LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... Route.html

Get-VMHostRoute

New-VMHostRoute

Remove-VMHostRoute