Configuring BGP (Border Gateway Protocol) is a core requirement for the CCNA. Unlike IGP protocols like OSPF or EIGRP, BGP is designed to exchange routing information between different Autonomous Systems (AS).
Here is a standard configuration example for a Basic EBGP (External BGP) peering session between two routers.
Network Topology
Router 1 (AS 100): IP
1.1.1.1on interface G0/0Router 2 (AS 200): IP
1.1.1.2on interface G0/0
1. Router 1 Configuration (AS 100)
On Router 1, you define the local AS number and identify the neighbor's IP and their AS number.
R1(config)# router bgp 100
R1(config-router)# neighbor 1.1.1.2 remote-as 200
R1(config-router)# network 10.10.10.0 mask 255.255.255.0
router bgp 100: Starts the BGP process for AS 100.
neighbor 1.1.1.2 remote-as 200: Defines the peer. Since the remote AS (200) is different from the local AS (100), this is EBGP.
network: This command tells BGP to advertise the
10.10.10.0/24subnet. Note: This network must already exist in the router's routing table (via static route or connected interface) for BGP to advertise it.
2. Router 2 Configuration (AS 200)
Router 2 must have a reciprocal configuration pointing back to Router 1.
R2(config)# router bgp 200
R2(config-router)# neighbor 1.1.1.1 remote-as 100
R2(config-router)# network 192.168.1.0 mask 255.255.255.0
3. Verification Commands
Once configured, use these three primary commands to verify the BGP state:
show ip bgp summary: The most important command. Look at theState/PfxRcdcolumn. If it shows a number (e.g., 1), the session is up. If it saysActiveorIdle, the session is down.show ip bgp: Shows the BGP table (all paths learned via BGP).show ip route bgp: Shows only the best BGP paths that have been installed into the main routing table.
Key CCNA Tips for BGP
BGP Split Horizon: In IBGP (Internal BGP), a router will not advertise a route learned from an IBGP peer to another IBGP peer to prevent loops.
Next-Hop Self: When passing EBGP routes into an IBGP network, routers often need the command
neighbor [IP] next-hop-selfbecause the next-hop IP doesn't change by default when moving between AS boundaries.Administrative Distance: EBGP has an AD of 20, while IBGP has an AD of 200.
No comments:
Post a Comment