Add-BgpCustomRoute
Adds custom routes to the BGP routing table.
Syntax
Add-BgpCustomRoute
[-PassThru]
[-RoutingDomain <String>]
[-Interface <String[]>]
[-Network <String[]>]
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[<CommonParameters>]
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.
Examples
Example 1: Add an interface to a BGP router
PS C:\> Add-BgpCustomRoute -Interface "Ethernet" -PassThru
Interface : {Ethernet}
Network :
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.
Example 2: Add a network prefix to a BGP router
PS C:\> Add-BgpCustomRoute -Network "172.23.90.0/29" -PassThru
Interface : {Ethernet}
Network : {172.23.90.0/29}
This command adds the routing information from the network prefix 172.23.90.0/29 to the local BGP router.
Example 3: Add an interface and a network prefix to a BGP router for a routing domain
PS C:\> Add-BgpCustomRoute -Interface "VS1" -Network "172.23.90/29" -RoutingDomain "Rd_001" -PassThru
Interface : {Ethernet}
Network : {172.23.90.0/29}
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.
Parameters
-AsJob
ps_cimcommon_asjob
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-CimSessionhttp://go.microsoft.com/fwlink/p/?LinkId=227967 or Get-CimSessionhttp://go.microsoft.com/fwlink/p/?LinkId=227966 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 |
-Interface
Specifies an array of names of router interfaces. The cmdlet adds the static routes from these interfaces to 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. The cmdlet adds the routing information for the network prefixes to the BGP routing table.
Type: | String[] |
Aliases: | DestinationNetwork |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
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.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RoutingDomain
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.
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 |