CCIE学习笔记之BGP实验整理

本文详细记录了CCIE学习过程中关于BGP的实验,涵盖了基本配置、下一跳处理、路由聚合、路由选择策略、路由反射器以及联邦等关键知识点。通过不同拓扑配置,深入理解BGP在实际网络中的应用和配置技巧。
摘要由CSDN通过智能技术生成

#lab BGP1# 基本配置

实验拓扑:

配置:

R1-

interface Loopback0
 ip address 1.1.1.1 255.255.255.0
!
interface Serial1/0
 ip address 12.1.1.1 255.255.255.0
 serial restart-delay 0
!
interface Serial1/1
 ip address 13.1.1.1 255.255.255.0
 serial restart-delay 0
!
router ospf 110                      //AS内部使用OSPF路由协议
 router-id 1.1.1.1
 log-adjacency-changes
 network 1.1.1.0 0.0.0.255 area 0
 network 12.1.1.0 0.0.0.255 area 0
 network 13.1.1.0 0.0.0.255 area 0
!
router bgp 1
 no synchronization
 bgp router-id 1.1.1.1               //BGP的routerID
 bgp log-neighbor-changes
 neighbor J peer-group                  //BGP需要指邻居
 neighbor J remote-as 1             //邻居的AS号
 neighbor J update-source Loopback0               //更新源,如果不指定默认是包发送端口的IP
 neighbor 2.2.2.2 peer-group J           //调用上述建邻居模板
 neighbor 3.3.3.3 peer-group J          //调用模板
 no auto-summary
!
 R2-

interface Loopback0
 ip address 2.2.2.2 255.255.255.0
!
interface Serial1/0
 ip address 12.1.1.2 255.255.255.0
 serial restart-delay 0
!
interface Serial1/1
 ip address 24.1.1.2 255.255.255.0
 serial restart-delay 0
!
router ospf 110
 router-id 2.2.2.2
 log-adjacency-changes
 network 2.2.2.0 0.0.0.255 area 0
 network 12.1.1.0 0.0.0.255 area 0
!
router bgp 1
 no synchronization
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 1
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 1.1.1.1 next-hop-self                     //保证下一跳可达,主要做在AS边界路由器上
 neighbor 3.3.3.3 remote-as 1
 neighbor 3.3.3.3 update-source Loopback0
 neighbor 3.3.3.3 next-hop-self
 neighbor 24.1.1.4 remote-as 4               //EBGP邻居,直连接口建邻居,如果是用环回口,必须修改多跳和update source
 no auto-summary
!
R3-

interface Loopback0
 ip address 3.3.3.3 255.255.255.0
!
interface Serial1/0
 ip address 35.1.1.3 255.255.255.0
 serial restart-delay 0
!
interface Serial1/1
 ip address 13.1.1.3 255.255.255.0
 serial restart-delay 0
!
router ospf 110
 router-id 3.3.3.3
 log-adjacency-changes
 network 3.3.3.0 0.0.0.255 area 0
 network 13.1.1.0 0.0.0.255 area 0
!
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 1
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 1.1.1.1 next-hop-self
 neighbor 2.2.2.2 remote-as 1
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 2.2.2.2 next-hop-self
 neighbor 5.5.5.5 remote-as 5                //EBGP邻居
 neighbor 5.5.5.5 ebgp-multihop 2            //修改多跳
 neighbor 5.5.5.5 update-source Loopback0          //用环回口建邻居
 no auto-summary
!

ip route 5.5.5.5 255.255.255.255 Serial1/0                //环回口建邻居,必须保证有路由
R4-

interface Loopback0
 ip address 4.4.4.4 255.255.255.0
!
interface Serial1/1
 ip address 24.1.1.4 255.255.255.0
 serial restart-delay 0
!
router bgp 4
 no synchronization
 bgp router-id 4.4.4.4
 bgp log-neighbor-changes
 network 4.4.4.0 mask 255.255.255.0          //通告路由
 neighbor 24.1.1.2 remote-as 1
 no auto-summary
!
R5-

interface Loopback0
 ip address 5.5.5.5 255.255.255.0
!
interface Serial1/0
 ip address 35.1.1.5 255.255.255.0
 serial restart-delay 0
!
router bgp 5
 no synchronization
 bgp log-neighbor-changes
 network 5.5.5.0 mask 255.255.255.0           //通告路由
 neighbor 3.3.3.3 remote-as 1
 neighbor 3.3.3.3 ebgp-multihop 2
 neighbor 3.3.3.3 update-source Loopback0
 no auto-summary
!
ip route 3.3.3.3 255.255.255.255 Serial1/0                //因为用环回口建邻居,必须保证有路由
实验结果:

show 命令,只有通告的路由才在吗?

#lab BGP2# 下一跳是MA网络

实验拓扑:

配置:

R1-

interface Loopback0
 ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 134.1.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface Serial1/0
 ip address 12.1.1.1 255.255.255.0
 serial restart-delay 0
!
router rip
 version 2
 network 1.0.0.0
 network 134.1.0.0
 no auto-summary
!
router bgp 1
 no synchronization
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 neighbor 3.3.3.3 remote-as 1
 neighbor 3.3.3.3 update-source Loopback0
 neighbor 3.3.3.3 next-hop-self
 neighbor 12.1.1.2 remote-as 2
 no auto-summary
!
R2-

interface Loopback0
 ip address 2.2.2.2 255.255.255.0
!
interface Serial1/0
 ip address 12.1.1.2 255.255.255.0
 serial restart-delay 0
!
router bgp 2
 no synchronization
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 network 2.2.2.0 mask 255.255.255.0             //通告路由
 neighbor 12.1.1.1 remote-as 1
 no auto-summary
!
 R3-

interface Loopback0
 ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
 ip address 134.1.1.3 255.255.255.0
 duplex auto
 speed auto
!
router rip
 version 2
 network 3.0.0.0
 network 134.1.0.0
 no auto-summary
!
router bgp 1
 no synchronization
 bgp router-id 3.3.3.3
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 1
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 134.1.1.4 remote-as 4
 no auto-summary
!
R4-

interface Loopback0
 ip address 4.4.4.4 255.255.255.0
!
interface FastEthernet0/0
 ip address 134.1.1.4 255.255.255.0
 duplex auto
 speed auto
!
router bgp 4
 no synchronization
 bgp router-id 4.4.4.4
 bgp log-neighbor-changes
 neighbor 134.1.1.3 remote-as 1
 no auto-summary
!
实验结果:

#lab BGP3# 路由聚合方法一

实验拓扑:

 

配置:

interface Loopback0
 ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 134.1.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface Serial1/0
 ip address 12.1.1.1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值