CCNP(BSCI)实验:BGP实验利用路由反射器使全网互通

CCNP(BSCI)实验:BGP实验利用路由反射器使全网互通
预配置,图上的rip改成eigrp,固然rip也行
R1上的配置
en
conf t
no ip do lo
line c 0
no exec-t
logg syn
host R1
int lo0
ip add 1.1.1.1 255.255.255.0
int s2/1
ip add 12.0.0.1 255.255.255.0
no shide

R2上的配置
en
conf t
no ip do lo
line c 0
no exec-t
logg syn
host R2
int lo0
ip add 2.2.2.2 255.255.255.0
int s2/1
ip add 12.0.0.2 255.255.255.0
no sh
int s2/2
ip add 23.0.0.2 255.255.255.0
no sh测试

R3上的配置
en
conf t
no ip do lo
line c 0
no exec-t
logg syn
host R3
int lo0
ip add 3.3.3.3 255.255.255.0
int s2/1
ip add 23.0.0.3 255.255.255.0
no sh
int s2/2
ip add 34.0.0.3 255.255.255.0
no sh字体

R4上的配置
en
conf t
no ip do lo
line c 0
no exec-t
logg syn
host R4
int lo0
ip add 4.4.4.4 255.255.255.0
int s2/1
ip add 34.0.0.4 255.255.255.0
no sh
int s2/2
ip add 45.0.0.4 255.255.255.0
no sh调试

R5上的配置
en
conf t
no ip do lo
line c 0
no exec-t
logg syn
host R5
int lo0
ip add 5.5.5.5 255.255.255.0
int s2/2
ip add 45.0.0.5 255.255.255.0
no sh
实验过程:
第一步:先让R二、R三、R4上的EIGRP跑起来code

R2(config)#router ei 11
R2(config-router)#net 2.2.2.2
R2(config-router)#net 23.0.0.2
R2(config-router)#no aurouter

R3(config)#router ei 11
R3(config-router)#net 2.2.2.2
R3(config-router)#net 23.0.0.3
R3(config-router)#net 34.0.0.3
R3(config-router)#no aublog

R4(config)#router ei 11
R4(config-router)#net 4.4.4.4
R4(config-router)#net 34.0.0.4
R4(config-router)#no au
第二步:再让各路由器上的BPG跑起来接口

R1(config)#router b 100
R1(config-router)#nei 12.0.0.2 remot 200ip

R2(config)#router b 200
R2(config-router)#nei 12.0.0.1 remot 100
R2(config-router)#nei 3.3.3.3 remot 200
R2(config-router)#nei 3.3.3.3 up lo0
R2(config-router)#net 2.2.2.路由

R4(config)#router b 200
R4(config-router)#nei 3.3.3.3 remot 200
R4(config-router)#nei 3.3.3.3 up lo0
R4(config-router)#nei 45.0.0.5 remot 500

R5(config)#router b 500
R5(config-router)#nei 45.0.0.4 remot 200

咱们在R3上用一种简单的方式
R3(config-router)#router b 200
R3(config-router)#nei libo peer-group
R3(config-router)#nei libo remot 200
R3(config-router)#nei libo up lo0
R3(config-router)#nei 2.2.2.2 peer libo
R3(config-router)#nei 4.4.4.4 peer libo
R3(config-router)#end


第三步:查看邻居创建状况

R1#sh ip b s
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
12.0.0.2 4 200 10 10 1 0 0 00:06:31 0

R2#sh ip b s
BGP router identifier 2.2.2.2, local AS number 200
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
3.3.3.3 4 200 5 5 1 0 0 00:01:45 0
12.0.0.1 4 100 11 11 1 0 0 00:07:39 0
R2#
R2#

R3#sh ip b s
BGP router identifier 3.3.3.3, local AS number 200
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2.2.2.2 4 200 4 4 1 0 0 00:00:40 0
4.4.4.4 4 200 4 4 1 0 0 00:00:28 0

R4#sh ip b s
BGP router identifier 4.4.4.4, local AS number 200
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
3.3.3.3 4 200 4 4 1 0 0 00:00:34 0
45.0.0.5 4 500 7 7 1 0 0 00:03:54 0

R5#sh ip b s
BGP router identifier 5.5.5.5, local AS number 500
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
45.0.0.4 4 200 7 7 1 0 0 00:03:57 0
//从上面能够看出邻居关系是没有问题的
第四步:宣告出路由表中没有的路由


第四步分如下几步
第一步:先在R1上宣告本身的回环接口1.1.1.1并在R2上查看
R1(config-router)#net 1.1.1.0 mask 255.255.255.0
R2#sh ip b
BGP table version is 2, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
> 1.1.1.0/24 12.0.0.1 0 0 100 i
第二步:再R5上作相同的配置
R5(config-router)#net 5.5.5.0 mask 255.255.255.0
第三步:查看R3上的bgp表
R3#sh ip b
BGP table version is 1, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history,
valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path

  • i1.1.1.0/24 12.0.0.1 0 100 0 100 i
  • i5.5.5.0/24 45.0.0.5 0 100 0 500 i
    //咱们在这时能够看到上面的黑色字体,对R3来讲是没有办法能够到达的,咱们只有在R2和R4上指定下一跳为本身。由于对于R3来讲,12.0.0.1和45.0.0.5在哪里,不知道。
    R2(config-router)#nei 3.3.3.3 next-hop-self
    R4(config-router)#nei 3.3.3.3 next-hop-self
    指定后咱们再来看看R3上的bgp表
    R3#sh ip b
    BGP table version is 3, local router ID is 3.3.3.3
    Status codes: s suppressed, d damped, h history, valid, > best, i - internal,
    r RIB-failure, S Stale
    Origin codes: i - IGP, e - EGP, ? - incomplete
    Network Next Hop Metric LocPrf Weight Path
    >i1.1.1.0/24 2.2.2.2 0 100 0 100 i
    *>i5.5.5.0/24 4.4.4.4 0 100 0 500 i
    //咱们在这里看到的是正常的状况,也很是符合逻辑,思考一下,2.2.2.2和4.4.4.4是谁告诉给R3的?若是看到这里能回答出这个问题,说明bgp入门了。
    第四步:在R2—R4上分别宣告本身的回环接口
    R2(config-router)#net 2.2.2.0 mask 255.255.255.0
    R3(config-router)#net 3.3.3.0 mask 255.255.255.0
    R4(config-router)#net 4.4.4.0 mask 255.255.255.0
    //可是咱们在R一、R2上看到不到R4和R5的路由,相同的是咱们在R四、R5上一样也看不到R1和R2上的路由,这就是咱们遇到的路由黑洞,咱们先用经常使用的路由反射的方法来解决这个问题(欢迎来到接着的第五步:)本实验的重点内容:

    第五步:在R3上配置路由反射器
    R3(config-router)#nei libo route-reflector-client
    //因为咱们使用的是peer-group组,因此只能像这样定义了
    第六步:相邻的路由器上宣告本身的网段
    R1(config-router)#net 12.0.0.0 mask 255.255.255.0
    R3(config-router)#net 23.0.0.0 mask 255.255.255.0
    R3(config-router)#net 34.0.0.0 mask 255.255.255.0
    R5(config-router)#net 45.0.0.0 mask 255.255.255.0
    //这里注意的是不要重复,也就是R2上不用宣告12.0.0.0了。

    第七步:调试并排错
    遇到的问题是R1和R2上的路由表不稳定,时有时无
    开始想R3上确定有问题,经查检R3无问题,在经查检R4上的水平分割未关闭
    CCNP(BSCI)实验:BGP实验利用路由反射器使全网互通
    //上图显示水平分割未关闭
    R4(config)#router ei 11
    R4(config-router)#no au
    //在R4上关闭水平分割
    第八步:小小测试
    R5#tclsh
    R5(tcl)#foreach ip {

+>(tcl)#1.1.1.1
+>(tcl)#2.2.2.2
+>(tcl)#3.3.3.3
+>(tcl)#4.4.4.4
+>(tcl)#5.5.5.5
+>(tcl)#12.0.0.1
+>(tcl)#12.0.0.2
+>(tcl)#23.0.0.2
+>(tcl)#23.0.0.3
+>(tcl)#34.0.0.3
+>(tcl)#45.0.0.4
+>(tcl)#45.0.0.5
+>(tcl)#34.0.0.4
+>(tcl)#} {ping $ip}

Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 52/132/288 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 36/88/136 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 28/61/100 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 12/41/88 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 44/76/116 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 12.0.0.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 48/94/136 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 23.0.0.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 64/96/192 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 23.0.0.3, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 56/84/104 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 34.0.0.3, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 12/66/92 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 45.0.0.4, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 4/48/108 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 45.0.0.5, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 32/72/116 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 34.0.0.4, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 28/43/56 ms