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 sh3d

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跑起來調試

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 aucode

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 aurouter

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跑起來blog

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

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.ip

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

相關文章
相關標籤/搜索