Set-BgpPeer

Modifies BGP configuration.

Syntax

Set-BgpPeer
   [-Name] <String>
   [-LocalIPAddress <IPAddress>]
   [-PeerIPAddress <IPAddress>]
   [-LocalASN <UInt32>]
   [-PeerASN <UInt32>]
   [-OperationMode <OperationMode>]
   [-PeeringMode <PeeringMode>]
   [-HoldTimeSec <UInt16>]
   [-IdleHoldTimeSec <UInt16>]
   [-MaxAllowedPrefix <UInt32>]
   [-RoutingDomain <String>]
   [-PassThru]
   [-Force]
   [-ClearPrefixLimit]
   [-Weight <UInt16>]
   [-CimSession <CimSession[]>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-BgpPeer cmdlet modifies peer configuration for Border Gateway Protocol (BGP) routers. Specify a peer to modify by using its name. You can modify the following configuration settings:

  • Autonomous system number (ASN) for the local and peer router instances
  • IP address of the local and peer router instances
  • Maximum number of network prefixes that the local router instance can learn from this peer, or you can remove limit
  • Preference assigned to routes received from this peer
  • Operation mode and peering mode
  • Hold time, in seconds

Examples

Example 1: Change the peering mode to Automatic

PS C:\> Set-BgpPeer -Name "TenantSite17" -Force -PeeringMode Automatic -PassThru
PeerName            LocalIPAddress      PeerIPAddress       PeerASN             OperationMode       ConnectivityStatus
--------            --------------      -------------       -------             -------------       ------------------
TenantSite17        192.168.1.10        10.1.1.10           64512               Server              Connecting

This command changes the peering mode of the peer named TenantSite17 to Automatic. The command includes the PassThru parameter, so it passes a BgpPeerConfig object to the console. Because the command includes the Force parameter, it does not prompt you for confirmation.

Example 2: Modify settings for a peer

PS C:\> Set-BgpPeer -Name "TenantSite17" -OperationMode Mixed -PeeringMode Automatic -PassThru
Confirm
BGP peering session is active for peer RedTenantSite1. Do you want to apply settings and restart peering?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): y

PeerName            LocalIPAddress      PeerIPAddress       PeerASN             OperationMode       ConnectivityStatus
--------            --------------      -------------       -------             -------------       ------------------
TenantSite17        192.168.1.10        10.1.1.10           64512               Mixed               Connecting

This command modifies the operation mode and the peering mode of the peer named TenantSite17. The command includes the PassThru parameter, so it passes a BgpPeerConfig object to the console. Because the command does not include the Force parameter, it prompts you for confirmation.

Example 3: Modify the ASN of a peer

PS C:\> Set-BgpPeer -Name "Tenant17" -PassThru -PeerASN 64515 -RoutingDomain "Rd002" -PassThru 
Confirm
BGP peering session is active for Tenant17 for routing domain Rd002. Do you want to apply settings and restart
peering?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):

PeerName            LocalIPAddress      PeerIPAddress       PeerASN             OperationMode       ConnectivityStatus
--------            --------------      -------------       -------             -------------       ------------------
Tenant17            10.1.1.10           192.168.1.2         64515               Mixed               Connecting

This command modifies the ASN of the peer named TenantSite17 in the routing domain Rd002. The command includes the PassThru parameter, so it passes a BgpPeerConfig object to the console. Because the command does not include the Force parameter, it prompts you for confirmation.

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

-ClearPrefixLimit

Indicates that the cmdlet removes the limit on the number of network prefixes learned from the peer. Specify a limit by using the MaxAllowedPrefix parameter. You cannot specify both the MaxAllowedPrefix parameter and the ClearPrefixLimit parameter.

Type:SwitchParameter
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

-HoldTimeSec

Specifies the hold time, in seconds. If this computer does not receive any messages from the peer within this time, the session expires.

Type:UInt16
Position:Named
Default value:180
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-IdleHoldTimeSec

Specifies the time in seconds for which the BGP Peer stays in an idle state after an unsuccessful peer connection attempt.

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

-LocalASN

Specifies the ASN for the local router.

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

-LocalIPAddress

Specifies the IP address that the local router uses for the peer connection.

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

-MaxAllowedPrefix

Specifies the maximum number of network prefixes that this router learns from its peer. To remove this limit, specify the ClearPrefixLimit parameter. You cannot specify both the MaxAllowedPrefix parameter and the ClearPrefixLimit parameter.

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

-Name

Specifies a name. The cmdlet modifies settings for the named peer.

Type:String
Aliases:PeerId, PeerName
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-OperationMode

Specifies the BGP router mode of operation. The acceptable values for this parameter are:

  • Mixed. The peer both initiates and accepts requests.
  • Server. The peer only accepts requests.
Type:OperationMode
Accepted values:Mixed, Server
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

-PeerASN

Specifies the ASN for the peer.

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

-PeeringMode

Specifies the peering mode for the peer. The acceptable values for this parameter are:

  • Automatic. Starts peering attempts automatically when added.
  • Manual. Starts peering attempts after you start the session by using the Start-BgpPeer cmdlet.
Type:PeeringMode
Accepted values:Automatic, Manual
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PeerIPAddress

Specifies the IP address of the peer.

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

-RoutingDomain

Specifies the name of the routing domain as a string. The name is a unique, for the multitenant gateway, 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

-Weight

Specifies the preference, as an integer, assigned to routes received from this peer. Higher values have higher priority.

Type:UInt16
Position:Named
Default value:None
Required:False
Accept pipeline input:True
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

Outputs

CimInstance