# Stuck in Active = TCP can't reach peer. Check:
# 1. IP reachability (can you ping the peer IP?)
# 2. Firewall blocking TCP port 179
# 3. Correct neighbor IP configured
# 4. TTL — eBGP requires TTL=1 by default (use ebgp-multihop if needed)
OPEN Sent after TCP — negotiates BGP version, AS, hold time, Router ID
KEEPALIVE Sent every ~60s to maintain session (hold timer default 180s)
UPDATE Advertises new routes or withdraws old ones — carries path attributes
NOTIFICATION Sent on error — includes error code and closes session| Attribute | Type | Description & Manipulation |
|---|---|---|
| WEIGHT | Cisco Local | Cisco-only. Highest preferred. Set per-neighbor. Not advertised. |
| LOCAL_PREF | Well-known | Higher = preferred. Shared within iBGP AS. Controls egress path. |
| AS_PATH | Well-known | List of ASes route has traversed. Shorter = preferred. Used for loop prevention. |
| ORIGIN | Well-known | IGP (i) > EGP (e) > Incomplete (?). How route entered BGP. |
| MED | Optional | Multi-Exit Discriminator. Lower = preferred. Influences inbound traffic from neighbour AS. |
| NEXT_HOP | Well-known | IP address of next hop router. Must be reachable. |
| COMMUNITY | Optional | Tag routes for policy. Common: NO_EXPORT (65535:65281), NO_ADVERTISE (65535:65282). |
| ATOMIC_AGGR | Well-known | Indicates route has been aggregated — path info may be lost. |
1. Highest WEIGHT (Cisco only)
2. Highest LOCAL_PREF
3. Locally originated route preferred
4. Shortest AS_PATH
5. Lowest ORIGIN (IGP < EGP < Incomplete)
6. Lowest MED
7. eBGP over iBGP
8. Lowest IGP metric to NEXT_HOP
9. Oldest eBGP route
10. Lowest Router ID
11. Lowest neighbor IP addressBasic eBGP peering configuration:
router bgp 65001
bgp router-id 1.1.1.1
neighbor 203.0.113.1 remote-as 65002
neighbor 203.0.113.1 description ISP-PEER
network 192.168.1.0 mask 255.255.255.0
no auto-summaryiBGP with route reflector:
router bgp 65001
neighbor 10.0.0.2 remote-as 65001
neighbor 10.0.0.2 route-reflector-client
neighbor 10.0.0.2 next-hop-selfshow ip bgp summary # peer states and prefix counts
show ip bgp # full BGP table
show ip bgp 192.168.1.0 # specific prefix detail
show ip bgp neighbors # detailed neighbor info
show ip bgp neighbors 203.0.113.1 routes # routes from specific peer
show ip route bgp # BGP routes in RIB
show ip bgp regexp _65002_ # routes via AS 65002
clear ip bgp * soft # soft reset all peers
debug ip bgp # BGP debug (use carefully)
show ip ospf neighbor # OSPF neighbors
show ip ospf database # OSPF LSDB
show ip route ospf # OSPF routes
show ip eigrp neighbors # EIGRP neighbors
show ip eigrp topology # EIGRP topology table# Edit mode
set routing-options autonomous-system 65001
set protocols bgp group EBGP type external
set protocols bgp group EBGP peer-as 65002
set protocols bgp group EBGP neighbor 203.0.113.1
set protocols bgp group EBGP export EXPORT-POLICY
commitshow bgp summary # peer states
show bgp neighbor # detailed neighbor
show route protocol bgp # BGP routes in RIB
show route 192.168.1.0/24 detail # prefix detail
show route receive-protocol bgp 203.0.113.1 # routes received
show route advertising-protocol bgp 203.0.113.1 # routes sent
clear bgp neighbor 203.0.113.1 soft # soft reset
show ospf neighbor # OSPF neighbors
show ospf database # OSPF LSDB
show route protocol ospf # OSPF routes# OSPF Neighbor States
Down → No hellos received
Init → Hello received, but router's own ID not in hello
2-Way → Bidirectional communication (DR/BDR election happens here)
ExStart → Master/slave election for DBD exchange
Exchange → DBD packets being exchanged
Loading → LSR/LSU packets exchanged
Full → ✓ Fully adjacent — LSDB synchronized# Cisco OSPF basic config
router ospf 1
router-id 1.1.1.1
network 192.168.1.0 0.0.0.255 area 0
passive-interface GigabitEthernet0/1 # don't send hellos on LAN
# OSPF area types
Area 0 Backbone — all other areas must connect here
Stub No external LSAs — uses default route instead
NSSA Stub but allows limited external routes (Type 7 LSA)
Totally Stub No inter-area or external LSAs| Protocol | Type | Algorithm | Metric | Best For |
|---|---|---|---|---|
| BGP | Path Vector | Best Path Selection | Path Attributes | Internet routing, multi-homing, large enterprise |
| OSPF | Link State | Dijkstra (SPF) | Cost (bandwidth) | Enterprise IGP, fast convergence, scalable |
| EIGRP | Advanced D-V | DUAL | Bandwidth + Delay | Cisco-only shops, easy config, fast failover |
| RIP v2 | Distance Vector | Bellman-Ford | Hop count (max 15) | Small/legacy networks only |
| IS-IS | Link State | Dijkstra (SPF) | Cost | ISP/carrier networks, large scale |
| Static | Manual | — | Administrative | Simple topologies, last-resort routes |
Connected 0 (most trusted)
Static 1
eBGP 20
EIGRP 90
OSPF 110
IS-IS 115
RIP 120
iBGP 200 (least trusted)