一、技術介紹
使用BGP協議要將兩個網絡建立鄰居關系,因為衛星走的是單向鏈路,不能建立起鄰居關系,為了使BGP協議建立起鄰居關系,我們在路由器中使用了代表路由器本身地址的環路地址,環路地址是邏輯地址,這樣在BGP要建立鄰居是路由器間均使用環路地址,因為環路地址是雙向的。
在建立BGP動態路由時,要使路由器間處在一個自治域中,建立鄰居路由更新從環路地址更新。
由于BGP生成動態協議是建立在TCP的基礎上,它通過環路地址的鄰居關系建立雙向握手,從而生成動態路由,它的級別是200,所以ISDN備份的動態路由級別要大于200,級別越大優先級越低。
策略路由在主站和小站之間都不是不須的,為了使配置易于理解,建議配置策略路由。
在BGP發出握手請求時,要有一條路由到達對方路由器,我們的配置中使用默認路由到達DBN24 (假如沒有默認路由必須增加到對方環路地址的靜態路有),所以在DBN24上要添加到對方(遠程小站路由器)環路地址的靜態路由。
遠程小站路由器也必須配置一條到達主站環路地址的靜態路由(假如小站沒有默認路由)。
二、配置
路由器中建立環路地址:
Interface loopbackup 0
ip address 172.31.254.1 255.255.255.0
路由器中建立BGP 自治域:
Router bgp 65500
Network 172.16.5.0 mask 255.255.255.0 (本地網絡)
Network 172.16.6.0 mask 255.255.255.0 (本地網絡)
Neighbor 172.25.10.1 remote-as 65500 (使鄰居在同一個自治域)
Neighbor 172.25.10.1 update-source loopback0(設置鄰居更新在環路接口0)
Neighbor 172.25.10.1 route-map jinhua in (使用策略路由)
策略路由樣例:
route-map jinhua permit 5
macth ip address 30
set ip next-hop 172.16.5.200
策略路由觀察的訪問列表:
access-list 30 permit ip 172.19.10.0 0.0.0.255
三、輕易忽略的地方及問題
1、輕易忽略的地方是:在路由器中有了路由,因為路由是到dbn24的,所以不能忘了在dbn24中的各遠程點路由部分增加到對方環路地址的路由。
2、問題1:bgp中的network地址指的是什么地址?
答 :network地址指的是與鄰居網絡能建立通信的地址,在本網絡中指本地兩個網段地址。
3、問題2:為什么鄰居與本地網絡必須配置在同一個自治域內?
答:不在一個自治域的路由器必須是直接相聯的才可以互相通信。
4、問題3:路由表中配置了默認路由,同時還有浮動靜態ISDN路由,級別是201,那么靜態路由比默認路由級別高,為什么在建立TCP會話中不使用浮動靜態路由,而使用默認路由。
答:因為在BGP建立握手時,它尋找的目標地址是對方的環路地址,而ISDN的目標地址是對方的以太口地址,所以建立TCP握手使用默認路由(也可以設置一條指向對方環路地址的靜態路由,級別明顯高于ISDN路由,易于理解)。BGP建立動態路由的級別是200,在建立TCP握手后,它生成的路由表也是指向對方以太口地址,但它的優先級高于ISDN設置的路由級別201,而禁止ISDN路由生效,假如不能建立起指向對方以太口的BGP動態路由,那么在主站與小站的連接時,就是啟用ISDN路由,引起ISDN撥號。
5、問題4:為什么配置串口的時候,必須加上ignore-dcd、no keepalive、ip igmp unidirectional-link、ip multicast ttl-threshold 14、ip pim dense-mode、ip igmp static-group 239.16.5.144。
答:因為在衛星鏈路中路由器串口不發送cd信號必須忽略,keepalive是指第二層的保持活動協議,假如讓keepalive生效,那么它將監測某一鏈路的第二層雙向是否保持活動,由于衛星鏈路在串口是單向的(小站指向主站),它將會是串口down掉,ip igmp unidirectional-link標示串口是單向鏈路,ip multicast ttl-threshold 14標示讓小站的組播包的默認ttl-threshold為14,而讓小站的組播包不至于未到主站就被丟失,也不能設大于14的值。ip pim dense-mode啟用協議無關組播協議,ip igmp static-group 239.16.5.144標示小站的路由器加入239.16.5.144組播組。
四、BGP是否生效查詢
1、使用命令:show ip bgp neighbors 查詢bgp 狀態。(注重黑體)
tongji#sh ip bgp neighbors
BGP neighbor is 172.25.10.1, remote AS 65500, internal link
BGP version 4, remote router ID 172.25.10.1
BGP state = Established, up for 00:41:10
Last read 00:00:11, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(new)
Address family IPv4 Unicast: advertised and received
Received 1763 messages, 0 notifications, 0 in queue
Sent 1766 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Default minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 4, neighbor version 4
Index 1, Offset 0, Mask 0x2
1 accepted PRefixes consume 36 bytes
Prefix advertised 6, suppressed 0, withdrawn 2
Number of NLRIs in the update sent: max 2, min 0
Connections established 3; dropped 2
Last reset 00:41:43, due to User reset
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Local host: 172.31.254.1, Local port: 179
Foreign host: 172.25.10.1, Foreign port: 11045
Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)
Event Timers (current time is 0x644BFAC):
Timer Starts Wakeups Next
Retrans 48 1 0x0
TimeWait 0 0 0x0
AckHold 45 39 0x0
SendWnd 0 0 0x0
KeepAlive 0 0 0x0
GiveUp 0 0 0x0
PmtuAger 0 0 0x0
DeadWait 0 0 0x0
iss: 1548750689 snduna: 1548751630 sndnxt: 1548751630 sndwnd: 15985
irs: 127891366 rcvnxt: 127892303 rcvwnd: 15985 delrcvwnd: 399
SRTT: 771 ms, RTTO: 806 ms, RTV: 35 ms, KRTT: 0 ms
minRTT: 568 ms, maxRTT: 1032 ms, ACK hold: 200 ms
Flags: passive open, nagle, gen tcbs
Datagrams (max data segment is 536 bytes):
Rcvd: 90 (out of order: 0), with data: 45, total data bytes: 936
Sent: 87 (retransmit: 1, fastretransmit: 0), with data: 46, total data bytes: 940
2、使用命令:show ip route (注重黑體)
tongji#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is 172.16.5.200 to network 0.0.0.0
172.16.0.0/24 is subnetted, 7 subnets
C 172.16.4.0 is directly connected, FastEthernet0/0.4
C 172.16.5.0 is directly connected, FastEthernet0/0.5
C 172.16.6.0 is directly connected, FastEthernet0/0.6
C 172.16.1.0 is directly connected, FastEthernet0/0.1
C 172.16.2.0 is directly connected, FastEthernet0/0.2
C 172.16.3.0 is directly connected, FastEthernet0/0.3
S 172.16.100.0 [1/0] via 172.16.5.200
172.19.0.0/16 is variably subnetted, 11 subnets, 2 masks
B 172.19.10.0/24 [200/0] via 172.25.10.1, 00:57:53
C 172.19.101.24/30 is directly connected, Serial4/2
C 172.19.101.28/30 is directly connected, Serial4/3
C 172.19.101.16/30 is directly connected, Serial4/0
C 172.19.101.20/30 is directly connected, Serial4/1
C 172.19.101.8/30 is directly connected, Serial3/2
C 172.19.101.12/30 is directly connected, Serial3/3
C 172.19.101.0/30 is directly connected, Serial3/0
C 172.19.101.4/30 is directly connected, Serial3/1
C 172.19.101.32/30 is directly connected, Serial5/0
C 172.19.101.36/30 is directly connected, Serial5/1
172.20.0.0/24 is subnetted, 1 subnets
S 172.20.2.0 [1/0] via 10.0.20.2
172.31.0.0/24 is subnetted, 1 subnets
C 172.31.254.0 is directly connected, Loopback0
203.91.153.0/29 is subnetted, 1 subnets
C 203.91.153.240 is directly connected, FastEthernet0/0.5
210.74.232.0/32 is subnetted, 1 subnets
S 210.74.232.178 [1/0] via 172.16.1.28
10.0.0.0/24 is subnetted, 2 subnets
C 10.0.20.0 is directly connected, Dialer20
C 10.0.254.0 is directly connected, Dialer10
S* 0.0.0.0/0 [1/0] via 172.16.5.200
S 192.168.0.0/16 [1/0] via 172.16.1.253
S 202.120.176.0/20 [1/0] via 172.16.1.253
3、 更改bgp后,必須更新,使用命令:
clear ip bgp *
|
新聞熱點
疑難解答