Edit

Share via


Add-BgpPeer

Adds a new BGP peer.

Syntax

Default (Default)

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

Description

The Add-BgpPeer cmdlet adds a new peer to the Border Gateway Protocol (BGP router). This cmdlet returns error information if errors occur while adding the peer configuration.

Examples

Example 1: Add a BGP peer to the BGP router and establish a session

PS C:\>Add-BgpPeer -Name "RedTenantSite1" -LocalIPAddress 192.168.1.10 -PeerIPAddress 14.1.1.10 -PeerASN 64512 -PassThru

PeerName            LocalIPAddress      PeerIPAddress       PeerASN             OperationMode       ConnectivityStatus
--------            --------------      -------------       -------             -------------       ------------------
RedTenantSite1      192.168.1.10        14.1.1.10           64512               Mixed               Connecting

This command adds a BGP peer to the BGP router and automatically starts establishing BGP peering session with that neighbor.

Example 2: Add a BGP peer to a BGP router that will listen for incoming connections

PS C:\>Add-BgpPeer -Name "RedTenantSite1" -LocalIPAddress 192.168.1.10 -PeerIPAddress 14.1.1.10 -PeerASN 64512  -OperationMode Server -PeeringMode Manual -PassThru
PeerName            LocalIPAddress      PeerIPAddress       PeerASN             OperationMode       ConnectivityStatus
--------            --------------      -------------       -------             -------------       ------------------
RedTenantSite1      192.168.1.10        14.1.1.10           64512               Server              Stopped

This command adds a new BGP Peer to the BGP router which will listen for incoming connections from neighbor. PeeringMode is set to Manual, so unless this peering is started manually, the incoming connections requests will be dropped.

Example 3: Add a BGP peer to a BGP router of a specified routing ___domain

PS C:\>Add-BgpPeer -RoutingDomain Rd_001 -Name BlueTenant1 -LocalIPAddress 14.1.1.10 -PeerIPAddress 192.168.1.2 -PeerASN 64513 -PassThru
PeerName            LocalIPAddress      PeerIPAddress       PeerASN             OperationMode       ConnectivityStatus
--------            --------------      -------------       -------             -------------       ------------------
BlueTenant1         14.1.1.10           192.168.1.2         64513               Mixed               Connecting

This command adds a new BGP Peer to the BGP Router of the specified routing ___domain in Multi-tenant environment and automatically starts establishing BGP peering session.

Example 4: Add a Route Reflector client BGP peer to a BGP router

PS C:\>Add-BgpPeer -Name RRClient1 -LocalIPAddress 14.1.1.10 -PeerIPAddress 192.168.1.2 -PeerASN 64513 -PassThru -RouteReflectorClient $true
PeerName            LocalIPAddress      PeerIPAddress       PeerASN             OperationMode       ConnectivityStatus
--------            --------------      -------------       -------             -------------       ------------------
RRClient1           14.1.1.10           192.168.1.2         64513               Mixed               Connected

This command adds a new Route Reflector client BGP Peer to the BGP Router and automatically starts establishing BGP peering session.

Parameters

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Session

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-HoldTimeSec

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

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IdleHoldTimeSec

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

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-LocalASN

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

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-LocalIPAddress

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

Parameter properties

Type:IPAddress
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-MaxAllowedPrefix

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

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Specifies the unique name for the peering with specified BGP neighbor.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:PeerName, PeerId

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-OperationMode

Specifies the BGP Router's mode of operation. Operating modes include:

  • Peering Initiator as well as peering acceptor
  • Only acting as a passive peering request acceptor.

Parameter properties

Type:OperationMode
Default value:None
Accepted values:Mixed, Server
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PassThru

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PeerASN

Specifies the neighbor BGP Router's AS Number.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PeeringMode

Specifies the parameter to configure peering mode for the given peer.

Parameter properties

Type:PeeringMode
Default value:None
Accepted values:Automatic, Manual
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PeerIPAddress

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

Parameter properties

Type:IPAddress
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-RouteReflectorClient

Specifies whether the current peer is a Route Reflector client peer or non-client peer.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-RoutingDomain

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RoutingDomainName

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Weight

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

Parameter properties

Type:UInt16
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

IPAddress

Nullable<T>

UInt32

Microsoft.PowerShell.Cmdletization.GeneratedTypes.Bgp.OperationMode

Microsoft.PowerShell.Cmdletization.GeneratedTypes.Bgp.PeeringMode

UInt16

Nullable<T>

Outputs

CimInstance

CimInstance