Configure basic BGP on Cisco router
From Notes_Wiki
Home > Switch configuration notes > Configure basic BGP on Cisco router
As such BGP is quite vast and complex topic. However, we can get simple BGP configuration done on a Cisco router such as Cisco CSR V1000 virtual router for sending and receiving routes via BGP. To do that use following steps:
- Login into router via console / ssh. Go to enable mode and enter enable password ('enable'), if required. Go to configure terminal
- config t
- Decide AS number to be used for BGP. We can use AS in range 64512 to 65534 for private purposes. Hence we can start from 65000 and use a few AS numbers as per requirement.
- Configure BGP with chosen AS number:
- router bgp 65000
- where 65000 is the AS number to be used in current BGP configuration
- Give a router-ID (We can use unique largest IPv4 interface IP of router to avoid conflicts with other routers)
- bgp router-id 10.1.6.1
- where 10.1.6.1 is unique router-id for this router
- Configure address family with route-redistribution and networks
- address-family ipv4 unicast
- network 0.0.0.0 mask 0.0.0.0
- redistribute static
- redistribute connected
- exit
- Here we are configuring ipv4 unicast based BGP router. This router will advertize default-route 0.0.0.0/0 to its peer because of 'network 0.0.0.0' line. This router will also advertize all static and connected routes to its neighbors
- Define neighbor routers along with their AS numbers for BGP communication
- neighbor 10.1.5.2 remote-as 65000
- neighbor 10.1.5.3 remote-as 65000
- neighbor 10.1.6.2 remote-as 65000
- neighbor 10.1.6.3 remote-as 65000
- where 10.1.5.2, 10.1.5.3, etc. are BGP routers in same AS 65000 where we want BGP connection to be established for routing table exchange.
- We can check status of BGP via various show commands:
- show bgp all
- show bgp ipv4 unicast summary
- show bgp ipv4 unicast neighbors
- show bgp ipv4 unicast nexthops
- show bgp ipv4 received-paths
Refer:
- https://networklessons.com/bgp/bgp-private-and-public-as-range
- https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus6000/sw/unicast/6_x/cisco_n6k_layer3_ucast_cfg_rel_602_N2_1/l3_bgp.html
- https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_bgp/configuration/xe-16/irg-xe-16-book/bgp-multi-paths-redistribute.html
- https://community.cisco.com/t5/networking-documents/how-to-configure-bgp-to-send-the-default-route-to-a-neighbor/ta-p/3131059
Home > Switch configuration notes > Configure basic BGP on Cisco router