What are the ways to configure the authentication for the BGP?

BGP (Border Gateway Protocol ) supports authentication using the md5 (message digest 5) algorithm. For authentication to be successful md5 authentication should be configured on both sides. When authentication is enabled when any TCP segment belonging to BGP exchanged between peers is accepted only if the authentication is successful.

router bgp 100
no synchronization
bgp log-neighbor-changes
neighbor 80.80.80.80 remote-as 100
neighbor 80.80.80.80 password cisco

BGP uses TCP authentication, which enables the authentication option and sends the MAC based on the cryptographic algorithm configured for the keychain. The routing protocols each support a different set of cryptographic algorithms, BGP supports only HMAC-MD5 and HMAC-SHA1-12

key chain key_A
key 1
cryptographic-algorithm [HMAC-MD5 | HMAC-SHA1-12 | HMAC-SHA1-20 | MD5 | SHA-1]

router bgp 140
neighbor 172.20.1.1
remote-as 1
keychain key_A
end
commit