Documentation

networkaddindex

Name

bgp router add peer -  add a new neighbor to a BGP router

Synopsis

peer <as-num> <addr> 

Arguments

as-num
ASN of the new neighbor
addr
IP address of the new neighbor

Description

This command adds a new neighbor to one BGP router. The new neighbor has the address addr and belongs to the domain with ASN as-num. This command also configures for this neighbor default input and output filters that will accept any route. See the bgp router peer filter for more information about the route filters.

The following example illustrates how to declare an internal (iBGP) session between two routers. The bgp add router is used to declare both routers in AS1. The add peer command is used to declare the BGP neighbors. On router 1.0.0.1, the command declares neighbor 1.0.0.2 in AS1. There is no explicit mention that it is an iBGP session. This is derived from the fact that the local router and the neighbor are in the same AS.

bgp add router 1 1.0.0.1
bgp router 1.0.0.1
  add peer 1 1.0.0.2
  peer 1.0.0.2 up
  exit

bgp add router 1 1.0.0.2
bgp router 1.0.0.2
  add peer 1 1.0.0.1
  peer 1.0.0.1 up
  exit