Set-VMHostRoute

This cmdlet modifies a route in the host routing table.

Syntax

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

Parameters

Required Parameter Name Type Position Features Description
required
VMHostRoute
VMHostRoute[] named
  • pipeline
  • Specifies the route you want to modify.
    optional
    Destination
    IPAddress named Changes the destination IP address of the route.
    optional
    Gateway
    IPAddress named Changes the gateway IP address of the route.
    optional
    PrefixLength
    Int32 named 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.

    Output

    VMware.VimAutomation.ViCore.Types.V1.Host.VMHostRoute

    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.

    Related Commands

    Feedback

    Was this page helpful?