Route-Reflector Client
Download
Report
Transcript Route-Reflector Client
Chapter 7.
Implementing BGP in
Scalable Networks
1
Table of Contents
•
•
•
•
•
•
•
Scalability Problems with IBGP
Route Reflectors
Policy Control and Prefix Lists
Multihoming
Redistribution with IGPs
Summary
LAB
2
Scalability BGP in Scalable
Networks
• BGP Split Horizon
3
BGP Split Horizon
A
X
AS 65000
B
C
BGP split horizon: IBGP로부터 알게 된 경로는 다른 IBGP에
Update 하지 않는다.
따라서 Full-Mesh IBGP가 필요하다.
4
Internal BGP
IBGP의 특성중 하나는 IBGP 라우터가 같은 AS내에 있는 IBGP 라우터로부터 네트웍의
변화된 정보를 전달받으면 그 정보를 자신과 IBGP Session을 맺은 다른 IBGP 라우터에
게 전달하지 않고 EBGP를 이용하여 다른 AS에 있는 EBGP라우터에게만 전달한다는 것
이다.
•AS200에서 어떤 변화가 발생되면 라우터 E는 그 사실을 라우터A에게 전달할 것이다.
네트웍의 변화에 대한 정보를 얻은 라우터A는 IBGP Session을 맺은 라우터B에게 전달
한다. 라우터B는 정보가 같은 AS에 있는 라우터A로부터 왔으므로 그 정보를 IBGP
Session을 맺은 라우터C에게 전달하지 않고 EBGP Session을 맺은 라우터 F에게만 전
달한다. 따라서 변화된 정보가 라우터 C를 통해 AS400에까지 전달되지 않는다. 그러므
로 라우터A와 라우터C간에 IBGP Session을 맺어 주어야만 한다.
5
Internal BGP
AS내에서 EBGP 라우터간에는 Full Mesh 형태로 IBGP Session을 모두
설정한다. (Route Reflector 또는 Confederation을 사용하면 Full Mesh를
피할 수 있다.)
6
Full-Mesh IBGP Problem
# IBGP sessions = n(n-1)/2
1000대의 IBGP router는 50만의
IBGP Session을 필요로 한다.
13 Routers =>
78 IBGP Sessions!
Full Mesh IBGP의 경우 Routing Information Loop을 피해야 한다.
다수의 TCP Session을 맺어야 하고, Routing Traffic을 여러 번
Replication해야 하므로 확장성이 없다.
이에 대한 Solution은 Route Reflector를 사용하는 것이다.
7
Route Reflectors
•
•
•
•
•
•
•
•
•
Route Reflector Benefits
Route Reflector Terminology
Route Reflector Design
Route Reflector Design Example
Route Reflector Operation
Route Reflector Migration Tips
Route Reflector Configuration
Route Reflector Example
Verfying Route Reflectors
8
Route Reflectors
Route Reflector
A
AS 65000
B
C
Route Reflector는 BGP Split Horizon Rule을 변경한다.
9
Route Reflector Benefits
IBGP Full-Mesh Problem을 해결한다. : 주로 ISP에서 사용
되며 다수의 IBGP Neighbor 설정을 해야 하는 경우에 사용된
다.
Packet Forwarding은 영향 받지 않는다.
Redundancy를 위하여 복수의 Route Reflector를 사용할 수
있다.
Route Reflector를 설정하지 않는 일반 BGP peer와도 공존
할 수 있다.
일반 BGP Peer를 쉽게 Migration할 수 있다.
10
Route Reflector Terminology
Route Reflector : IBGP를 통해서 알게 된 경로를 다른 IBGP Peer
Router에 Advertise하는 라우터이다.
Client : neighbor route-reflector-client 명령에 의해서 설정된다.
Cluster : Router Reflector와 Client의 묶음이다.
Nonclient : Reflector Client가 아닌, Route Reflector의 IBGP Peer
Router이다.
Originator-ID : Originator-ID 는 4-byte BGP attribute(optional,
nontransitive)로 route reflector에 의해서 만들어 진다.Local AS내에
서 Route의 Originator의 Router ID를 전달한다.
Cluster ID : 두개 이상의 Route Relector가 하나의 Cluster내에 있는
경우, 설정되는 Cluster의 식별자이다.이 경우 클러스터의 모든
Reflector에서 bgp cluster-id cluster-id명령을 사용하여 설정한다.
Originator-ID, Cluster ID ,Cluster List등은 Routing Loop을 방지하기
위하여 사용된다.
11
Route Reflector Design
AS를 복수의 Cluster로 나눈다. Cluster 당 최소 하나의 Route
Reflector와 Client 들을 둔다.
Route Reflector들은 Fully Mesh로 설정한다.
IBGP Session 설정을 위한 Next Hop과 Local Route를 전달하는 데
는 하나의 IGP를 사용한다.
X
X
AS 65000
A
C
B
D
IBGP Connections
EBGP Connections
E
F
G
H
12
Route Reflector Operation
Reflector는 Reflector의 Client와 Non-Client 모두로 부터
Update를 받는다.
Client로부터의 Update는 Client와 Non-Client 모두로
Update 한다.(Originator에는 Update 하지 않는다.)
Non-Client로부터의 Update는 Client들에게만 Update 한
다.
EBGP peer로 부터의 Update는 Client와 Non-Client 모두
로 Update 한다.
Non-Client로부터의 Update가 다른 Non-Client로는 전달
되지 않는다.
13
Route Reflector Migration Tips
Route Reflector를 두는 위치는 Physical Topology에 따른다.
Route Reflector를 두는 위치가 Packet Forwarding 자체는 영향
받지 않는다.
한번에 하나씩 Route Reflector를 설정한다.
중복된 IBGP Session을 제거한다.
Cluster 별로 하나의 Route Reflector를 둔다.
14
Advanced Route Reflectors Example
!Router C
router bgp 100
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 route-reflector-client
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 route-reflector-client
neighbor 7.7.7.7 remote-as 100
neighbor 4.4.4.4 remote-as 100
neighbor 8.8.8.8 remote-as 200
!Router B
router bgp 100
neighbor 3.3.3.3 remote-as 100
neighbor 12.12.12.12 remote-as 300
Router D
router bgp 100
neighbor 5.5.5.5 remote-as 100
neighbor 5.5.5.5 route-reflector-client
neighbor 6.6.6.6 remote-as 100
neighbor 6.6.6.6 route-reflector-client
neighbor 3.3.3.3 remote-as 100
neighbor 7.7.7.7 remote-as 100
15
Route Reflector Configuration
Router(config-router)#neighbor ip-address route-reflector-client
Router를 BGP route reflector로 설정하고 Neighbor를 route
reflector Client로 설정한다.
Route Reflector
A
AS 65000
AS 65500
B
172.16.12.1
C
AS 64500
172.16.17.2
RTRA(config)#router bgp 65000
RTRA(config-router)#neighbor 172.16.12.1
RTRA(config-router)#neighbor 172.16.12.1
RTRA(config-router)#neighbor 172.16.17.2
RTRA(config-router)#neighbor 172.16.17.2
remote-as 65000
route-reflector-client
remote-as 65000
route-reflector-client
16
Using a Cluster List
Router D, E, F, H는 동일 Cluster에 속하며 Router D,H는 Route Reflector이다.
Routers D와 H는 AS100내의 다른 Router Reflector(Router C,G)와 Full Mesh로 설정
되어 있다. 이 경우, Router D가 Down 되면 Router H가 있어 Route Reflection에 문제
17
가 없다.
Using a Cluster List
!Router C
router bgp 100
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 route-reflector-client
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 route-reflector-client
neighbor 4.4.4.4 remote-as 100
neighbor 7.7.7.7 remote-as 100
neighbor 10.10.10.10 remote-as 100
neighbor 8.8.8.8 remote-as 200
!Router F
router bgp 100
neighbor 10.10.10.10 remote-as 100
neighbor 4.4.4.4 remote-as 100
neighbor 13.13.13.13 remote-as 500
!Router D
neighbor 10.10.10.10 remote-as 100
neighbor 5.5.5.5 remote-as 100
neighbor 5.5.5.5 route-reflector-client
neighbor 6.6.6.6 remote-as 100
neighbor 6.6.6.6 route-reflector-client
neighbor 3.3.3.3 remote-as 100
neighbor 7.7.7.7 remote-as 100
neighbor 11.11.11.11 remote-as 400
bgp cluster-id 10
!Router H
router bgp 100
neighbor 4.4.4.4 remote-as 100
neighbor 5.5.5.5 remote-as 100
neighbor 5.5.5.5 route-reflector-client
neighbor 6.6.6.6 remote-as 100
neighbor 6.6.6.6 route-reflector-client
neighbor 7.7.7.7 remote-as 100
neighbor 3.3.3.3 remote-as 100
neighbor 9.9.9.9 remote-as 300
18
bgp cluster-id 10
Using a Cluster List
일반적으로 하나의 Cluster는 하나의 Route Reflector를 갖는다. 이런 경우
Cluster는 Route Reflector의 Router ID에 의해서 식별된다.
Redundancy를 주기 위해서 Cluster는 두개 이상의 Route Reflector를 가질 수 있
다.이런 경우에는 Cluster 내의 모든 Route Reflector는 4-byte cluster ID를 설정
해 주어야 한다.Cluster ID는 동일 Cluster 내의 Route Reflector가 동일 Cluster 내
의 다른 Route Reflector의 Update를 식별하기 위해서 사용된다.
Route Reflector가 받은 Update의 Cluster ID가 동일한 경우 해당 Update는 동
일한 Cluster에 속하는 다른 Route Reflector의 Update이므로 무시된다.
19
Verifying Route Reflectors
RTRA# sh ip bgp neigh
BGP neighbor is 172.16.12.1, remote AS 65000, internal link
Index 1, Offset 0, Mask 0x2
Route-Reflector Client
BGP version 4, remote router ID 192.168.101.101
BGP state = Established, table version = 1, up for 00:05:42
Last read 00:00:42, hold time is 180, keepalive interval is 60 seconds
Minimum time between advertisement runs is 5 seconds
Received 14 messages, 0 notifications, 0 in queue
Sent 12 messages, 0 notifications, 0 in queue
Prefix advertised 0, suppressed 0, withdrawn 0
Connections established 2; dropped 1
Last reset 00:05:44, due to User reset
1 accepted prefixes consume 32 bytes
0 history paths consume 0 bytes
--More--
20
Policy Control and Prefix Lists
•
•
•
•
•
•
Prefix List Characteristics
Filtering with Prefix Lists
Configuring Prefix Lists
Prefix List Example
Verifying Prefix Lists
Verifying Prefix Lists Example
21
p390
Policy Control and Prefix Lists
Neighbor Router간에 Routing Information Update를 제한하기
위해서 Distribute lists (using access lists)와 Prefix lists를 사용
할 수 있다.
BGP의 경우 Distribute List의 사용은 Prefix Lists의 사용으로 바
뀌고 있다. Prefix lists의 사용은 Cisco IOS Release 12.0 이상에
서 가능하다.
22
distribute-list
!Router C
router bgp 300
network 170.10.0.0
neighbor 3.3.3.3 remote-as 200
neighbor 2.2.2.2 remote-as 100
aggregate-address 160.0.0.0 255.0.0.0
neighbor 2.2.2.2 distribute-list 1 out
!
access-list 1 deny 160.10.0.0 0.0.255.255
access-list 1 permit 0.0.0.0 255.255.255.255
23
Prefix List
172.30.0.0
192.168.2.0
AS 65000
AS 65500
B
10.10.10.2
C
10.10.20.2
O 172.0.0.0/8
172.30.0.0/16
X 172.30.0.0/16
10.10.20.1
10.10.10.1
RtrA(config)#router bgp 64500
RtrA(config-router)#network 192.168.1.0
A
AS 64500
192.168.1.0
RtrA(config-router)#neighbor 10.10.10.2 remote-as 65000
RtrA(config-router)#neighbor 10.10.20.2 remote-as 65500
RtrA(config-router)#aggregate-address 172.0.0.0 255.0.0.0
RtrA(config-router)#neighbor 10.10.10.2 prefix-list superonly out
RtrA(config-router)#exit
RtrA(config)#ip prefix-list superonly permit 172.0.0.0/8
RtrA(config)#ip prefix-list superonly description only permit supernet
Router A는 172.30.0.0/16이 아니라 172.0.0.0/8 네트워크 만을 Update한다.
24
Configure Route Filtering by Specifying a Group of Prefixes
The following example permits routes with prefix length up to 24 in network 192/8:
ip prefix-list abc permit 192.0.0.0/8 le 24
The following example denies routes with prefix length greater than in 25 in 192/8:
ip prefix-list abc deny 192.0.0.0/8 ge 25
The following example permits routes with prefix length greater than 8 and less than
24 in all address space:
ip prefix-list abc permit 0.0.0.0/0 ge 8 le 24
The following example denies routes with prefix length greater than 25 in all
address space:
ip prefix-list abc deny 0.0.0.0/0 ge 25
This example denies all routes in 10/8, since any route in the Class A network
10.0.0.0/8 is denied if its mask is less than or equal to 32 bits:
ip prefix-list abc deny 10.0.0.0/8 le 32
The following example denies routes with a mask greater than 25 in 204.70.1/24:
ip prefix-list abc deny 204.70.1.0/24 ge 25 (minium prefix length)
The following example permits all routes:
ip prefix-list abc permit 0.0.0.0/0 le 32 (maxmum prefix length)
25
Prefix List Characteristics
Cisco IOS Release 12.0 이상에서 가능하다.
Prefix list는 Access-List를 사용한 Distribution-List를 대체할 수 있다.
Access-List의 사용에 비해 많은 이점이 있다.
•Performance 향상 효과가 크다.
•Incremental Modification을 지원한다.(일반 Access-List를 수정하기 위해
서는 전체 Access-List를 지우고 다시 만들어야 한다.)
•명령이 보다 User-Friendly하다.(Extended Access-List를 사용하여 BGP
Update를 Filtering하기는 이해 및 사용이 어렵다.)
•보다 큰 유연성을 제공한다.
26
Filtering with Prefix Lists
Empty Prefix List는모든 Route를 허용한다.
Permit 은 해당 Route를 Update시에 사용함을 의미한다.
Router는 Prefix List Statement를 낮은 Sequence 번호의
Statement 부터 Top-Down 방식으로 검색한다.
Match가 있으면 나머지 Statement는 무시된다.
Implicit Deny가 Prefix List의 마지막에서 적용된다.
27
Configuring Prefix Lists
Prefix List를 만든다.
Router(config)#ip prefix-list list-name [seq seq-value] {deny | permit}
network/len [ge ge-value] [le le-value]
•le(Less than or Equal : 이하), ge(Greater Than or Equal:이상)을 사용하여
Permit 또는 Deny하는 Range를 조정할 수 있다.(Cisco Press, BSCN P.394)
만든 Prefix List를 BGP Neighbor 설정에 포함시킨다.
Router(config-router)#neighbor {ip-address | peer-group-name} prefix-list
prefix-listname {in | out}
Sequence number
Sequence number는 Default로 자동으로 만들어 진다. Default Increment는 5
이다.(5,10,15,…)
각각의 Entry를 유연하게 Insert 및 Delete 할 수 있게 한다.
28
Prefix List
172.30.0.0
192.168.2.0
AS 65000
AS 65500
B
10.10.10.2
C
10.10.20.2
O 172.0.0.0/8
172.30.0.0/16
X 172.30.0.0/16
10.10.20.1
RtrA(config)#router bgp 64500
10.10.10.1
A
AS 64500
RtrA(config-router)#network 192.168.1.0
192.168.1.0
RtrA(config-router)#neighbor 10.10.10.2 remote-as 65000
RtrA(config-router)#neighbor 10.10.20.2 remote-as 65500
RtrA(config-router)#aggregate-address 172.0.0.0 255.0.0.0
RtrA(config-router)#neighbor 10.10.10.2 prefix-list superonly out
RtrA(config-router)#exit
RtrA(config)#ip prefix-list superonly permit 172.0.0.0/8
RtrA(config)#ip prefix-list superonly description only permit supernet
29
Verifying Prefix Lists
Prefix List를 Display 한다.
Router#show ip prefix-list
Prefix List Entry에 대한 Hit Count를 Clear 시킨다.
Router#clear ip prefix-list
30
Verifying Prefix Lists
RtrA #show ip prefix-list detail
Prefix-list with the last deletion/insertion: superonly
ip prefix-list superonly:
Description: only permit supernet
count: 1, range entries: 0, sequences: 5 - 5, refcount: 1
seq 5 permit 172.0.0.0/8 (hit count: 0, refcount: 1)
31
Back Door Example
EIGRP (90)
160.10.0.0
(20) -> (200)
어떤 Route가 EBGP로 부터 Update가 되면 Distance (20)으로 Routing Table에 Install
된다.
두 AS간에 IGP Backdoor를 설정할 수 있다. 이 경우 IGP-Learned Backdoor Route가
EBGP-Learned Route에 대해 선호된다.
network backdoor 명령을 사용하면 Router는 EBGP-learned route는 distance( 200)
으로 설정된다.
예를 들어 IGP를 EIGRP로 하여 Backdoor를 설정할 경우, EIGRP를 통해서 알게 된 네트
워크 경로가 Distance(90)으로 Routing Table에 Install 되어 Traffic을 Forward한다.
Enhanced IGRP-learned route가 Down 되는 경우에 EBGP-learned route가 IP routing
table에 Install되어 Traffic을 Forward 시킨다.
32
Back Door Example
!Router A
router eigrp 10
network 150.10.0.0
!
router bgp 100
neighbor 2.2.2.1 remote-as 300
network 160.10.0.0 backdoor
33
Multihoming
• Types of Multihoming
• Default Routes from All Providors
• Customer and Default Routes from All
Providors
• Full Routes from All Providers
• Configuring Weight and Local Preference
• Multihoming Examples
34
p398
Multihoming
두개 이상의 ISP에 연결하는 것은 Reliability 및 Performance 향
상을 제공한다.
•Reliability : 하나의 ISP와의 Connection이 Fail되는 경우에도 다
른 ISP와의 연결을 사용할 수 있다.
•Performance : 두개의 ISP를 통해 경로를 설정할 수 있으므로
Destination Network에 대해서 최적의 Path를 선택하게 할 수 있다.
Types of Multihoming
ISP 들과의 연결에 세가지 방식이 사용될 수 있다.
•모든 Provider에 Default Route를 사용한다.
•Specific routes와 default route를 병행 사용한다.
•모든 Provider로 부터 Full route를 Update 받는다.
35
p398
Default Routes from All Providers
Memory 및 CPU 사용을 줄일 수 있다.
Provider의 선택은 Default Route에 이르기 위한 IGP Metric에 의해서 결정된다.(AS65500에
서 Router C의 Default Route는 Router C에서 Router A와 Router B가 제공하는 각각의
Default Route에 이르는 IGP Metric에 의해서 결정된다.통상 ip route 명령으로 Default
Route를 설정시 A Router와 B Router에 대해서 상이한 Metric 값을 사용한다.)
AS는 자신의 네트워크에 대한 모든 Route를 ISP에 전달한다.Inbound Path는 Internet의
BGP Process에 의해서 결정된다.
AS 64500
172.16.0.0/16
ISP
ISP
AS
65250
AS 65000
D
E
0.0.0.0
0.0.0.0
A
B
AS 65500
C
C Chooses Lowest
36
IGP Metric to Default
Customer and Default Routes from All Providers
중간 정도의 Memory, CPU 사용을 한다.
많은 Traffic 교환이 있는 AS에 대해서는 Specific Route를 사용하고 나머지의 경우는
Default Route를 병행 사용한다.(172.16.0.0 네트워크에는 Router A를 거쳐서 가게 한
다.)
Best Path는 통상 AS-path가 짧은 Path로 결정된다.
Default Route에 대한 선택은 IGP Metric에 의존한다.
Customer
AS 64500
172.16.0.0/16
ISP
AS 65000
D
C Chooses
Shortest ASPath
E
A
AS 65500
C
ISP
AS
65250
B
37
Customer and Default Routes from All Providers
router bgp 65500
neighbor 4.4.4.4 route-map toright in
Ip prefix-list customer permit 172.16.0.0/16
Route-map toright permit 10
match-ip address prefix-list customer
set local-preference 800 (default는 100)
Router C의 BGP table
*>172.160.0.0/16 B LocPrf=800
172.160.0.0/16 A LocPrf=100
Customer
AS 64500
172.16.0.0/16
ISP
AS 65250
ISP
AS 65000
D
C Chooses Highest
Local Preference
3.3.3.3
A
E
AS 65500
C
B
4.4.4.4
Local Preference = 800
for 172.16.0.0/16
38
Full Routes from All Providers
높은 정도의 Memory, CPU 사용을 한다.
모든 Destination에 대해서 BGP Best Path를 선택한다.
Best Path는 통상 AS-path가 짧은 Path로 결정된다.
Weight, Local-Preference를 사용한 Manual Tuning도 가능하다.
AS 64500
AS 65510
ISP
ISP
AS 65000
AS 65250
D
E
AS 65500
B
A
C Chooses
Shortest AS-path
C
39
p403
Configuring Weight and Local Preference
Router(config-router)#neighbor {ip-address | peer-groupname} weight weight
Neighbor와의 Connection에 Weight을 할당한다.
0-65535의 Range가 가능하며 Defualt는 Local Route에 대해서는 32768
이며 Other Route에는 0 값을 갖는다.
Router(config-router)#bgp default local-preference value
Default Local Preference Value를 바꾼다.
Local Prefernce는 Weight Attribute가 동일할 때 Tie Breaker로 사용된다.
Default Local Preference는 100이다.
40
p404
Multihoming Example
172.25.0.0
AS 65500
ISP
E
172.20.0.0
172.30.0.0
AS 65000
ISP
AS 65250
B
10.10.10.2
C
10.10.20.1
10.10.10.1
AS 64500
10.10.20.2
A
41
Configuration(No Tuning)
RtrA(config)#router bgp 64500
RtrA(config-router)#network 10.10.10.0 mask 255.255.255.0
RtrA(config-router)#network 10.10.20.0 mask 255.255.255.0
RtrA(config-router)#neighbor 10.10.10.2 remote-as 65000
RtrA(config-router)#neighbor 10.10.20.1 remote-as 65250
RtrA#show ip bgp
BGP table version is 7, local router ID is 172.16.10.1
Status codes: s suppressed, d damped, h history, * valid, > best, i internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop
Metric LocPrf Weight Path
*> 10.10.10.0/24
0.0.0.0
0
32768 i
*> 10.10.20.0/24
0.0.0.0
0
32768 i
* 172.20.0.0
10.10.20.1
0 65250 65000
*>
10.10.10.2
0
0 65000 i
*> 172.25.0.0
10.10.10.2
0 65000 65500
*
10.10.20.1
0 65250 65500
* 172.30.0.0
10.10.10.2
0 65000 65250
*>
10.10.20.1
0
0 65250 i
175.25.0.0 Route는 동일한 AS_Path를 갖는 두개의 경로중 BGP Router ID가 낮은 쪽
(10.10.10.2의 Router ID는 172.20.0.0이다.)을 택한 것으로 볼 수 있다.
42
i
i
i
i
Configuration( Change Weights)
RtrA(config)#router bgp 64500
RtrA(config-router)#network 10.10.10.0 mask 255.255.255.0
RtrA(config-router)#network 10.10.20.0 mask 255.255.255.0
RtrA(config-router)#neighbor 10.10.10.2 remote-as 65000
RtrA(config-router)#neighbor 10.10.10.2 weight 100
RtrA(config-router)#neighbor 10.10.20.1 remote-as 65250
RtrA(config-router)#neighbor 10.10.20.1 weight 150
RtrA#sh ip bgp
BGP table version is 9, local router ID is 172.16.10.1
Status codes: s suppressed, d damped, h history, * valid, > best, i internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network
Next Hop
Metric LocPrf Weight Path
*> 10.10.10.0/24
0.0.0.0
0
32768 i
*> 10.10.20.0/24
0.0.0.0
0
32768 i
*> 172.20.0.0
10.10.20.1
150 65250 65000
*
10.10.10.2
0
100 65000 i
*> 172.25.0.0
10.10.20.1
150 65250 65500
*
10.10.10.2
100 65000 65500
*> 172.30.0.0
10.10.20.1
0
150 65250 i
*
10.10.10.2
100 65000 65250
43
i
i
i
i
Redistribution with IGPs
• Advertising Networks into BGP
• Advertising from BGP into an IGP
44
p407
Advertising Networks into BGP
AS 내부의 네트워크를 BGP로 Advertising 하는 방법에는 세가지 가있다.
•Network 명령을 사용한다.
•Null 0를 사용하여 Static Route를 만들고 Static Route를 Redistribution
한다.
•Dynamic IGP route를 Redistributing한다.Route에 대한 Instability를 초
래할 수 있어 Recommended 되지 않는다.
IGP
Routing
Protocol
IP
BGP
BGP
Routing
Protocol
45
p408
Redistributing Static Routes into BGP
router bgp 64500
redistribute static
!
ip route 192.168.0.0 255.255.0.0 null 0
IP Table의 Specific Route 대신에 Aggregate Route를 Advertise 하기
위해서 사용된다.
어떤 Route가 BGP로 Redistribute되려면 해당 Route는 IP Table에 미
리 존재해야 한다. Null 0 Static Route는 IP Table에 Route를 생성한다.
aggregate-address 명령을 대신 사용할 수도 있다.
aggregate-address 192.168.0.0 255.255.0.0
46
Redistributing Dynamic IGP Routes into BGP
Unstable Route를 유발시킬 수 있으므로 권고되지 않는다.(IGP
Route의 모든 변화(Link Down등 )가 BGP Update를 유발한다.)
Local Route만을 포함 시키고, 다른 AS에서의 Route는 Filtering 한
다.(Filtering을 안하면 Loop이 발생할 수 있다.)=> Configuration이
복잡해 질 수 있다.
두개 이상의 Boundary Router가 Redistribution 하는 경우, 하나의
Boundary Router가 Redistribution한 Routing Information이 다시
Redistribution을 통해서 Source 쪽으로 유입되어 라우팅 루프가 발생할
수 있다.
47
p409
Advertising from BGP into IGP
ISP의 AS에 대해서는 BGP로부터의 Route를 Redistribution을 하
지 않는다.
다른 AS에 대해서는 Filtering을 병행하여 BGP로부터의 Route를
Redistribution 한다.
Redistribution 대신에 Default Route를 많이 사용한다.
48
No Redistribution from BGP into IGP (ISP의 경우)
모든 라우터가 BGP를 실행하는 경우 즉 모든 라우터가 IBGP Full
Mesh로 연결된 경우에 IBGP는 exterior route를 전달하며, IGP는
IBGP 라우터간의 연결을 의한 local information과 next-hop
information 만을 전달하면 된다. 이 경우 BGP로부터의 Route를
IGP로 Redistribution 할 필요가 없다.
IBGP간 Full Mesh Direct 연결로 중간에 IGP 라우터가 개입하지
않으므로 모든 라우터에서 no synchronization을 설정한다.
IGP에 최소한의 Route를 전달하며, BGP Convergence가 빠르다.
49
Redistribution from BGP into IGP(Non-ISP의 경우)
NON-ISP에서 모든 라우터가 BGP 라우터가 아닌 경우에 BGP
Route을 IGP로 Redistribution 할 수 있다.
많은 Route가 유입되므로 Filtering이 필요할 수 있다.
대안으로 Default Route를 사용할 수 있다.
50
BGP Filtering
Prefix Filtering
AS_path Filtering
Route Map Filtering
Community Filtering
51
Prefix Filtering
특정 Neighbor와의 Routing Update(inbound 또는 outbound Update)에서 특정
Route를 Filtering할 수 있다.
!Router C
router bgp 300
network 170.10.0.0
neighbor 3.3.3.3 remote-as 200
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 distribute-list 1 out
!
access-list 1 deny 160.10.0.0 0.0.255.255
access-list 1 permit 0.0.0.0 255.255.255.255
neighbor distribute-list router
configuration 명령과 access list 1 설
정은 Router C 가 neighbor 2.2.2.2
(Router A)에 Routing Update하는데
있어 network 160.10.0.0을 Update하
지 않도록 한다.
52
AS_Path Filtering
AS_path attribute에 기준하여 Inbound, Outbound Update를 제한할 수 있다.
Access-List를 사용한다.
!Router C
neighbor 3.3.3.3 remote-as 200
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 filter-list 1 out
!
ip as-path access-list 1 deny ^200$
ip as-path access-list 1 permit .*
Access List 1은 AS_Path가 200으로 시작해서 200으로 끝나는 즉 AS_Path가 200이 전
부인(AS 200이 Route의 Originator인) Route를 Update 하지 않는다.
^: start, $: end
따라서 160.0.0.0 Route는 Router C에서 Router A로 Update 되지 않는다.
Access List 1은 AS400으로 부터의 Route는 Filtering 하지 않는다.
period (.) symbol은 모든 Character를 의미하며 asterisk (*) symbol은 Character
반복을 의미한다. 따라서 .* 는 모든 AS_Path를 의미한다.
53
Regular Expression
•regular expression
.
임의의 문자로 공백도 인정됨
*
특정 형태가 0번 이상 반복
+
특정 형태가 1번 이상 반복
?
특정 형태가 1번 이하 반복
[]
한 문자의 범위를 지정
한 문자의 범위를 지정할때 시작과 끝을 분리
^
문자열의 시작
$
문자열의 끝
_
쉼표, {, }, (, ), ^, $, 공백
•regular expression 예
a.baab, acb, a b, a+b
a*
없음, a, aa, aaa, .....
(ab)*
없음, ab, abab, ababab, .....
.*
없음, 어떤 문자열이라도 상관없음
a?bb
bb, abb
[a-z]b
ab, bb, cb, ..., zb
•as_path에 regular expression 적용 예
^100$
100
100
100, 100 200, 200 100 300, 200 300 100, .... paths including 100
^100
100, 100 200, 100 200 300, ......
^100.*
^100
^$
자신의 AS에서 발생한 것
_100_
^100$, 100, ^100, ^100.*, 100$를 모두 포함
54
Route Map Filtering
!Router C
router bgp 300
network 170.10.0.0
neighbor 3.3.3.3 remote-as 200
neighbor 3.3.3.3 route-map STAMP in
!
route-map STAMP permit 10
match as-path 1
set weight 20
!
ip as-path access-list 1 permit ^200$
ip as-path access-list 1 permit ^200$ 의 설정은 단지 AS200 만이 AS_Path인 Route를 의
미하며 Route Map 설정에 의해 해당 루트가 Inbound Update시에 Weight 값이 20으로 설
정되게 한다.다른 모든 루트의 Router C로의 Update는 금지 된다.
55
Route Map Filtering
!Router C
router bgp 300
network 170.10.0.0
neighbor 3.3.3.3 remote-as 200
neighbor 3.3.3.3 route-map STAMP
in
!
route-map STAMP permit 10
match as-path 1
set weight 20
!
route-map STAMP permit 20
match as-path 2
!
route-map STAMP permit 30
set weight 10
!
ip as-path access-list 1 permit ^200$
ip as-path access-list 2 deny _400_
Router B로 부터 Router C로의 Inbound Update에 있어 AS200이 AS_Path로 된 Route
는 Weight Value가 20으로 설정되어 Update 되며 AS400을 AS_Path로 포함하는 Route는
Update가 금지 되고, 다른 모든 Route는 Weight Value가 10으로 설정되어 Update 된다.
56
Route Map Filtering
!Router C
router bgp 300
network 170.10.0.0
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 route-map SETPATH
out
!
route-map SETPATH permit 10
set as-path prepend 300 300
prepend keyword를 사용한 set as-path route map 명령은 Router C가 Router A에
Update시에 AS_Path에 추가로 300 300을 추가한다. 170.10.0.0 네트워크의 경우,
AS 600에서 Router A를 경유하는 AS_Path가 100.300,300,300으로 되며, AS 400을 경
유하는 AS_Path는 400,200,300으로 되어 172.10.0.0 네크워크에 대한 AS 600에서의
Path는 AS400을 경유하는 Route로 설정된다.
57
Community Filtering
Router C에서 Router A로 Update되는 모든 Route의 Community Attribute를 300
으로 하여 Update하게 한다.
!Router C
router bgp 300
network 170.10.0.0
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 route-map SETCOMMUNITY
out
!
route-map SETCOMMUNITY permit 10
match ip address 1
set community 300
!
access-list 1 permit 0.0.0.0 255.255.255.255
58
Community Filtering
Router B에서 Neighbor 3.3.3.1(Router
C)에 대한 설정에 send-community가 있
어 Router B는 Route Update시에
Community Atribute를 포함하여 Update
한다.
Route Map 설정에 의해 모든 루트에 대
해서 no-export Option으로 Community
Attribute를 정의하므로 Router A에 대해
Router C가 Route를 Update시에
Community Attribute는 Update 하지 않는
다.
!Router B
router bgp 200
network 160.10.0.0
neighbor 3.3.3.1 remote-as 300
neighbor 3.3.3.1 send-community
neighbor 3.3.3.1 route-map SETCOM out
!
route-map SETCOM permit 10
match ip address 1
set community no-export
!
route-map SETCOM permit 20
!
access list 1 permit 0.0.0.0 255.255.255.255
No-export : don’t advertise to eBGP peers
No-advertise : don’t advertise to any peer
59