Add-BgpCustomRoute

Add-BgpCustomRoute

Adds custom routes to the BGP routing table.

Syntax

Parameter Set: Add0
Add-BgpCustomRoute [-AsJob] [-CimSession <CimSession[]> ] [-Interface <String[]> ] [-Network <String[]> ] [-PassThru] [-RoutingDomain <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]

Detailed Description

The Add-BgpCustomRoute cmdlet adds custom routes from router interfaces and network prefixes to the Border Gateway Protocol (BGP) routing table. The cmdlet returns information about any errors that occur when you add the routes to the BGP routing table.

Use the Interface parameter to specify the router interfaces. Use the Network parameter to specify the network prefixes. Use the RoutingDomain parameter to specify the routing domain or tenant of the BGP router in a multitenant deployment.

Parameters

-AsJob

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

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

Aliases

Session

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Interface<String[]>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Network<String[]>

Specifies an array of network prefixes, in Classless InterDomain Routing (CIDR) notation. The cmdlet adds the routing information for the network prefixes to the BGP routing table.

Aliases

DestinationNetwork

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RoutingDomain<String>

Specifies the name, as a string, of the routing domain. The cmdlet adds the custom routes to the BGP routing table for this routing domain.

Aliases

RoutingDomainName

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Management.Infrastructure.CimInstance#BgpCustomNetworkInfo

Examples

Example 1: Add an interface to a BGP router

This command adds the interface named Ethernet to the local BGP router. The cmdlet adds all the unicast IP addresses of the interface to the BGP router.

PS C:\> Add-BgpCustomRoute -Interface "Ethernet" -PassThru

Example 2: Add a network prefix to a BGP router

This command adds the routing information from the network prefix 172.23.90.0/29 to the local BGP router.

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

Example 3: Add an interface and a network prefix to a BGP router for a routing domain

This command adds the routing information from the interface named VS1 and the network prefix 172.23.90.0 to the BGP router for the routing domain in a multitenant environment named Rd_001. The command includes the PassThru parameter, so the command sends a BgpCustomNetworkInfo object to the console.

PS C:\> Add-BgpCustomRoute -Interface "VS1" -Network "172.23.90/29" -RoutingDomain "Rd_001" -PassThru

Get-BgpCustomRoute

Remove-BgpCustomRoute