12

Configuring BGP

It is very easy to bring BGP session minimum needs a configuration. Just three lines of icon_BGP.png BGP statement will bring BGP session.

Detecting and solving of a problem in time is very important. If BGP doesn’t work properly, just simplify BGP configuration. In most cases, it is the best decision.

Basic configuration

router bgp 65535
network z.z.z.0
neighbor y.y.y.y remote-as 65500
Cisco_Router(config)#router bgp 65535 <– your ASN 65535 in this example
Cisco_Router(config-router)#neighbor y.y.y.y remote-as KKKK ß BGP neighbors ASN, y.y.y.y is neighbor IP address
Cisco_Router(config-router)#network z.z.z.0 mask 255.255.255.0 ß BGP route that you want to announce to neighbor
** Do you need to specify BGP version 4 unless one of peer is using different version

MD5 configuration

After MD5 setup and install BGP, wait until time is expired. Sometime MD5 digest issue would be bumped.
router bgp 65535
network z.z.z.0
neighbor y.y.y.y remote-as 65500
neighbor y.y.y.y password <– MD5 will be encrypted after applied.
Cisco_Router(config)#router bgp 65535 <– your ASN 65535 in this example
Cisco_Router(config-router)#neighbor y.y.y.y remote-as KKKK <– BGP neighbors ASN, y.y.y.y is neighbor IP address
Cisco_Router(config-router)#network z.z.z.0 mask 255.255.255.0 <– BGP route that you want to announce to neighbor
Cisco_Router(config-router)#neighbor y.y.y.y password abcdefg <– MD5 password abcdefg in this case

Route-map filtering configuration

Using route-map, you can control in/outbound BGP announcement and apply various attributes
router bgp 65535
network z.z.z.0
neighbor y.y.y.y remote-as 65500
neighbor y.y.y.y route-map ISP-out out
route-map ISP-out permit 10
match ip address 100
set as-path prepend 65535 65535 65535 65535
access-list 100 permit z.z.z.0 0.0.0.255
Cisco_Router(config)#router bgp 65535 <– your ASN 65535 in this example
Cisco_Router(config-router)#neighbor y.y.y.y remote-as KKKK <– BGP neighbors ASN, y.y.y.y is neighbor IP address
Cisco_Router(config-router)#network z.z.z.0 mask 255.255.255.0 <– BGP route that you want to announce to neighbor
Cisco_Router(config-router)#network y.y.y.y route-map ISP-out out <– BGP route-map is applied on outbound

BGP Filter-list configuration

It provides different kinds of filtering
router bgp 65535
network z.z.z.0
neighbor y.y.y.y remote-as 65500
neighbor y.y.y.y filter-list 200 in
ip as-path access-list 200 permit _7777$ <– Only allow BGP route on the path ASN started with 7777
Cisco_Router(config)#router bgp 65535 <– your ASN 65535 in this example
Cisco_Router(config-router)#neighbor y.y.y.y remote-as KKKK <– BGP neighbors ASN, y.y.y.y is neighbor IP address
Cisco_Router(config-router)#network z.z.z.0 mask 255.255.255.0 <– BGP route that you want to announce to neighbor
Cisco_Router(config-router)#network y.y.y.y filter-list 200 in <– BGP filter-list is applied on inbound