Add-BgpCustomRoute

Add-BgpCustomRoute

Adds custom routes to the BGP routing table.

Syntaxe

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

Description détaillée

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.

Paramètres

-AsJob

Alias

none

Obligatoire ?

false

Position ?

named

Valeur par défaut

none

Accepter l’entrée de pipeline ?

false

Accepter les caractères génériques ?

false

-CimSession<CimSession[]>

Exécute l’applet de commande dans une session à distance ou sur un ordinateur distant. Entrez un nom d’ordinateur ou un objet de session, comme la sortie d’une applet de commande New-CimSession ou Get-CimSession. La valeur par défaut est la session active sur l’ordinateur local.

Alias

Session

Obligatoire ?

false

Position ?

named

Valeur par défaut

none

Accepter l’entrée de pipeline ?

false

Accepter les caractères génériques ?

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.

Alias

none

Obligatoire ?

false

Position ?

named

Valeur par défaut

none

Accepter l’entrée de pipeline ?

True (ByPropertyName)

Accepter les caractères génériques ?

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.

Alias

DestinationNetwork

Obligatoire ?

false

Position ?

named

Valeur par défaut

none

Accepter l’entrée de pipeline ?

True (ByPropertyName)

Accepter les caractères génériques ?

false

-PassThru

Retourne un objet qui représente l’élément avec lequel vous travaillez. Par défaut, cette applet de commande ne génère aucun résultat.

Alias

none

Obligatoire ?

false

Position ?

named

Valeur par défaut

none

Accepter l’entrée de pipeline ?

false

Accepter les caractères génériques ?

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.

Alias

RoutingDomainName

Obligatoire ?

false

Position ?

named

Valeur par défaut

none

Accepter l’entrée de pipeline ?

True (ByPropertyName)

Accepter les caractères génériques ?

false

-ThrottleLimit<Int32>

Spécifie le nombre maximal d’opérations simultanées qui peuvent être établies pour exécuter cette applet de commande. Si ce paramètre est omis ou si la valeur 0 est entrée, Windows PowerShell ® calcule une limitation optimale pour l’applet de commande en fonction du nombre d’applets de commande CIM qui s’exécutent sur l’ordinateur. La limitation s’applique seulement à l’applet de commande actuelle, et non pas à la session ni à l’ordinateur.

Alias

none

Obligatoire ?

false

Position ?

named

Valeur par défaut

none

Accepter l’entrée de pipeline ?

false

Accepter les caractères génériques ?

false

<CommonParameters>

Cette applet de commande prend en charge les paramètres courants : -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer et -OutVariable. Pour plus d’informations, consultez about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entrées

Le type d’entrée correspond au type des objets que vous pouvez transmettre à l’applet de commande.

Sorties

Le type de sortie est le type des objets émis par l’applet de commande.

  • Microsoft.Management.Infrastructure.CimInstance#BgpCustomNetworkInfo

Exemples

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

Rubriques connexes

Get-BgpCustomRoute

Remove-BgpCustomRoute