BGP实验

要求,使用BGP建立起邻居,而且全互联

每个路由器上都配置了Loopback 0 使用的是Loopback接口建立邻居

R1:

[R1]router id 1.1.1.1

[R1]bgp 100  本地的AS编号

[R1-bgp]peer 2.2.2.2 as-number 200 对方的AS编号

[R1-bgp]peer 2.2.2.2 connect-interface LoopBack 0   修改更新源

[R1-bgp]peer 2.2.2.2 next-hop-local    下一跳自我

[R1-bgp]peer 2.2.2.2 ebgp-max-hop  因为EBGP的TTL是1,所以需要修改TTL,默认255

[R1]ip route-static 2.2.2.0 24 12.1.1.2

[R1-bgp]peer 3.3.3.3 as-number 200

[R1-bgp]peer 3.3.3.3 connect-interface LoopBack 0

[R1-bgp]peer 3.3.3.3 next-hop-local

[R1-bgp]peer 3.3.3.3 ebgp-max-hop

[R1]ip route-static 3.3.3.0 255.255.255.0 13.1.1.3

R2:

[R2]router id 2.2.2.2

[R2]bgp 200

[R2-bgp]peer 1.1.1.1 as-number 100

[R2-bgp]peer 1.1.1.1 connect-interface LoopBack 0

[R2-bgp]peer 1.1.1.1 next-hop-local

[R2-bgp]peer 1.1.1.1 ebgp-max-hop

[R2]ip route-static 1.1.1.0 24 12.1.1.1

[R2-bgp]peer 3.3.3.3 as-number 200

[R2-bgp]peer 3.3.3.3 connect-interface LoopBack 0

[R2-bgp]peer 3.3.3.3 next-hop-local

[R2]ip route-static 3.3.3.0 24 23.1.1.3

[R2-bgp]peer 4.4.4.4 as-number 200

[R2-bgp]peer 4.4.4.4 connect-interface LoopBack 0

[R2-bgp]peer 4.4.4.4  next-hop-local

[R2]ip route-static 4.4.4.0 24 24.1.1.4

R3:

[R3]router id 3.3.3.3

[R3]bgp 200

[R3-bgp]peer 2.2.2.2 as-number 200

[R3-bgp]peer 2.2.2.2 connect-interface LoopBack 0

[R3-bgp]peer 2.2.2.2 next-hop-local

[R3]ip route-static 2.2.2.0 24 23.1.1.2

[R3-bgp]peer 1.1.1.1 as-number 100

[R3-bgp]peer 1.1.1.1 connect-interface LoopBack 0

[R3-bgp]peer 1.1.1.1 next-hop-local

[R3-bgp]peer 1.1.1.1 ebgp-max-hop

[R3]ip route-static 1.1.1.0 24 13.1.1.1

[R3-bgp]peer 4.4.4.4 as-number 200

[R3-bgp]peer 4.4.4.4 connect-interface LoopBack 0

[R3-bgp]peer 4.4.4.4 next-hop-local

R4:

[R4]bgp 200

[R4-bgp]peer 2.2.2.2 as-number 200

[R4-bgp]peer 2.2.2.2connect-interface LoopBack 0

[R4-bgp]peer 2.2.2.2 next-hop-local

[R4]ip route-static 2.2.2.0 24 24.1.1.2

[R4-bgp]peer 3.3.3.3 as-number 200

[R4-bgp]peer 3.3.3.3 connect-interface LoopBack 0

[R4-bgp]peer 3.3.3.3 next-hop-local

[R4-bgp]peer 5.5.5.5 as-number 300

[R4-bgp]peer 5.5.5.5 connect-interface LoopBack 0

[R4-bgp]peer 5.5.5.5 next-hop-local

[R4-bgp]peer 5.5.5.5 ebgp-max-hop

[R4]ip route-static 5.5.5.0 24 45.1.1.5

R5:

[R5-bgp]peer 4.4.4.4 as-number 200

[R5-bgp]peer 4.4.4.4 connect-interface LoopBack 0

[R5-bgp]peer 4.4.4.4 next-hop-local

[R5-bgp]peer 4.4.4.4 ebgp-max-hop

[R5]ip route-static 4.4.4.0 24 45.1.1.4

这样,邻居建立就完成了

需要路由的话,在BGP上network就行了。

接下来讲一下如何引入默认路由:

第一种方式

[R1]bgp 100

[R1-bgp]peer 2.2.2.2 default-route-advertise

第二种方式

[R1]ip route-static 0.0.0.0 0.0.0.0 NULL 0(目的是让默认路由出现在igp路由表里)

[R1-bgp]network 0.0.0.0 0

手工汇总:

第一种:

[R1]ip route-static 123.0.0.0 8 NULL 0

[R1-bgp]network 123.0.0.0 8

第二种:

aggregate 123.0.0.0 8

收到的是明细路由和汇总路由

抑制列表:

[R1]ip ip-prefix 1 permit 123.1.1.0 24 抑制你想抑制的网段

[R1]route-policy 10 permit node 10

[R1-route-policy]if-match ip-prefix 1  匹配

[R1]bgp 100

[R1-bgp]aggregate 123.0.0.0 8 suppress-policy 10  在123.0.0.0/8这个路由上一直123.1.1.0/24

路由反射器(RR)

1.客户机

2.服务器

3.非客户机

相当于一面镜子,通过这面镜子进行反射

①从EBGP学来的路由会发给所有的客户机和非客户机

②从非客户机学来的路由会发给所有的客户机

③从客户机学来的路由会发给除了该客户机以外的所有客户机和非客户机

配置命令

[R2-bgp]peer 3.3.3.3 reflect-client

Router-limit做限制

[R4-bgp]peer 5.5.5.5 route-limit 5 60 前面的5是限制多少个网段,后面的60是百分比,如果有3个就开始警告

时间: 2024-08-26 19:55:12

BGP实验的相关文章

MPLS VPN 之CE端运行BGP实验分析

实验拓扑图 实验描述:主要模拟CE端运行EBGP,PE端的配置及路由分析,主要分为两步来分析,两CE端运行相同的自治系统及不同的自治系统. 1.当两CE端(属于相同的VRF Ting)运行不同的BGP自治系统的情况分析 当CE-R5与CE-R7运行BGP协议,并且AS分别为55和77,以下为各设备配置: PE-R1: ip vrf Ting rd 100:11 route-target export 100:14 route-target import 100:13 ip cef mpls la

ISIS 综合实验;BGP 实验

目录 ISIS 综合实验 实验拓扑 实验需求 实验步骤 BGP 基础实验 实验拓扑 实验要求 ISIS 综合实验 实验拓扑 实验需求 1. 如图配置 IP 地址 2. 如图配置 IS-IS,要求全网互通,R8的Loop X口暂不宣告 3. R1和R3直连,要求 R3 成为 DIS,但只允许在 R1上配置 4. R3与R4之间不允许有 DIS 选举 5. R8引入 8.8.X.0/24 网段路由 6. 要求区域 49.0010只学习到 8.8.X.0/24 的汇总路由(精确汇总),有数据访问时走最

linux下安装quagga 做bgp实验

作为一个努力在IT一线奋斗的人,励志做到以下几点: 搬的了机器,玩的了系统,精通了协议,敲得了代码. --谨以此让自己不断努力! -----------------------------------------------------------------------------------------------------------------------------------------  什么是Quagga Quagga软件原名是Zebra是由一个日本开发团队编写的一个以GNU版

EIGRP协议的配置

实验 3  EIGRP.BGP 的配置 EIGRP 实验学时:2学时 一.实验目的 掌握 EIGRP 协议的基本原理: 掌握 EIGRP 协议的配置方法: 掌握 EIGRP 协议路由汇总和负载均衡的配置方法: 二.实验环境(软件.硬件及条件) 2Windows 主机+3 台路由器 或者 1 台 Windows 主机+packet tracer 5.0 以上模拟器 三.实验内容 理解 EIGRP 协议的工作原理,掌握 EIGRP 协议的基本配置方法. 四.实验拓扑 各接口 IP 地址分配如图所示.

Linux下使用Quagga(Zebra)搭建路由器记录

写在前面 从22号中午开始琢磨zebra/quagga的用法,一直到晚上11点多都没有什么头绪.各种Google,百度,几近崩溃.由于网上关于zebra/quagga的配置方法都是在真实的若干台电脑上实现的,一直都没有找到完全在虚拟机上进行测试的教程,相当失望.所以,我就决定,如果我要是能够利用多台虚拟机完成实验的内容,我一定要写一个详细的文档放到博客上. 没有办法,索性自己慢慢摸索吧,但花了一天的时间也没有成功.直到快睡觉的时候才突然想到,会不会跟我在Virtual Box上设置采用NAT方式

50、BGP配置实验之社团属性community

1.社团属性community解析 BGP社团属性community: 可开启:BGP社团属性community为可选属性,默认不识别.可通过命令开启:neighbor x.x.x.x send-community 传递性:BGP社团属性community只在邻居有效,邻居的邻居不再有效,想要传递到邻居的邻居需配置neighbor x.x.x.x send-community 修改BGP社团属性community步骤: ip prefix-list 1 permit 1.1.1.0/24 rou

43、BGP配置实验之聚合aggregate-address

1.实验拓扑 2.基础配置 R1配置 interface Loopback0 ip address 1.1.1.1 255.255.255.0 interface Serial0/0 ip address 13.1.1.1 255.255.255.0 interface FastEthernet1/0 ip address 124.1.1.1 255.255.255.0 router ospf 110 log-adjacency-changes network 1.1.1.0 0.0.0.255

47、BGP配置实验之MED选路

1.as-path选路解析 属性 传播范围 默认值 优先值 方向 备注 weight 本路由器 本路由器32768,其他路由器0 大值优先 IN CISCO私有 Local preference AS内部 100:边界路由器,通告给IBGP邻居,告知如何离开本AS 大值优先 OUT As path AS之间 无 短优先 IN.OUT MED AS内部 0:通告给EBGP,告知如何进入本AS 小优先 OUT 修改MED值的方法: 2.实验拓扑 3.基础配置 R1配置 interface Loopb

思科设备实现运营商城域网架构ISIS+BGP+IPV6综合实验

使用GNS3 0.8.6版本模拟器(c3725-adventerprisek9-mz.124-15.T5.image) 实验拓扑: 实验要求: 1.   通过ISIS协议将AS内部的直连和环回口路由宣告. 2.通过配置IBGP协议建立邻居将所有的用户业务路由(大客户和PPOE拨号)宣告. 3.通过配置路由反射器实现市内.省内业务路由互传. 4.通过建立EBGP邻居实现全省和国干互联网路由互传. 5.通过配置黑洞路由实现用户业务网段聚合. 6.实现城域网网络架构由ipv4向ipv6平滑过渡. 实验