I have seen in my production network configurations of bgp in which sometimes I see both physical interface and loopback interfaces defined. Then sometimes the physical ip addresses are used neighbor <ip> remote-as instead of the loobpack addresses.
What's the best practice to use here? Should I define the neighbor command using physical IP, loopback IP or do both??
bgp router myas
description define loopback net
network 192.168.10.0 mask 255.255.255.0
description define physical interface net
network 10.0.0.0 mask 255.255.255.255
neighbor 10.0.0.1 remote-as yourAS
iBGP generally peers using the loopback address for the reasons mentioned by Mohamed (i.e. loopback interface always stays up therefore the iBGP session stays up as long as the IGP has a path to get to the loopback interface of the peer router).
eBGP commonly peers using the physical interface as there is generally only one path between the two eBGP peers. Although the loopback interface is sometimes used between eBGP peers to achieved load-balancing when more than one circuit link the two eBGP peers.
Hope this helps,
BGP uses the IP address configured on the physical interface directly connected to the BGP peer as the source address when it establishes the BGP peering session, by default. Issue the neighbor update-source command in order to change this behavior and configure the BGP that speaks to the router to establish peering with the use of a loopback address as the source address.
The use of a loopback interface ensures that the neighbor stays up and is not affected by malfunctioning hardware, the main benefit from using loopbacks is that it will not bring down the BGP session when there are multiple paths between the BGP peers, which would otherwise result in tearing down the BGP session if the physical interface used for establishing the session goes down. In addition to that, it also allows the routers running BGP with multiple links between them to load balance over the available paths.
Please check out this document:
HTH, please do rate all helpful replies,