< Back

Remove-NsxLogicalRouterStaticRoute

Sat Jan 18, 2020 9:24 pm

NAME Remove-NsxLogicalRouterStaticRoute



SYNOPSIS

Removes a static route from the specified ESGs routing configuration.





SYNTAX

Remove-NsxLogicalRouterStaticRoute [-StaticRoute] <XmlElement> [-Confirm] [[-Connection] <PSObject>]

[<CommonParameters>]





DESCRIPTION

An NSX Logical Router is a distributed routing function implemented within

the ESXi kernel, and optimised for east west routing.



Logical Routers perform ipv4 and ipv6 routing functions for connected

networks and support both static and dynamic routing via OSPF and BGP.



The Remove-NsxLogicalRouterStaticRoute cmdlet removes a static route from the routing

configuration of the specified LogicalRouter.



Routes to be removed can be constructed via a PoSH pipline filter outputing

route objects as produced by Get-NsxLogicalRouterStaticRoute and passing them on the

pipeline to Remove-NsxLogicalRouterStaticRoute.





PARAMETERS

-StaticRoute <XmlElement>



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompt for confirmation. Specify as -confirm:$false to disable confirmation prompt



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



-Connection <PSObject>

PowerNSX Connection object



Required? false

Position? 2

Default value $defaultNSXConnection

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



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Remove a route to 1.1.1.0/24 via 10.0.0.100 from LogicalRouter LogicalRouter01



PS C:\\> Get-NsxLogicalRouter LogicalRouter01 | Get-NsxLogicalRouterRouting | Get-NsxLogicalRouterStaticRoute |

where-object { $_.network -eq '1.1.1.0/24' -and $_.nextHop -eq '10.0.0.100' } | Remove-NsxLogicalRouterStaticRoute









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Remove all routes to 1.1.1.0/24 from LogicalRouter LogicalRouter01



PS C:\\> Get-NsxLogicalRouter LogicalRouter01 | Get-NsxLogicalRouterRouting | Get-NsxLogicalRouterStaticRoute |

where-object { $_.network -eq '1.1.1.0/24' } | Remove-NsxLogicalRouterStaticRoute











RELATED LINKS