华为与思科BGP的基本配置命令

华为与思科 BGP 的基本配置命令
思科的配置命令:
下面的拓扑图用的是 类的 IP 地址,为了便于理解,我用路由器之间的名字作为 IP 地址的

下面的是 R1 R8 的关于 BGP 的配置命令 (R1-R6 AS65001 R7-R8 AS65002 ,两个 AS 间运行静态路由 )
注:看上图 R1-R6 之间我不建立全互联,只与它们直连网段的路由器建立邻居关系,然后在 R2 R5 上做路由反射器
R1 的配置命令
R1(config)#router bgp 65001              // 启动 BGP 的进程
R1(config-router)#bgp router-id 1.1.1.1     
R1(config-router)#no synchronization        // 关闭同步
R1(config-router)#bgp log-neighbor-changes  // 用于网管监控邻居状态的改变
R1(config-router)#no auto-summary        // 关闭自动汇总
R1(config-router)#network 202.106.1.0 mask 255.255.255.0 // M1 上的主机的 IP 地址通告出去( M1 R1 R4 做的 VRRP 过程略)
R1(config-router)#neighbor 2.2.2.2 remote-as 65001 // 指定邻居路由器所在的 AS
R1(config-router)#neighbor 2.2.2.2 update-source loo0 // 指定更新源
R1(config-router)#neighbor 5.5.5.5 remote-as 65001
R1(config-router)#neighbor 5.5.5.5 update-source loo0
R2 的配置命令
R2(config)#router bgp 65001
R2(config-router)#bgp router-id 2.2.2.2
R2(config-router)#no synchronization
R2(config-router)#no auto-summary
R2(config-router)#bgp log-neighbor-changes
R2(config-router) bgp cluster-id 10 //在一个网络中有两台路由器做反射器[R2R3R5R6做路由反映器]时要指定cluster-id的,而且id号是要一样的
R2(config-router) neighbor 3.3.3.3 route-reflector-client   //指定客户端为R3R2R3路由的反射器)
R2(config-router)#neighbor 1.1.1.1 remote-as 65001
R2(config-router)#neighbor 1.1.1.1 update-source loo0
R2(config-router)#neighbor 4.4.4.4 remote-as 65001  
R2(config-router)#neighbor 4.4.4.4 update-source loo0
R2(config-router)#neighbor 3.3.3.3 remote-as 65001  
R2(config-router)#neighbor 3.3.3.3 update-source loo0 
R2(config-router)#neighbor 5.5.5.5 remote-as 65001  
R2(config-router)#neighbor 5.5.5.5 update-source loo0
R3 的配置命令
R3(config)#router bgp 65001
R3(config-router)#no synchronization
R3(config-router)#no auto-summary
R3(config-router)#bgp log-neighbor-changes
R3(config-router)#bgp router-id 3.3.3.3
R3(config-router)#neighbor 2.2.2.2 remote-as 65001
R3(config-router)#neighbor 2.2.2.2 update-source loo0
R3(config-router)#neighbor 2.2.2.2 next-hop-self   // 配置下一跳自我,即对从 EBGP 邻居转入的路由,在通告给 IBGP 邻居的同时,强迫路由器通告自己是发送 BGP 更新的下一跳,而不是 EBGP    
R3(config-router)#neighbor 6.6.6.6 remote-as 65001
R3(config-router)#neighbor 6.6.6.6 update-source loo0
R3(config-router)#neighbor 6.6.6.6 next-hop-self
R3(config-router)#neighbor 7.7.7.7 remote-as 65002
R3(config-router)#neighbor 7.7.7.7 update-source loo0
R3(config-router)#neighbor 7.7.7.7 ebgp-multihop 2    // 将邻居 7.7.7.7 的路数该为 2 ,因为用的是环回口来建的邻居关系
R3(config)#ip route 7.7.7.7 255.255.255.255 192.168.37.7
R4 的配置命令
R4(config)#router bgp 65001
R4(config-router)#no synchronization
R4(config-router)#no auto-summary
R4(config-router)#bgp log-neighbor-changes
R4(config-router)#bgp router-id 4.4.4.4
R4(config-router)#network 202.106.1.0 mask 255.255.255.0 // M1 上的主机的 IP 地址通告出去
R4(config-router)#neighbor 2.2.2.2 remote-as 65001
R4(config-router)#neighbor 2.2.2.2 update-source loo0
R4(config-router)#neighbor 5.5.5.5 remote-as 65001  
R4(config-router)#neighbor 5.5.5.5 update-source loo0
R5 的配置命令
R5(config)#router bgp 65001
R5(config-router)#no synchronization
R5(config-router)#no auto-summary
R5(config-router)#bgp log-neighbor-changes
R5(config-router)#bgp router-id 5.5.5.5
R5(config-router)# bgp cluster-id 10 
R5(config-router)# neighbor 6.6.6.6 route-reflector-client //指定客户端为R6
R5(config-router)#neighbor 2.2.2.2 remote-as 65001
R5(config-router)#neighbor 2.2.2.2 update-source lo0
R5(config-router)#neighbor 4.4.4.4 remote-as 65001 
R5(config-router)#neighbor 4.4.4.4 update-source lo0
R5(config-router)#neighbor 6.6.6.6 remote-as 65001 
R5(config-router)#neighbor 6.6.6.6 update-source lo0
  • 2
    点赞
  • 49
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值