Enable BGP routing
Enable BGP routing and establish BGP neighbor relationships to control route exchange in your network.
Configure BGP on your router to participate in inter-domain routing. You must define route policies and associate address families with each neighbor to control which routes are exchanged. This is essential for both internal BGP (iBGP) and eBGP peering.
Before you begin
-
Ensure your BGP router has a router identifier, such as a configured loopback address.
-
Configure at least one address family within the BGP router configuration, and explicitly configure the same address family under each BGP neighbor configuration.
-
For an external BGP (eBGP) neighbor:
-
Configure both inbound and outbound route policies on the neighbor using theroute-policy command, or
-
Allow route exchange for all eBGP neighbors by using the bgp unsafe-ebgp-policy command.
-
-
If peering with eBGP neighbors that are not directly connected:
-
Note that, by default, BGP checks for direct connectivity and does not establish a connection if peers are not directly connected.
-
Use the ignore-connected-check command to enable peering between loopback interfaces of non-directly connected routers. Set the TTL value to 1 when using this command.
-
Configure the egp-multihop command for eBGP peers separated by intermediate routers, setting the TTL value to at least the number of hops between peers (for example, use TTL 3 for two intermediate hops).
-
Procedure
|
Step 1 |
Define a route policy to control routing behavior. Example:
|
|
Step 2 |
Enter BGP configuration mode. Configure the router ID, and specify the address family to define the type of routes BGP will handle, such as IPv4 or IPv6 unicast. Example:
|
|
Step 3 |
Configure a BGP neighbor with an IP address, assign a remote AS number, and associate an address family. Optionally, configure route policies to control which routes are exchanged. Example:
|
BGP routing is enabled. The router can now establish BGP neighbor relationships and exchange routing information as configured.
Example
Sample configuration to enable BGP:
route-policy pass-all
pass
end-policy
route-policy set_next_hop_agg_v4
set next-hop 10.0.0.1
end-policy
route-policy set_next_hop_static_v4
if (destination in static) then
set next-hop 10.1.0.1
else
drop
endif
end-policy
route-policy set_next_hop_agg_v6
set next-hop 2001:DB8::121
end-policy
route-policy set_next_hop_static_v6
if (destination in static) then
set next-hop 2001:DB8::201 else
drop
endif
end-policy
router bgp 65000
bgp fast-external-fallover disable
bgp confederation peers 65001 65002
bgp confederation identifier 1
bgp router-id 10.1.1.1
address-family ipv4 unicast
aggregate-address 10.2.0.0/24 route-policy
set_next_hop_agg_v4
aggregate-address 10.3.0.0/24
redistribute static route-policy
set_next_hop_static_v4
address-family ipv6 unicast
aggregate-address 2001:DB8:2::/32 route-policy
set_next_hop_agg_v6
aggregate-address 2001:DB8:3::/32
redistribute static route-policy
set_next_hop_static_v6
neighbor 10.0.101.60
remote-as 65000
address-family ipv4 unicast
neighbor 10.0.101.61
remote-as 65000
address-family ipv4 unicast
neighbor 10.0.101.62
remote-as 3
address-family ipv4 unicast
route-policy pass-all in
route-policy pass-all out
neighbor 10.0.101.64
remote-as 5
update-source Loopback0
address-family ipv4 unicast
route-policy pass-all in
route-policy pass-all out
What to do next
Verify BGP neighbor relationships and route exchange using the show bgp summary command.
Feedback