BGP路由查询

BGP路由查询方法和常用命令参考,帮助网络工程师排查路由问题

🔍 Cisco IOS 常用BGP命令
# 查看BGP路由表中的特定前缀 show ip bgp 203.0.113.0/24 # 查看BGP邻居状态 show ip bgp summary # 查看特定邻居的路由 show ip bgp neighbors 10.0.0.1 routes # 查看向特定邻居通告的路由 show ip bgp neighbors 10.0.0.1 advertised-routes # 查看BGP路由详细信息 show ip bgp 203.0.113.0/24 longer-prefixes
🔧 Juniper JunOS 常用BGP命令
# 查看BGP路由表 show route table inet.0 203.0.113.0/24 # 查看BGP邻居状态 show bgp summary # 查看特定邻居接收的路由 show route receive-protocol bgp 10.0.0.1 # 查看向特定邻居通告的路由 show route advertising-protocol bgp 10.0.0.1 # 查看BGP路由详细信息 show route 203.0.113.0/24 detail
🐧 Linux (Bird/FRR) 常用命令
# Bird: 查看BGP路由 birdc show route 203.0.113.0/24 # Bird: 查看BGP协议状态 birdc show protocols all # FRR (vtysh): 查看BGP路由 vtysh -c "show ip bgp 203.0.113.0/24" # FRR: 查看BGP邻居 vtysh -c "show ip bgp summary"
🌐 在线BGP Looking Glass 资源

HE.NET BGP Looking Glass

Hurricane Electric 提供的全球BGP路由查询工具

lg.he.net

RouteViews

University of Oregon 的BGP路由采集项目

routeviews.org

BGP.Tools

实时BGP路由和AS路径分析

bgp.tools

BGPlay (RIPE)

RIPE NCC 提供的BGP路由变化可视化工具

stat.ripe.net

RIPE RIS

RIPE Routing Information Service,全球BGP路由监测

ris.ripe.net

ISC BGP Looking Glass

Internet Systems Consortium 的Looking Glass

lg.isc.org
📖 BGP属性说明

AS_PATH — 路由经过的AS序列,用于防环和路径选择

NEXT_HOP — 下一跳IP地址,BGP路由递归查找的依据

LOCAL_PREF — 本地优先级,影响出站流量路径选择(值越大越优先)

MED — 多出口鉴别器,影响入站流量路径选择(值越小越优先)

COMMUNITY — 团体属性,用于路由策略标记和过滤

ORIGIN — 路由来源:IGP(i) > EGP(e) > Incomplete(?)