BGP基礎-小計

 
*~*~*~*~*~*~*~*~*~*~*~*~*~*~2008.10.29*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
查看通告給neighbor的路由
show ip bgp neighbors [ip] advertised-routes
路由反射器(路由反射簇)RR
1:同AS中,客戶端傳遞來的路由條目做全反射
2: 同AS中,非客戶端傳遞來的路由條目不會傳遞給另外一個非客戶端
3:不同AS傳遞來的路由 做全反射。
TIPS:
1.路由反射簇當作邏輯的一個路由器。這樣路由反射器的路由傳遞方式就容易理解了。
2.路由反射簇只有RR知道,CLIENT不知道。(看命令)
neighbor 1.1.1.1 route-reflector-client
聯邦:
bgp confederation identifier  [as] 對外AS
bgp confederation peers [as] 對內聯邦
聯邦EBGP還是需要
neighbor [ip] next-hop-self
聯邦AS不會帶出大AS;學到的聯邦EBGP路由管理距離爲200;
*~*~*~*~*~*~*~*~*~*~*~*~*~*~2008.10.27*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
從ibgp學到的路由優化的條件
1.下一跳可達 ip route [network] [mask] null0
2.同步:BGP有的條目IGP裏面也有,預防路由黑洞。(新版IOS默認關閉)
第三方下一跳:(MA網絡)
RB .1---------AS100-------.2 RC
            |
          AS200
            |
            .3 RA
RA從RB上學到路由的下一跳是 RC 的地址 .2
(前提:RB傳遞給RA的路由是通過RA學到)
peer-group:(使用了peer-group的neighbor策略【如route-map使用不了OUT方向】)
優點:減少配置,節省資源。(路由器針對一個組開BUFF而不是單一鄰居)
router bgp 65123
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
neighbor internal peer-group
neighbor internal remote-as 65123
neighbor internal update-source Loopback0
neighbor internal next-hop-self
neighbor 2.2.2.2 peer-group internal
neighbor 2.3.3.3 peer-group internal
no auto-summary
BGP States、
Idle:查找NEIGHBOR在路由表中是否存在切可達。
Connect:TCP握手,該狀態存在與179方
Open sent:路由發送BGP路由信息(路由 路有能力)
Open confirm:鄰畍協商成功,如果沒有對Open message的應答,路由進入active狀態
Established:鄰畍建立,路由開始。
active和Idle的循環:
1:發包出去neighbor沒有回包。
2:neighbor地址不對
3:neighbor沒有關於本機neighbor的狀態(對端沒有指neighbor)
4:AS號指錯
BGP 認證 只支持MD5認證
neighbor [ip/peer-group] password [string]
BGP Clear
Hard reset(clear ip bgp *):直接DOWN鄰畍關係
Soft reset(clear ip bgp * soft [out/in}):重新發更新
   in方向依賴命令:neighbor [ip] soft-reconfiguration inbound
Route refreash: 等待自動更新
*~*~*~*~*~*~*~*~*~*~*~*~*~*~2008.10.21*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
BGP 源檢測:收到數據包源地址與neighbor地址匹配 才能建立連接。造成鄰居指LO口建立失敗。
    neighbor [ip] update-source [ip/int]
2AS有多條鏈路相連的時候考慮使用換回口建立EBGP (需要靜態或缺省路由)。
    neighbor [ip] ebgp-multihop [1-255]
    network [ip] nask [] 掩碼路由參考路由中的掩碼位數
idle 閒置狀態BGP無發包。
BGP的2種路由黑洞
4.4.4.4/32-R4----65004-AS-65123----R2-----R1-----R3-----65123-AS-65005----R5-5.5.5.5/32
1.R2 R3 啓用BGP,R1沒啓用。
2.R2 R3 饒過R1建立鄰畍,學到EBGP,R2 R3已優,R1沒有優。ping 4.4.4.4 source 5.5.5.5
  在R1處掉包
  R2配置:(R3類同)
router bgp 65123
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 65123
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
neighbor 4.4.4.4 remote-as 65004
neighbor 4.4.4.4 ebgp-multihop 2
neighbor 4.4.4.4 update-source Loopback0
neighbor 10.1.12.1 remote-as 65123
no auto-summary
!
R1上debug ip packet信息
========================================================
*Mar  1 00:52:36.187: IP: s=4.4.4.4 (Serial2/2), d=5.5.5.5, len 100, unroutable
*Mar  1 00:52:36.191: IP: s=10.1.12.1 (local), d=4.4.4.4, len 56, unroutable
R1#
*Mar  1 00:52:37.747: IP: s=10.1.12.1 (local), d=224.0.0.10 (Serial2/2), len 60, sending
broad/multicast
*Mar  1 00:52:37.823: IP: s=4.4.4.4 (Serial2/2), d=5.5.5.5, len 100, unroutable
*Mar  1 00:52:37.827: IP: s=10.1.12.1 (local), d=4.4.4.4, len 56, unroutable
*Mar  1 00:52:38.187: IP: s=10.1.12.2 (Serial2/2), d=224.0.0.10, len 60, rcvd 2
==========================================================
解決方法,使用FUL-MESH網絡,在R2  neighbor 10.1.12.1 next-hop-self (R3類同)
R2(config-router)#do show run | b r b              
router bgp 65123
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
neighbor 3.3.3.3 remote-as 65123
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
neighbor 4.4.4.4 remote-as 65004
neighbor 4.4.4.4 ebgp-multihop 2
neighbor 4.4.4.4 update-source Loopback0
neighbor 10.1.12.1 remote-as 65123
neighbor 10.1.12.1 next-hop-self
no auto-summary
!
  
=======================自己覺得比較經典的=================
環境同上TOP,首先在R1.R2.R3 IGP中發佈網段,但是不發佈R1的1.1.1.1 這樣在IGP中ping不通1.1.1.1網
段。 在如上配置完成BGP後,使R4的4.4.4.4 能通 R5的5.5.5.5之後。 在R1中的BGP進程裏發佈 network
1.1.1.1 mask 255.255.255.255 這樣在IGP中使用的是IBGP,IGP能PING通,也能通過EBGP讓R4 R5學習到。
且能PING通。原來以爲R2 R3 都會學到,但是不會優。對IBGP的認識有了新的進步。這個試驗也是IBGP比較
典型的應用。自己設計的,笑 :)
R2上route表部分
*Mar  1 01:01:26.939: %SYS-5-CONFIG_I: Configured from console by console
     1.0.0.0/32 is subnetted, 1 subnets
B       1.1.1.1 [200/0] via 10.1.12.1, 00:00:33
R4上route表部分
B       1.1.1.1 [20/0] via 2.2.2.2, 00:21:51
     2.0.0.0/32 is subnetted, 1 subnets
============================來個綜合應用的==================
和最前面一樣,饒過R1 即不使用
neighbor 10.1.13.1 next-hop-self 和 neighbor 10.1.12.1 next-hop-self
然後在R1上發佈1.1.1.1:
迷點:1.1.1.1 在R4和R5上能優 但是在R4上 ping 1.1.1.1 sou 4.4.4.4 不通
因爲 4.4.4.4 和 5.5.5.5 在R1中的bgp表裏面沒有優,放不進路由表。
問:沒有優的原因?
答:R1中4.4.4.4和5.5.5.5的下一條爲
Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                  0         32768 i
* i4.4.4.4/32       4.4.4.4                  0    100      0 65004 i
* i5.5.5.5/32       5.5.5.5                  0    100      0 65005 i
neighbor 10.1.12.1 next-hop-self 在的意義。及要在BGP表裏面能優的路由,IGP必須可達!
*~*~*~*~*~*~*~*~*~*~*~*~*~*~2008.10.14*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~

基於時間的ACL:
!
time-range work
absolute start 17:00 01 September 2008 end 18:00 21 September 2008
periodic daily 17:20 to 17:21
!
!
ip access-list extended work
permit icmp host 2.2.2.2 host 1.1.1.1 time-range work
!
----------------------------------------------------------------------------------
指定日誌服務器
logging 1.1.1.1
logging buffered [0-7]

*~*~*~*~*~*~*~*~*~*~*~*~*~*~2008.10.16*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
show ip bgp neighbors
show ip bgo summary

IBGP(水平分割) EBGP

router bgp [as-id]
neighbor [ip] remote [as-id]


      |-----ethernet------|
R1--|                           |--R2
      |-------serial--------|
雙鏈路雙鄰畍,neighbor指定的IP。一鏈路一鄰畍
使用LO口建立鄰畍的優勢,參考上圖。
路由必須可達。
使用LO口: neighbor [ip] ebgp-multihop [1-255]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章