Remove-BgpCustomRoute

Removes custom routes from the BGP router.

Syntax

Remove-BgpCustomRoute
      [-Network <String[]>]
      [-Interface <String[]>]
      [-Force]
      [-RoutingDomain <String>]
      [-CimSession <CimSession[]>]
      [-ThrottleLimit <Int32>]
      [-AsJob]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-BgpCustomRoute cmdlet removes Classless InterDomain Routing (CIDR) prefixes or interfaces for custom routes from the Border Gateway Protocol (BGP) routing table. When you remove a custom route, the BGP router can no longer use the information from the CIDR network or interface to distribute routing information between autonomous systems (AS). In addition, the BGP router sends route withdrawal messages to peers to remove the previously advertised custom routes that you remove.

You must specify at least one of the Interface or Network parameters.

Examples

Example 1: Remove a network prefix

PS C:\> Remove-BgpCustomRoute -Network "172.23.90.0/29"



Confirm
Removing specified custom networks from BGP router. Do you want to continue?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):Y

This command removes the network prefix of a custom network from the BGP routing table.

Example 2: Remove the interface for a routing domain

PS C:\> Remove-BgpCustomRoute -Interface "VS01" -RoutingDomain Rd_002



Confirm
Removing specified custom networks from BGP router of Routing Domain Rd_002. Do you want to continue?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):Y

This command removes the router interface named VS01 from the BGP routing table for the routing domain named Rd_002.

Parameters

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Type:CimSession[]
Aliases:Session
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Interface

Specifies an array of names of router interfaces. The cmdlet removes the static routes for these interfaces from the BGP routing table.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Network

Specifies an array of network prefixes, in Classless InterDomain Routing (CIDR) notation. For IPv4 networks, you must specify the network prefix and its network mask. The cmdlet removes the routing information for the network prefixes from the BGP routing table.

Type:String[]
Aliases:DestinationNetwork
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-RoutingDomain

Specifies the name, as a string, of a routing domain. The name of a routing domain is a unique user-defined alphanumeric string.

Type:String
Aliases:RoutingDomainName
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ThrottleLimit

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String[]

String

Outputs

Object