导航:首页 > 程序命令 > 开启bgp同步命令

开启bgp同步命令

发布时间:2022-07-17 17:20:43

① BGP,怎么配详细的命令

neighbor 192.168.2.1 next-hop-self

!-- This command assigns a next-hop value to 192.168.2.3 !-- for updates sent to 192.168.2.1 (the iBGP peer).

!

ip classless

ip route 192.168.0.0 255.255.0.0 Null0

MSFC Configuration on CAT2

CAT2 (enable)

CAT2 (enable) session 15

Trying Router-15...

Connected to Router-15.

Escape character is '^]'.

MSFC-CAT2>enable

MSFC-CAT2#show running-config

Building configuration...

Current configuration : 890 bytes

!

version 12.1

!

hostname MSFC-CAT2

!

boot system flash bootflash:c6msfc-jsv-mz.121-8b.E7

!

ip subnet-zero

!

!

rendancy

!-- This command enables rendancy.

high-availability

!-- This command enables high availability.

single-router-mode

!-- This command enables SRM.

!

interface Vlan10

ip address 192.168.1.3 255.255.255.0

!-- Interface Vlan10 connected to interface Vlan10 on CAT1 via the trunk.

!

interface Vlan20

ip address 192.168.2.1 255.255.255.0

!-- Interface Vlan20 connected to AS20.

!

router bgp 4

no synchronization

bgp log-neighbor-changes

network 192.168.0.0 mask 255.255.0.0

neighbor 192.168.2.2 remote-as 20

!-- This command establishes eBGP peering with AS20.

neighbor 192.168.2.3 remote-as 4

!-- This command establishes iBGP peering with interface Vlan20 on CAT1.

neighbor 192.168.2.3 next-hop-self

!-- This command assigns a next-hop value to 192.168.2.1 !-- for updates sent to 192.168.2.3 (the iBGP peer).

!

ip classless

ip route 192.168.0.0 255.255.0.0 Null0

Troubleshoot

Now that you've verified the high availability SRM configuration, you need to verify the BGP MSFC on CAT1 and CAT2. Use the show ip bgp summary command to verify the neighbor establishment. The output below confirms successful eBGP and iBGP peering with AS10 and the CAT2 MSFC respectively.

MSFC-CAT1#show ip bgp summary

BGP router identifier 192.168.2.3, local AS number 4

BGP table version is 4, main routing table version 4

3 network entries and 4 paths using 435 bytes of memory

4 BGP path attribute entries using 240 bytes of memory

2 BGP AS-PATH entries using 48 bytes of memory

0 BGP route-map cache entries using 0 bytes of memory

0 BGP filter-list cache entries using 0 bytes of memory

BGP activity 3/14 prefixes, 4/0 paths, scan interval 15 secs

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

192.168.1.2 4 10 90 92 4 0 0 01:26:02 1

192.168.2.1 4 4 91 91 4 0 0 01:25:38 2

Verify the BGP state on the active MSFC in CAT2. The output below confirms successful eBGP and iBGP peering with AS20 and CAT1 respectively

MSFC-CAT2#show ip bgp summary

BGP router identifier 192.168.2.1, local AS number 4

BGP table version is 4, main routing table version 4

3 network entries and 4 paths using 435 bytes of memory

4 BGP path attribute entries using 240 bytes of memory

2 BGP AS-PATH entries using 48 bytes of memory

0 BGP route-map cache entries using 0 bytes of memory

0 BGP filter-list cache entries using 0 bytes of memory

② BGP开启同步与关闭同步的区别

楼上已经说的很清楚了,我再啰嗦下,BGP同步就是如果一个IBGP将路由传递给对端IBGP,若对端IBGP开启了同步,那么对端IBGP的该BGP路由将不是最优,如果有

③ 什么是BGP同步

1.BGP同步规则的定义:
在bgp同步打开的情况下,一个BGP路由器不会把那些通过ibgp邻居学到的bgp路由通告给自己的ebgp邻居;除非自己的igb路由表中存在这些路由,才可以向ebgp路由器通告.

2.BGP同步规则的目的:
防止一个AS(不是所有的路由器都运行bgp)内部出现路由黑洞,即向外部通告了一个本AS不可达的虚假的路由.

3.BGP同步规则的基本需求
如果一个AS内部存在非bgp路由器,那么就出现了bgp和igp的边界,需要在边界路由器将bgp路由发布到igp中,才能保证AS所通告到外部的bgp路由在AS内部是连通的.实际上是要求bgp路由和igp路由的同步.

4.满足BGP同步规则的基本需求的结果
如果将bgp路由发布到igp中,由于bgp路由主要是来自AS外部的路由(来自internet),那么结果是igp路由器要维护数以万计的外部路由,对路由器的cpu和memeory以及AS内部的链路带宽的占用将带来巨大的开销.

BGP同步规则的总结
1.在所有的方案中, 既要保证传递bgp路由,还要保证bgp路由的连通性.

2.关闭同步能够实现bgp路由的传递,不一定能保证as内部连通性,除非as内所有路由器都运行bgp才可以保证连通性;否则,仍然需要路由再发布(bgpàigp)

3.最后,在as内部一般需要部署igp来维持AS内部网络路径的连通性,以保证as内部的所通告的bgp路由的下一跳的可达性.这样bgp网络就具有更好的灵活性和扩展性.

④ 介绍下BGP和相关配置命令

  1. BGP,边界网关协议,是自主网络系统中网关之间交换器路由信息的协议。边界网关协议常常应用于互联网的网关之间。路由表包含已知路由器的列表、路由器能够达到的地址以及到达每个路由器的路径的跳数。BGP(Border Gateway Protocol,边界网关协议)是用来连接Internet上的独立系统的路由选择协议。它是Internet工程任务组制定的一个加强的、完善的、可伸缩的协议。BGP4支持CIDR寻址方案,该方案增加了Internet上的可用IP地址数量。

  2. BGP是为取代最初的外部网关协议EGP设计的。它也被认为是一个路径矢量协议。BGP(Border Gateway Protocol)是一种在自治系统之间动态交换路由信息的路由协议。一个自治系统的经典定义是在一个管理机构控制之下的一组路由器,它使用IGP和普通度量值向其他自治系统转发报文。

  3. import-route isis level-2 into level-1 (这条命令一定要打的,不然后面做这BGP时是学不到EBGP通告的路由) //将level-2的路由引入到level-1中。该命令配置在与外部区域相连的Level-1-2路由器上。缺省情况下,Level-2的路由信息不发布到Level-1区域中。

  4. undo import-route isis level-1 into level-2 //不将Level-1的路由信息发布到Level-2中。该命令配置在与外部区域相连的Level-1-2路由器上。缺省情况下,Level-1的路由信息都将发布到Level-2区域中。

  5. display bgp peer //查看bgp的对等信息 Established为成功建立

  6. diplay bgp peer ipv4-address verbose //查看bgp的某个邻居(对等体)的详细信息。

  7. diplay bgp routing-table //查看bgp的路由表信息

⑤ 如何配置BGP路由协议

实验拓扑图:

实验要求:

1.各AS之间实现全网互通,并在路由两条出口中任意一条断开均不影响全网通讯;

a.在Router P6BBR1和P7BBR1上创建EBGP;

b.在Router P6R3和P7R3之间创建EBGP;

2.在PXR1、PXR2、PXR3、PXR4、PXBBR1之间配置IBGP;

3.在PXR1、PXR2、PXR3、PXR4、PXBBR1之间可使用OSPF或RIP、EIGRP等协议完成各接口基本的互通性。这里使用OSPF,并将其中五台路由器全部定义到Aera 0中。

4.验证BGP配置,使用show ip bgp summary来验证BGP邻居关系是否已建立,使用sh ip bgp显示BGP路由选择信息库.查看是否从核心路由器和另一台边缘路由器那里获悉了路由,查看边缘路由器的IP路由选择表,其中是否有BGP路由?

5.最后,老师要求在每一台路由器上都要开启telnet访问,便于老师telnet到各个路由器检查我们的实验配置,方便帮助我们排错.因开启telnet需要设置密码,所有密码均设置cisco.

实验步骤(以下将以P7BBR1、P7R1、P7R2、P7R3、P7R4作说明,在P6BBR1和P6的其它路由器则可参考以此骤):

1.删除路由器中原来的配置(earse Start),以免被以前实验中的配置影响实验的顺利进行,然后重启各路由器(Reload),或针对接口使用default interface (s0)删除该接口的所有配置.

2.按照网络拓扑图上所标示的IP地址在所有ROUTER的接口上按要求配置好IP Address,在DCE接口上配置好时钟频率(clock rate 64000),所有接口确保UP状态(NO shutdown).

3.在所有Route中均需配置一个环回接口(Interface loopback 0),并配置相应的IP地址,用于BGP中宣告网络。OSPF路由协议通告完成后需确保各路由器间可以互相PING通Loopback O的地址.各路由器的OSPF配置命令如下:

P7BBR1:

P7BBR1(config-router)#network 172.31.7.0 0.0.0.255 area 0

P7BBR1(config-router)#network192.168.7.1 0.0.0.0 area 0

P7R1:

P7R1(config-router)#network 172.31.7.0 0.0.0.255 area 0

P7R1(config-router)#network 10.7.0.0 0.0.0.255 area 0

P7R1(config-router)#network 10.7.1.0 0.0.0.255 area 0

P7R1(config-router)#network 10.7.4.1 0.0.0.0 area 0

P7R2:

P7R2(config-router)#network 172.31.7.0 0.0.0.255 area 0

P7R2(config-router)#network 10.7.0.0 0.0.0.255 area 0

P7R2(config-router)#network 10.7.2.0 0.0.0.255 area 0

P7R2(config-router)#network 10.7.4.2 0.0.0.0 area 0

P7R3:

P7R3(config-router)#network 10.7.3.0 0.0.0.255 area 0

P7R3(config-router)#network 10.7.1.0 0.0.0.255 area 0

P7R3(config-router)#network 10.7.4.3 0.0.0.0 area 0

P7R4:

P7R4(config-router)#network 10.7.3.0 0.0.0.255 area 0

P7R4(config-router)#network 10.7.2.0 0.0.0.255 area 0

P7R4(config-router)#network 10.7.4.4 0.0.0.0 area 0

4.P7BBR1中配置完S0的IP地址后,需要在SO接口上封装帧中继(encapsulation frame-relay),并将下一跳IP地址(172.31.7.1&172.31.7.2)映射到永久虚电路(PVC),在映射PVC时,broadcast这个参数一定要加,这样帧中继映射将支持广播和多播,否则在通告OSPF时无法将网络通告出去,并且要禁用反向地址解析。

P7BBR1(config-if)#frame-relay map ip 172.31.7.1 172 broadcast

P7BBR1(config-if)#frame-relay map ip 172.31.7.2 173 broadcast

P7BBR1(config-if)#no frame-relayinverse-arp

5.同理,在P7R1的S0接口也要封装帧中继,以及将下一跳IP地址(172.31.7.3)映射到永久虚电路,禁用反向地址解析.

P7R1(config-if)#frame-relay map ip 172.31.7.3271 broadcast

P7R1(config-if)#no frame-relayinverse-arp

6.在P7R2的S0接口也封装帧中继,禁用反向地址解析,配置如下:

P7R1(config-if)#frame-relay map ip 172.31.7.3271 broadcast

P7R1(config-if)#no frame-relayinverse-arp

7.在点到多点的模式下,OSPF将非广播网络中的所有路由器到路由器的连接视为点到点的链路,不选举DR和BDR,也不会将2类网络LSA扩散到邻接路由器,因在P7BBR1、P7R1、P7R2之间是帧中继的网络,需要配置为点到多点的模式,具体配置如下(各路由器的配置方法一致,均在S0接口配置):

P7BBR1(config-if)#ip ospf network point-to-multipoint.

8.到目前为止,需确保整个内网的路由器的各个接口都可以互相PING通,如果PING不通,先不要进行下面的工作,把整个内网调通再进行后续操作.因为此时若有某些接口无法PING通,说明你已经错了,建议你不要再错下去了,你先排错再说,以免越来越混淆.

9.下面,开始配置IBGP和EBGP,首先在P7BBR1路由器上配置BGP,因在P7BBR1的BGP配置中,有很多邻居的更新策略相同,而在CISCO路由器上,可将更新策略相同的邻居划分到同一个对等体组(peer-group)中,以简化配置,并可提高更新的效率,在此使用peer-group.

P7BBR1:

P7BBR1(config)#router bgp 64159(进入BGP路由器配置模式,路由器位于AS64159中)

P7BBR1(config-router)#no syncronization(关闭同步规则)

P7BBR1(config-router)#network172.31.7.0 mask 255.255.255.0 (在BGP中通告网络)

P7BBR1(config-router)#network 192.168.88.0 mask 255.255.255.0(在BGP中通告网络)

P7BBR1(config-router)#neighbor ok peer-group(创建名为OK的对等体组)

P7BBR1(config-router)#neighbor ok remote-as 64159 (指定BGP邻居,这里指定的是对等体组)

P7BBR1(config-router)#neighbor ok update-source loopback0(同邻居OK组建立对等关系,将一个环回接口的地址用作源地址)

P7BBR1(config-router)#neighbor ok next-hop-self(将自己作为下一跳通告给邻居)

P7BBR1(config-router)#neighbor 10.7.4.1 peer-group ok(将P7R1的L0加入到OK对等体组)

P7BBR1(config-router)#neighbor 10.7.4.2 peer-group ok(将P7R2的L0加入到OK对等体组)

P7BBR1(config-router)#neighbor 10.7.4.3 peer-group ok(将P7R3的L0加入到OK对等体组)

P7BBR1(config-router)#neighbor 10.7.4.4 peer-group ok(将P7R4的L0加入到OK对等体组)

P7BBR1(config-router)#neighbor 192.168.6.1 remote-as 64158 (指定192.168.6.1为BGP邻居)

P7BBR1(config-router)#neighbor 192.168.6.1 ebgp-multihop 2 (指定到邻居192.168.6.1的跳线为2)

P7BBR1(config-router)#neighbor 192.168.6.1 update-source loopback0 (同邻居192.168.6.1建立对等关系,并将环回接口的地址用作源地址)

P7BBR1(config-router)#no auto-summary (关闭自动汇总)

10.路由表中没有到邻居192.168.6.1的路由,需要手工添加静态路由到192.168.6.1,否则将不可达,EBGP将不能成功建立.

P7BBR1(config)#ip route 192.168.6.1 255.255.255.255 192.168.88.6

11.以下是另外四台路由器的BGP配置,不另加旁注,具体参考以上旁注:

P7R1:

P7R1(config)#router bgp 64159

P7R1(config-router)#no synchronization

P7R1(config-router)#network 10.7.0.0 mask 255.255.255.0

P7R1(config-router)#network 10.7.1.0 mask 255.255.255.0

P7R1(config-router)#network172.31.7.0 mask 255.255.255.0

P7R1(config-router)#neighbor ok peer-group

P7R1(config-router)#neighbor ok remote-as 64159

P7R1(config-router)#neighbor ok update-source lookback0

P7R1(config-router)#neighbor 10.7.4.2 peer-group ok

P7R1(config-router)#neighbor 10.7.4.3 peer-group ok

P7R1(config-router)#neighbor 10.7.4.4 peer-group ok

P7R1(config-router)#neighbor192.168.7.1 peer-group ok

P7R1(config-router)#no auto-summary

P7R2:

P7R2(config)#router bgp 64159

P7R2(config-router)#no synchronization

P7R2(config-router)#network 10.7.0.0 mask 255.255.255.0

P7R2(config-router)#network 10.7.2.0 mask 255.255.255.0

P7R2(config-router)#network172.31.7.0 mask 255.255.255.0

P7R2(config-router)#neighbor ok peer-group

P7R2(config-router)#neighbor ok remote-as 64159

P7R2(config-router)#neighbor ok update-source lookback0

P7R2(config-router)#neighbor 10.7.4.1 peer-group ok

P7R2(config-router)#neighbor 10.7.4.3 peer-group ok

P7R2(config-router)#neighbor 10.7.4.4 peer-group ok

P7R2(config-router)#neighbor192.168.7.1 peer-group ok

P7R2(config-router)#no auto-summary

P7R3:

P7R3(config)#router bgp 64159

P7R3(config-router)#no synchronization

P7R3(config-router)#network 10.7.1.0 mask 255.255.255.0

P7R3(config-router)#network 10.7.3.0 mask 255.255.255.0

P7R3(config-router)#network 192.168.86.0 mask 255.255.255.0

P7R3(config-router)#neighbor ok peer-group

P7R3(config-router)#neighbor ok remote-as 64159

P7R3(config-router)#neighbor ok update-source lookback0

P7R3(config-router)#neighbor ok next-hop-self

P7R3(config-router)#neighbor 10.6.4.3 remote-as 64158

P7R3(config-router)#neighbor 10.6.4.3 ebgp-multihop 2

P7R3(config-router)#neighbor 10.6.4.3 update-source loopback 0

P7R3(config-router)#neighbor 10.7.4.1 peer-group ok

P7R3(config-router)#neighbor 10.7.4.2 peer-group ok

P7R3(config-router)#neighbor 10.7.4.4 peer-group ok

P7R3(config-router)#no auto-summary

在P7R3中添加到10.6.4.3的静态路由:

P7R3(config)#ip route 10.6.4.3 255.255.255.255 192.168.86.1

P7R4:

P7R4(config)#router bgp 64159

P7R4(config-router)#no synchronization

P7R4(config-router)#network 10.7.3.0 mask 255.255.255.0

P7R4(config-router)#network 10.7.2.0 mask 255.255.255.0

P7R4(config-router)#neighbor ok peer-group

P7R4(config-router)#neighbor ok remote-as 64159

P7R4(config-router)#neighbor ok update-source lookback0

P7R4(config-router)#neighbor 10.7.4.1 peer-group ok

P7R4(config-router)#neighbor 10.7.4.3 peer-group ok

P7R4(config-router)#neighbor 10.7.4.2 peer-group ok

P7R4(config-router)#neighbor192.168.7.1 peer-group ok

P7R4(config-router)#no auto-summary

12.整个配置基本上就是这样,后面的工作就是验证BGP的配置是否正确,可以使用show ip bgp summary,show ip bgp,show ip route等命令查看配置结果.并可以在任意一个路由器上PING另一个AS的任意一个接口,看看是否PING通.当然,首先要在P6那边的五个路由器也做好相应的配置.还可以将P7BBR1的E0接口shutdown,看看结果会是如何.如有问题,多看书查阅相关资料,举一反三,相信可以查明原因.

⑥ 华为路由器 如何开启BGP同步 我在BGP协议中无法使用sy命令,是VRP版本的问题吗

各位 我刚学BGP也遇到了这个问题,查了查资料,目前得出的答案是在华为设备中,无法开启同步。。。。华三和思科的可以。。如果说的不对,敬请指正。

⑦ BGP同步如何解释。

同步只存在于IBGP中,即AS内部。当AS内bgp路由器全互连时,不需要同步,否则应打开同步。
同步指igp和bgp同步,即:AS内的非ibgp路由器必须知道如何到达下一个as,更具体说:非ibgp路由器必须知道如何到达另一个as内的某个网络如何走。
为何要同步?因为as1内bgp路由器(A)要想到达as2某个网络,其下一跳是指向as2和as1互连接口地址(N)。在A到达N之前,A必须穿过as1内的其它路由器(包括bgp和非bgp路由器),非bgp路由器必须知道如何到达N,才能正确的把A报文送到N,否则将丢弃A报文。
因此当bgp路由器从ibgp-peer获取了某条路由信息N时,它必须检测此N(或当同步关闭后,至少是N的下一跳)是否在igp中也可达,再决定此路由是否可用,进而装载到路由表中,进而向ebgp-peer更新
之所以有"同步"问题,是因为IGP的收敛需要一定时间,而IBGP通过TCP连接直接发送无收敛时间,如果未等IGP收敛,就将IBGP通告的路由加入路由表,会造成"黑洞"。

阅读全文

与开启bgp同步命令相关的资料

热点内容
个人所得税java 浏览:752
多余的服务器滑道还有什么用 浏览:180
pdf劈开合并 浏览:17
不能修改的pdf 浏览:742
同城公众源码 浏览:478
一个服务器2个端口怎么映射 浏览:283
java字符串ascii码 浏览:65
台湾云服务器怎么租服务器 浏览:464
旅游手机网站源码 浏览:321
android关联表 浏览:932
安卓导航无声音怎么维修 浏览:324
app怎么装视频 浏览:426
安卓系统下的软件怎么移到桌面 浏览:83
windows拷贝到linux 浏览:760
mdr软件解压和别人不一样 浏览:892
单片机串行通信有什么好处 浏览:329
游戏开发程序员书籍 浏览:851
pdf中图片修改 浏览:277
汇编编译后 浏览:482
php和java整合 浏览:838