Set-BgpPeer

Updates the configuration of the specified BGP peer.

Syntax

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

Description

The Set-BgpPeer cmdlet updates the Border Gateway Protocol (BGP) peer configuration. This cmdlet returns error information if errors occur while modifying the BGP peer configuration.

Examples

Example 1: Update the BGP peer configuration for the specified neighbor

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

This command updates and modifies the BGP peer configuration for the specified neighbor.

Example 2: Update and modify the BGP peer configuration and prompt the user for confirmation

PS C:\>Set-BgpPeer -Name "TenantSite1" -OperationMode Mixed -PeeringMode Automatic -PassThru
Confirm
BGP peering session is active for peer TenantSite1. 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
--------            --------------      -------------       -------             -------------       ------------------
TenantSite1      192.168.1.10        10.1.1.10           64512               Mixed               Connecting

This command prompts the user for confirmation and upon confirmation, updates and modifies the BGP peer configuration for the specified neighbor, which is active.

Example 3: Update and modify the BGP peer configuration for the specified neighbor

PS C:\>Set-BgpPeer -RoutingDomain "Rd_002" -Name "Tenant1" -PeerASN 64515  -PassThru
Confirm
BGP peering session is active for RedTenant1 for routing domain Rd_002. 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
--------            --------------      -------------       -------             -------------       ------------------
Tenant1          14.1.1.10           192.168.1.2         64515               Mixed               Connecting

This command prompts the user for confirmation and upon confirmation, updates and modifies the BGP peer configuration for the specified neighbor of a specified routing domain in multi-tenant environment.

Required Parameters

-Name

Specifies the peer name for which the configuration is to be modified.

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

Optional 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
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
Accept pipeline input:False
Accept wildcard characters:False
-ClearPrefixLimit

Indicates that the cmdlet clears the maximum limit on prefixes learned from the peer. The cmdlet will reset the prefix learning to an unlimited number.

Type:SwitchParameter
Position:Named
Default value:None
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
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
Accept pipeline input:False
Accept wildcard characters:False
-HoldTimeSec

Specifies the configured value of the HoldTime parameter in seconds after which the BGP Session expires if no BGP message is received.

Type:UInt16
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-IdleHoldTimeSec

Specifies the configured value of the IdleHoldTime in seconds after which the BGP Session expires if no BGP message is received.

Type:UInt16
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-LocalASN

Specifies the local autonomous systems (AS) number of the BGP Router instance for this peer.

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-LocalIPAddress

Specifies the local BGP router's peering IP address. It can be of IPv4 or IPv6 address type.

Type:IPAddress
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-MaxAllowedPrefix

Specifies the maximum number of allowed IPv4 or IPv6 network prefixes that can be learned from the given neighbor.

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-OperationMode

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

  • Peering Initiator as well as peering acceptor
  • Only acting as a passive peering request acceptor.
Type:OperationMode
Parameter Sets:Mixed, Server
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.

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

Specifies the neighbor BGP router's AS number.

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PeerIPAddress

Specifies the neighbor BGP router's peering IP address. Acceptable values are an IPv4 or IPv6 address type.

Type:IPAddress
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PeeringMode

Specifies a value to configure peering mode for the given peer. The acceptable values for this parameter are:

  • Automatic
  • Manual
Type:PeeringMode
Parameter Sets:Automatic, Manual
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-RouteReflectorClient

Specifies whether peer is a client peer or non-client peer.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-RoutingDomain

Specifies the user-defined unique alphanumeric identifier for the routing domain.

Type:String
Aliases:RoutingDomainName
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ThrottleLimit

Specifies the maximum number of concurrent connections that can be established to run this command. If you omit this parameter or enter a value of 0, the default value, 32, is used.

The throttle limit applies only to the current command, not to the session or to the computer.

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

Specifies administrative preference assigned to the routes received from this peer.

Type:UInt16
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
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
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.Management.Infrastructure.CimInstance#BgpPeerConfig