BGP 路由反射实验
source link: http://www.dengfm.com/15258675843908.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
BGP 路由反射实验
图 1-1
- 按照图示配置 IP 地址,R2,R3,R4,R5 配置 Loopback0口作为 OPSF 的 Router-id 和 IBGP 邻居地址,地址格式为
X.X.X.X/32
,X 为设备编号。R1,R3,R5 各自配置 2 个 Loopback 口模拟业务网段 - AS 200 内部配置 OSPF,仅用于实现 BGP 的 TCP 可达,不允许宣告业务网段
- R1 和 R2 建立 EBGP 邻居,R2 使用对等体组与 R3/R4/R5 建立 IBGP 邻居
- R2 配置为 R3,R4 和 R5 的反射器,Cluster_id 为 2001
- R1,R3,R5 把业务网段宣告进 BGP
- 全网不允许出现业务网段的明细路由(直连除外)
配置 IP 地址部分略
配置 OSPF 部分略
R1 和 R2 建立 EBGP 邻居,R2 使用对等体组与 R3/R4/R5 建立 IBGP 邻居
分析:要求 R2 使用对等体组与 R3/R4/R5 建立 IBGP 邻居,意味着需要在 R2 上创建 IBGP 对等体组,并把 R3/R4/R5 加入组,同时,R3/R4/R5 只需要与 R2 建立 IBGP 邻居即可
步骤 1:在 R2 创建 IBGP 对等体组,并把 R3/R4/R5 加入到对等体组
[R2]bgp 200 [R2-bgp-default]group in internal [R2-bgp-default]peer 3.3.3.3 group in [R2-bgp-default]peer 4.4.4.4 group in [R2-bgp-default]peer 5.5.5.5 group in
步骤 2:直接对对等体组配置更新源、启用邻居、更改下一跳为本机
[R2-bgp-default]peer in connect-interface LoopBack0 [R2-bgp-default]address-family ipv4 unicast [R2-bgp-default-ipv4]peer in enable [R2-bgp-default-ipv4]peer in next-hop-local
其他路由器 BGP 基础配置略
R2 配置为 R3,R4 和 R5 的反射器,Cluster_id 为 2001
分析:上一步已经在 R2 上把 R3,R4,R5 加入了同一个对等体组,所以配置为反射器,只需要在对等体组上配置即可
步骤 1:在 R2 上对对等体组配置为路由反射器[R2-bgp-default-ipv4]peer in reflect-client
步骤 2:配置 R2 的 Cluster_id 为 2001
[R2-bgp-default-ipv4]reflector cluster-id 2001
R1,R3,R5 把业务网段宣告进 BGP
分析:正常情况下,由于存在 IBGP 防环机制,所以 R3 宣告的路由无法被 R4 和 R5 学习,R5 宣告的路由同样无法被 R3 和 R4 学习。但是上一步把 R2 配置为了路由反射器,就可以互相学习到各个业务网段路由
步骤 1:R1,R3,R5 把业务网段宣告进 BGP,步骤略效果测试:R3,R4,R5 上都能够学习到完整的业务网段路由
[R3]display bgp routing-table ipv4 Network NextHop MED LocPrf PrefVal Path/Ogn * >i 192.168.0.0 2.2.2.2 0 100 0 100i * >i 192.168.1.0 2.2.2.2 0 100 0 100i * > 192.168.2.0 192.168.2.1 0 32768 i * > 192.168.3.0 192.168.3.1 0 32768 i * >i 192.168.4.0 5.5.5.5 0 100 0 i * >i 192.168.5.0 5.5.5.5 0 100 0 i
[R4]display bgp routing-table ipv4 Network NextHop MED LocPrf PrefVal Path/Ogn * >i 192.168.0.0 2.2.2.2 0 100 0 100i * >i 192.168.1.0 2.2.2.2 0 100 0 100i * >i 192.168.2.0 3.3.3.3 0 100 0 i * >i 192.168.3.0 3.3.3.3 0 100 0 i * >i 192.168.4.0 5.5.5.5 0 100 0 i * >i 192.168.5.0 5.5.5.5 0 100 0 i
[R5]display bgp routing-table ipv4 Network NextHop MED LocPrf PrefVal Path/Ogn * >i 192.168.0.0 2.2.2.2 0 100 0 100i * >i 192.168.1.0 2.2.2.2 0 100 0 100i * >i 192.168.2.0 3.3.3.3 0 100 0 i * >i 192.168.3.0 3.3.3.3 0 100 0 i * > 192.168.4.0 192.168.4.1 0 32768 i * > 192.168.5.0 192.168.5.1 0 32768 i
全网不允许出现业务网段的明细路由(直连除外)
分析:全网不允许出现业务网段的明细路由,意味着要配置路由聚合。BGP 支持自动聚合和手动聚合,只有手动聚合才可以对 network 产生的路由进行聚合,所以这里需要配置手动聚合,并且不发布明细路由
步骤 1:在 R1,R3,R5 上对业务网段进行手动聚合,并不发布明细路由[R1-bgp-default-ipv4]aggregate 192.168.0.0 23 detail-suppressed
[R3-bgp-default-ipv4]aggregate 192.168.2.0 23 detail-suppressed
[R5-bgp-default-ipv4]aggregate 192.168.4.0 23 detail-suppressed
效果测试:各路由器上不再能够学习到明细路由,只能学习到聚合路由,步骤略
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK