Hi,
BGP is an application-layer protocol, and the TCP port number is 179. Therefore, No matter whether the interfaces are physical or loopback, or across multiple devices, as long as the routes between the two interfaces are reachable, the BGP peer relationship can be established.
The source and destination IP addresses in the BGP packets sent by the two ends must correspond.
The peer address is specified using the peer xx.xx.xx.xx as-number xx command.
The local address is specified using the peer connect-interface command.
By default, the local address is the outbound physical interface.
So if the local side using the physical interface and the peer side using the loopback interface, The peer side should specify the interface for sending BGP packets as the loopback interface.
local:
#
bgp 100
peer 2.2.2.2 as-number 100 // assume 2.2.2.2 is the loopback address of the peer
#
peer:
#
bgp 100
peer 10.0.12.1 as-number 100 //assume 10.0.12.1/10.0.12.2 is the connect ip address.
peer 10.0.12.1 connect-interface LoopBack0
#