223
1 Chapter 6. Configuring Basic Border Gateway Protocol

Chapter 6. Configuring Basic Border Gateway Protocol

  • Upload
    gates

  • View
    63

  • Download
    7

Embed Size (px)

DESCRIPTION

Chapter 6. Configuring Basic Border Gateway Protocol. Table of Contents. BGP Overview When to Use BGP When Not to Use BGP BGP Terminology and Concepts BGP Operation Configuring BGP Verifying BGP Smmary LAB. BGP Overview. Autonomous Systems BGP Use - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter 6. Configuring Basic Border Gateway Protocol

1

Chapter 6.Configuring Basic Border Gateway

Protocol

Page 2: Chapter 6. Configuring Basic Border Gateway Protocol

2

Table of Contents

• BGP Overview• When to Use BGP• When Not to Use BGP• BGP Terminology and Concepts• BGP Operation• Configuring BGP• Verifying BGP• Smmary• LAB

Page 3: Chapter 6. Configuring Basic Border Gateway Protocol

3

BGP Overview

• Autonomous Systems• BGP Use• Comparison with Other Scalable Routing

Protocols

Page 4: Chapter 6. Configuring Basic Border Gateway Protocol

4

Autonomous System 65000 Autonomous System 65500

IGP: RIP, IGRP, OSPF, EIGRP

EGP: BGP

Autonomous System

AS(Autonomous System) 란 기술적으로 단일한 관리체제 안에 있는 네트워크의 집합이다 . IGP 는 AS 안에서 작동하는 라우팅 프로토콜이다 . EGP 는 AS 와 AS 를 연결하는 라우팅 프로토콜이다 . 동일한 AS 내에서 RIP 와 IGRP 를 구성하면

RIP routing domain IGRP routing domain

AS Number 가 다른 두 네트웍 간에 재분배를 통하여 Routing Information 을 주고 받을 수 있다 . (BGP 가 반드시 필요한 것은 아님 )

Page 5: Chapter 6. Configuring Basic Border Gateway Protocol

5

IANA(Internet Assigned Number Authority) 가 AS Number 를 할당한다 . EIGRP, IGRP 등은 AS 번호를 관리자가 임으로 할당하나 BGP 의 경우에는 IANA 에서 AS 번호를 할당 받아야 한다 .

Autonomous System 지시자는 16-bit number 로 1-65535 의 범위를 갖는다 . 64512 – 65535 는 private use 로 예약되어 있다 . (65535-1024=64512 ~ 65535))

EGP 는 AS 사이에 Packet 을 Routing 하기 위해서 사용된다 . BGP 는 EGP 중의 하나로 BGP 의 최근 버전은 BGP-4 이다 .

BGP4 는 현재의 Internet 에서 ISP 와 ISP 를 연결하기 위해서 , Enterprise 를 ISP 와 연결하기 위해서 널리 사용된다 .

IANA 에서 할당한 AS 번호는 BGP 와 같은 EGP 를 사용하는 데 필요하다 .

AS(Autonomous System)

Page 6: Chapter 6. Configuring Basic Border Gateway Protocol

6

BGP B

BGP

AS65500

AS65250

BGPAS64500

AS65000

A

B C

F

ED

BGP Use

AS 간에 BGP 가 사용된다 .

BGP 는 Loop-Free Routing Information 의 교환을 보장한다 .

Page 7: Chapter 6. Configuring Basic Border Gateway Protocol

7

IGP B

Internet

AS300

BGP

AS100

AS200

A

B C

F

E

AS100 에 있는 정보는 AS200 에 의해 재분배된 다음 internet 으로 전달된다 .

Internet 측에서 192.168.1.0 은 AS200 에 속하는 것으로 간주

AS100 과 같이 독자적인 라우팅 정책이 필요하지 않을 경우는 BGP를 이용하여 접속하지 않아도 된다 .

BGP192.168.1.0

BGP 는 Policy Routing Protocol : Routing 이 라우터에 의해 결정되는 것이 아니라 네트웍 운영자의 정책에 의해 결정

BGP Use

Page 8: Chapter 6. Configuring Basic Border Gateway Protocol

8

IGP B

Internet

AS300

BGP

AS100

AS200B C

F

E

AS100 에 있는 네트웍 정보가 AS300 을 통해 외부로 전달되기 때문에 문제가 발생한다 . 즉 , Internet 입장에서 볼때 AS100 에 있는 192.168.1.0 이 AS200 에도 속하고 AS300 에도 속하는 것처럼 보이기 때문이다 .

BGP192.168.1.0

AS100 이 IGP 로 AS200 과 접속한 상태에서 AS300 으로 직접 갈 수 있는 경로를 추가로 구성

D

A

IGP

192.168.1.0: AS200

192.168.1.0: AS300

BGP Use

Page 9: Chapter 6. Configuring Basic Border Gateway Protocol

9

IGP B

Internet

AS300

BGP

AS100

AS200B C

F

E

AS200 은 AS300 에 대한 정보를 AS100 을 통해 받기를 원하지 않을 수 있다 . 그러나 , AS200 은 AS100 을 통해 AS300 에 대한 정보를 전달을 받고 있으며 , AS200 이 AS100 과 IGP 로 접속되어 있기 때문에 원하는대로 Routing 을 처리하기는 쉽지 않다 .

BGP

192.168.1.0

AS100 과 AS300 간 BGP 로 구성

D

ABGP

BGP Use

Page 10: Chapter 6. Configuring Basic Border Gateway Protocol

10

AS100Internet 경로는 RouterB 를 통해 AS200 을 경유AS300 으로 갈때는 RouterD 를 통해 간다 .

AS200AS100 에 있는 네트웍은 AS200 을 경유하여 Internet 으로 갈 수 있다 .AS300 은 AS100, AS200 을 경유하여 인터넷으로 갈 수 없다 .AS300 과의 통신은 internet 을 경유하도록 한다 .

AS300AS100 에 있는 네트웍은 AS300 으로 접속할 수 있다 .AS100 은 AS300 을 경유하여 인터넷으로 갈 수 없다 .AS200 은 AS100, AS300 을 경유하여 인터넷으로 갈 수 없다 .AS200 과의 통신은 인터넷을 경유하도록 한다 .

BGP B

Internet

AS300

BGP

AS100

AS200B C

F

EBGP

D

A

BGP

BGP Use

Page 11: Chapter 6. Configuring Basic Border Gateway Protocol

11

Interior or Exterior

DV or LSHierarchyRequired

OSPF

Protocol

EIGRP

Interior

Interior

LS

AdvancedDV

Yes(area)

No

BGP Exterior AdvancedDV

Metric

Cost

Composite

Path attributes(= Path vectors )No

Scalable Routing Protocol Comparison

Page 12: Chapter 6. Configuring Basic Border Gateway Protocol

12

When to Use BGP

• How Big Is the Internet?

Page 13: Chapter 6. Configuring Basic Border Gateway Protocol

13

Packet 이 AS 자신을 경유하여 다른 AS 로 가도록 허용하는 경우 (Internet Service Provider 의 경우 ) AS 가 다른 AS 들에 Multiple Connection 을 갖는 경우 AS 를 경유하는 Traffic 의 흐름이 적절하게 통제 되어야 하는 경우 BGP 에 대해서 네트워크 관리자 들이 잘 이해하고 있는 경우 Working Guide Line 에 의하면 OSPF 등 IGP 의 Routing Table 의 Limit 은 2,000 – 3,000 으로 이

경우 BGP 로 Segmentation 하는 것을 검토해 볼 필요가 있다 . (BGP Segmentation 이외에도 IGP Segmentation /Summarization 의 방법을 사용할 수도 있다 .)

When to Use BGP

Page 14: Chapter 6. Configuring Basic Border Gateway Protocol

14

BGP 는 AS Number 가 다른 두 네트웍간에 Routing Information 을 주고 받을 때 이용될 수 있는 Exterior Gateway Protocol 이다 .

AS 내부에서는 BGP 를 이용할 필요는 없다 . RIP, IGRP, OSPF, EIGRP 와 같은 Interior Gateway Protocol 을 이용하는 것이 바람직하다 .

AS Number 가 다른 두 네트웍을 연결할 때도 반드시 BGP 를 이용할 필요는 없다 . AS Number 가 다른 두 네트웍을 연결할 때 재분배를 통하여 Routing Information 을 주고 받을 수 있도록 할 수 있기 때문이다 .

두개 이상의 AS 에 접속하고 또한 독자적인 라우팅정책을 수립하여 구현할때 BGP 가 필요하다 .BGP 는 Policy Routing Protocol 이라고 하는데 Routing 이 라우터에 의해 결정되는 것이 아니라 네트웍운영자의 정책에 의해 결정되기 때문이다 .

Policy Based Routing Protocol

Page 15: Chapter 6. Configuring Basic Border Gateway Protocol

15

How Big Is the Internet?

Internet 환경에서의 BGP Router 는 •30MB 이상의 메모리를 사용하는 Routing Table 을 갖는다 .

•1 BGP path attribute entry : 96byte memory필요함

•70,000 Route 이상의 Routing Table 을 갖는다 .

•국내 BGP 정보 : 3,000 route, 32MB 이상 권장•해외 BGP 정보 : 60,000 route, 64MB 이상 권장

•6,500 개 이상의 AS Number 가 사용된다 .

Page 16: Chapter 6. Configuring Basic Border Gateway Protocol

16

When Not to Use BGP

• Static Routes

Page 17: Chapter 6. Configuring Basic Border Gateway Protocol

17

BGP 가 항상 적정한 것은 아니다 . Internet 이나 다른 AS 에 Single Connection 을 갖는 경우는 BGP 를

사용하는 것보다 Default Route 또는 Static Route 를 사용하는 것이 바람직하다 .

Routing Policy 나 Route Selection 이 AS 의 주요한 관심사가 아닌 경우 BGP 의 사용이 적절하지 않다 .

BGP Router 는 지속적인 Route Update 를 수행해야 하므로 Memory 및 Processor Power 가 부족한 라우터에서는 BGP 의 사용이 적절하지 않다 .

Network Administrator 의 Route Filtering 이나 BGP Path Selection Process 에 대한 충분한 이해가 없는 경우 BGP 의 사용이 적절하지 않다 .

AS 간의 연결에 Bandwidth 가 충분하지 않은 경우도 BGP 의 사용이 적절하지 않다 .

Static Route 를 사용한다 .

When Not to Use BGP

Page 18: Chapter 6. Configuring Basic Border Gateway Protocol

18

Router(config)#

ip route prefix mask {address | interface } [distance]

Static Route

•Administrative Distance 는 Default 로 , Next-Hop-Address 를 사용하는 경우는 1 이고 , Interface 를 사용하는 경우 0 이다 .

•Floating Static Route 는 Static Route 의 Administrative Distance 값을 Dynamic Routing Protocol 의 값보다 크게 잡아 , Dynamic Routing Protocol 사용이 불가시에 Static Route 를 사용하게 하는 방법이 된다 .

•Multiaccess Media( LAN, Frame Relay, X.25, ISDN 등 ) 를 사용하는 경우에는 반드시 Next-Hop-Address 를 사용해야 한다 .

•Point to Point Media 의 경우는 Interface 를 사용할 수 있으며 , 특히 Unnumbered Interface 를 사용하는 경우에는 Interface 를 사용할 수 밖에 없다 .Interface 를 사용하는 경우에는 Connection 을 설정하는 것이 Next-Hop-Address 를 사용하는 경우 보다 빠르다 .

Page 19: Chapter 6. Configuring Basic Border Gateway Protocol

19

ip route 0.0.0.0 0.0.0.0 S0!router rip network 172.16.0.0

10.1.1.0

ServiceProviderRunning

BGP

ISPRIPA

AS 6500010.1.1.110.1.1.2

S0

172.16.0.0

RIP Static Route Example

RIP 에서 Default Route 는 자동으로 RIP Domain 내로 전파된다 .

Page 20: Chapter 6. Configuring Basic Border Gateway Protocol

20

ip route 0.0.0.0 0.0.0.0 S0!router ospf 111 network 172.16.0.0 0.0.255.255 area 0 default-information originate always

10.1.1.0ISPOSPF

AS 6500010.1.1.110.1.1.2

S0

172.16.0.0A

ServiceProviderRunning

BGP

OSPF Example

default-information originate always 명령은 OSPF 가 Default Route 를 OSPF Routing Domain 에 전파시키도록 한다 . Always 키워드는 위의 그림에서 s0 가 다운되는 경우에도 Defualt Route 를 전파시키라는 의미이다 .

Page 21: Chapter 6. Configuring Basic Border Gateway Protocol

21

BGP Terminology and Concepts

• BGP Characteristics• BGP Inside IP Packets• BGP Tables• BGP Peers or Neighbors• Policy-Based Routing• BGP Attributes

Page 22: Chapter 6. Configuring Basic Border Gateway Protocol

22

BGP 는 Enhanced 된 Distance Vector Routing Protocol 이다 .

• Reliable Update: BGP 는 TCP 상에서 작동한다 . (TCP Port 179 번을 사용한다 .)

• BGP Router 간에 처음 Connection 을 맺을 때는 Full Routing Table 을 교환하지만 이후에는 Incremental, Triggered Update 만을 한다 .

• TCP connectivity 를 확인하기 위한 주기적인 Keepalive 를 주고 받는다 .

• 풍부한 Metric(Path Aattributes) 을 사용한다 .• Loop Free Routing Protocol 이다 .• Huge Internetworks (Internet) 에서 사용할 수 있도록 Design 되었다 .

BGP Characteristics

Page 23: Chapter 6. Configuring Basic Border Gateway Protocol

23

AS_path 는 해당 목적지까지 갈때 경유하는 AS 들의 AS Number 들로 구성된다 .

AS100 ------AS200 -----AS300 -------AS400 (130.100.0.0) •AS400 에 있는 라우터는 AS300 에 있는 라우터에게 130.100.0.0 네트워크에 대한 정보를 전달할때 AS_path 로 400 을 전달한다 .

AS300 : 130.100.0.0 400

•AS300 에 있는 라우터가 AS200 에 있는 라우터에게 130.100.0.0 에 대한 정보를 전달할때는 자신의 AS Number 를 AS_path 에 Prepend 시킨 AS_Path 300 400 을 전달한다 .

AS200 : 130.100.0.0 300 400

•AS200 에서 AS100 으로 정보가 전달될때도 같은 방식이 적용된다 .

AS100 : 130.100.0.0 200 300 400

Loop Free Routing Protocol

Page 24: Chapter 6. Configuring Basic Border Gateway Protocol

24

AS_path Routing : 동일한 목적지에 대한 AS_path 의 길이가 짧을 경우 가까운 곳에 있다고 판단하여 짧은 AS_path 를 가진 경로를 선택한다 .

• AS_path 300 400 의 길이는 2, AS_path 200 300 400 의 길이는 3 이다 .

 

Loop Free Routing Protocol : AS_path 에 자신의 AS Number 가 표시되어 있다면 그것은 자신이 내보낸 정보이므로 해당 정보를 무시한다 . 따라서 BGP Routing 은 Routing Loop 이 발생하지 않는다 .

Loop Free Routing Protocol

Page 25: Chapter 6. Configuring Basic Border Gateway Protocol

25

Page 26: Chapter 6. Configuring Basic Border Gateway Protocol

26

BGP 는 Enhanced 된 Distance Vector Routing Protocol 이다 . Reliable update: BGP 는 TCP 상에서 작동한다 . (TCP Port 179

번을 사용한다 .)

TCP Header

Port No.

SegmentPayload

IP Header

Protocol Number

Frame Header

CRC

Packet Payload

Frame Payload

6 - TCP17 - UDP6 - TCP17 - UDP

179 - BGP23 - Telnet25 - SMTP

179 - BGP23 - Telnet25 - SMTP

BGP in IP Packets

Page 27: Chapter 6. Configuring Basic Border Gateway Protocol

27

Page 28: Chapter 6. Configuring Basic Border Gateway Protocol

28

6 - TCP6 - TCP 179 - BGP179 - BGP

TCP Header

Port No.

SegmentPayload

IP Header

Protocol Number

Frame Header

CRC

Packet Payload

Frame Payload

UDP Header

Port No.

DatagramPayload

IP Header

Protocol Number

Frame Header

CRC

Packet Payload

Frame Payload

17 – UDP17 – UDP 520 - RIP520 - RIP

IP Header

Protocol Number

Frame Header

CRC

Packet Payload

Frame Payload

88 – EIGRP89 – OSPF9 - IGRP

88 – EIGRP89 – OSPF9 - IGRP

RIP, IGRP, OSPF, EIGRP, BGP PDU Diagram

Page 29: Chapter 6. Configuring Basic Border Gateway Protocol

29

IGPRoutingProtocol

BGPRoutingProtocol IP BGP

Routing Tables

BGP 는 IGP Routing Table 과는 별도로 자신의 Routing Table 을 보유한다 .

두 테이블간에 Routing Information 은 교환이 가능하다 .

Page 30: Chapter 6. Configuring Basic Border Gateway Protocol

30

외부로부터 얻은 BGP Routing Information 을 IGP Routing Information 으로 전달하는 방법은 재분배하는 방법과 Static Route 를 사용하는 방법이 있다 . •재분배를 사용하는 경우 , BGP 라우터는 외부 AS 로부터 받은 네트웍정보를 IGP Routing Information 형태로 내부로 전달한다 .•Static Route 를 사용하는 경우는 예를 들어 , 내부 AS 에서 외부 AS 와 연결된 BGP Router 가 하나밖에 없을때 Default Route 를 적용하면 내부 AS 에 있는 라우터들의 부하를 줄여줄 수 있다 .

내부 AS 에 있는 네트웍정보 (IGP Routing Information) 을 BGP Routing Information 으로 전달하는 방법은 재분배하는 방법과 , 전달할 Network Address 를 등록해주는 방법이 있다 . 일반적으로 전달할 목적지에 대한 Network Address 를 등록해주는 방법이 권고되고 있다 .

Network Address 를 등록해 주는 경우의 유의할 점은 예를 들어 , 130.100.0.0이 BGP 에 의해 외부 AS 로 전달이 되려면 130.100.0.0 에 대한 경로를 BGP 라우터가 알고 있어야 한다는 점이다 . 즉 130.100.0.0 에 대한 경로가 BGP 라우터의 Routing Table 에 등록되어 있어야 된다 .

Routing Tables

Page 31: Chapter 6. Configuring Basic Border Gateway Protocol

31

Advertising Networks

Redistributing Static Routes : AS 내에 있는 네트워크 또는 Subnet 을 Advertise 하는 방법 중의 하나로 Static Route 로 잡아 Redistribute 하는 방법이 있다 . Static Route 를 Redistribute 하는 경우 , BGP 는 해당 루트에 대한 Origin Attribute 로 Incomplete 를 사용한다 .

!Router Crouter bgp 200neighbor 1.1.1.1 remote-as 300redistribute static!ip route 175.220.0.0 0.0.255.255 null 0

ip route 라는 global configuration 명령은 175.220.0.0 네트워크에 대한 Static Route 를 만든다 . 이론적으로 Null 0 Interface 를 지정하는 것은 175.220.0.0 번 네트워크를 목적지로 하는 Packet 을 버린다는 것을 의미하나 실제로는 175.220.0.0 보다 Specific 한 Entry Match 가 있으므로 라우터는 해당 패킷을 부합되는 Interface 로 보내게 된다 . Supernet 을 Advertise 하는 최선의 방법은 Static Route 를 Redistribution 하는 것이다 . Static Route 를 사용하게 되면 Subnet Down 으로 인한 Supernet 의 Route Flapping 을 방지한다 .

Page 32: Chapter 6. Configuring Basic Border Gateway Protocol

32

Advertising Networks

Redistributing Dynamic Routes

redistribute eigrp 10 router configuration 명령은 EIGRP 10 의 Route 를 BGP 로 Redistribute 한다 .(BGP 를 IGP 로 Redistribute 하는 것은 너무 많은 경로가 Inject 되므로 피해야 한다 .) neighbor distribute-list router configuration 명령은 1.1.1.1 Neighbor(Router D) 에 Outgoing Advertising 을 하는데 있어 , Access-List 의 1 의 적용을 받는다 . Access list 1 은 network 175.220.0.0 만 Advertise 되도록 규정한다 .

!Router Crouter eigrp 10redistribute bgp 200redistributed connecteddefault-metric 1000 100 250 100 1500

!router bgp 200neighbor 1.1.1.1 remote-as 300neighbor 2.2.2.2 remote-as 200neighbor 1.1.1.1 distribute-list 1 outredistribute eigrp 10!access-list 1 permit 175.220.0.0 0.0.255.255

Page 33: Chapter 6. Configuring Basic Border Gateway Protocol

33

Advertising Networks

network 명령의 사용 : network 명령이 BGP 와 함께 사용되면 AS 가 Originate 하는 Network 들을 의미한다 .(IGP 에서는 IGP 가 실행되는 Interface를 나타내는데 사용된다 .) network 명령을 사용하여 BGP 로 Inject 되는 Route 의 BGP Origin Attribute 는 IGP 로 설정된다 .

!Router Crouter bgp 200neighbor 1.1.1.1 remote-as 300network 175.220.0.0

Page 34: Chapter 6. Configuring Basic Border Gateway Protocol

34

Network Advertisement Example

!Router Arouter bgp 100neighbor 150.10.20.2 remote-as 300network 150.10.0.0

!Router Brouter bgp 200neighbor 160.10.20.2 remote-as 300network 160.10.0.0

!Router Crouter bgp 300neighbor 150.10.20.1 remote-as 100neighbor 160.10.20.1 remote-as 200network 170.10.0.0

Page 35: Chapter 6. Configuring Basic Border Gateway Protocol

35

AS 65000

Neighbors

AS 65500

Neighbors

A

C

B

BGP Peers = Neighbors

BGP Routing Information 을 교환하기 위하여 TCP Connection 을 맺는 두 라우터를 Peer 또는 Neighbor 라 한다 .

Page 36: Chapter 6. Configuring Basic Border Gateway Protocol

36

BGP Neighbor 가 동일한 AS 에 속한다 . Neighbor 는 직접 연결이 아니어도 된다 .

A

IBGP NeighborsIBGP Neighbors

AS 65000

AS 65500

Neighbors

B

C

Internal BGP

Page 37: Chapter 6. Configuring Basic Border Gateway Protocol

37

IBGP 는 한 AS 내에 다른 AS 와 연결된 2 개 이상의 라우터가 있을 경우에 설정한다 . 즉 , EBGP 를 운영하고 있는 라우터가 2 개 이상일 경우일 때만 필요하다는 것이다 . EBGP 를 운영하고 있는 라우터 간에만 IBGP 를 설정해주면 된다 .

EBGP 를 운영하고 있는 라우터가 1 개일 경우 IBGP 설정은 불필요하다 . BGP 라우터는 AS 내의 다른 라우터들과는 IGP 로 정보를 교환하고 , BGP 와 IGP간에 Routing Information 을 재분배하기만 하면 된다 .

Internal BGP

Page 38: Chapter 6. Configuring Basic Border Gateway Protocol

38

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 을 맺어 주어야만 한다 .

Internal BGP

Page 39: Chapter 6. Configuring Basic Border Gateway Protocol

39

AS 내에서 EBGP 라우터간에는 Full Mesh 형태로 IBGP Session 을 모두 설정한다 . (Route Reflector 또는 Confederation 을 사용하면 Full Mesh 를 피할 수 있다 .)

Internal BGP

Page 40: Chapter 6. Configuring Basic Border Gateway Protocol

40

Use of Loopback Interfaces

Routers A 와 B 가 AS 100 안에서 IBGP 로 연결된 경우 , IBGP 인 Neighbor 인 Router B 를 Neighbor 로 설정시 Ethernet Interface E0, E1, E2, E3 중 하나를 설정할 수 있는데 이경우 설정한 Interface 가 Unavailable 해지면 Router A 가 Router B 와의 TCP Connection 이 끊어지게 된다 . Router A 에서 Router B 에 설정된 Loopback Interface 를 사용하여 Neighbor 를 설정하면 이러한 문제를 해결할 수 있다 . Loopback Interface 의 사용은 Router B 에서 neighbor update-source 라는 Router Configuration 명령의 사용을 필요로 한다 . neighbor update-source 는 Router B 에서 TCP Session 을 설정하는데 있어 Physical Interface 가 아닌 Loopback Interface 등을 사용한다는 것을 BGP 에 알리는 것이다 .

!Router Arouter bgp 100neighbor 150.212.1.1 remote-as 100

!Router Bloopback interface 0ip address 150.212.1.1 255.255.0.0!router bgp 100neighbor 190.225.11.1 remote-as 100neighbor 190.225.11.1 update-source loopback 0

Page 41: Chapter 6. Configuring Basic Border Gateway Protocol

41

A

AS 65000

AS 65500

BGP neighbor 가 상이한 AS 에 속한다 . Neighbor 는 직접 연결 (directly connected) 되어야 한다 .

neighbor ebgp-multihop 을 사용할 수 있다 .

EBGP Neighbors

IBGP Neighbors

C

B

External BGP

Page 42: Chapter 6. Configuring Basic Border Gateway Protocol

42

IBGP 라우터들은 직접 연결되어 있지 않아도 IBGP Session 을 맺을 수 있다 . EBGP 라우터들은 대개 전용회선과 같은 것으로 직접 연결되어 EBPG Session을 맺는데 어떠한 이유에서 EBGP 라우터들이 직접 연결될 수 없거나 Serial Link 에 할당된 IP Address 로 Neighbor 를 지정할 수 없는 상황이 발생할 수 있다 . 예를 들어 Loopback Interface 에 할당된 IP Address 로 Neighbor 를 선언하는 경우가 있는데 , 이 경우 neighbor 의 IP Address 를 선언해 주고 neighbor ebgp-multihop 을 또한 선언해 준다 .주의하여야 할 사항은 EBGP 라우터가 loopback Interface 의 IP Address 에 대한 경로를 알고 있어야 한다는 점이다 . AS200 에 있는 EBGP 라우터가 130.200.0.0 에 대한 정보를 network 명령에 의하여 AS100 의 EBGP 라우터에게 전달하는 경우는 130.200.0.0 에 대한 정보를 AS100 에 Static Route 로 등록해 줄 필요는 없으나 그렇지 않은 경우는 , 라우터 A 에 130.200.0.0 에 대한 Static Route 등을 등록하여 주어야 한다 . 라우터 B 측에서도 마찬가지이다 .

EBGP-multihop

Page 43: Chapter 6. Configuring Basic Border Gateway Protocol

43

EBGP Load Balancing

neighbor ebgp-multihop 이라는 router configuration 명령과 loopback interface 를 사용하는 것은 두 AS 간의 Parallel Link 를 통해 Load Balancing 을 설정하는데 유용하다 . Router A 는 1.1.1.2 및 2.2.2.2 를 경유하여 Next Hop 인 160.10.1.1 에 도달할 수 있다 .

!Router Ainterface loopback 0ip address 150.10.1.1 255.255.255.0!router bgp 100 neighbor 160.10.1.1 remote-as 200neighbor 160.10.1.1 ebgp-multihopneighbor 160.10.1.1 update-source loopback 0network 150.10.0.0!ip route 160.10.0.0 255.255.0.0 1.1.1.2ip route 160.10.0.0 255.255.0.0 2.2.2.2

!Router Binterface loopback 0ip address 160.10.1.1 255.255.255.0!router bgp 200 neighbor 150.10.1.1 remote-as 100neighbor 150.10.1.1 ebgp-multihopneighbor 150.10.1.1 update-source loopback 0network 160.10.0.0!ip route 150.10.0.0 255.255.0.0 1.1.1.1ip route 150.10.0.0 255.255.0.0 2.2.2.1

Page 44: Chapter 6. Configuring Basic Border Gateway Protocol

44

Policy-Based Routing

BGP 는 관리자로 하여금 Data 가 AS 를 경유하는 Data Flow 에 대한 Policy, Rule 등을 정의하는 것을 허용한다 .

BGP 및 관련 Tool 은 Internet 상을 경유하는 모든 경로에 대한 Policy 를 구현 할 수는 없으나 Hop-by-Hop 의 Policy 설정은 가능하다 . 다른 AS 에서의 Policy 를 설정할 수는 없으나 Neighbor AS 로 가는 Traffic 에 대한 Policy 는 정의할 수 있다 .

Page 45: Chapter 6. Configuring Basic Border Gateway Protocol

45

BGP Attributes

BGP metric 은 Path Attribute 로도 불리운다 .

BGP Attributes 는 아래와 같이 구분된다 .

Well-known Attribute

Mandatory Attribute

Discretionary Attribute

Optional Attribute

Transitive Attribute

Non-Transitive Attribute

Page 46: Chapter 6. Configuring Basic Border Gateway Protocol

46

Well-known Attributes

Well-known attributes : 모든 BGP Router 가 인식할 수 있어야 하는 Attribute 로 모든 Neighbor 에 Propagate 된다 .

•Well-known mandatory attributes : 모든 Update Message 에 반드시 존재 해야 한다 .

•AS-Path

•Next-Hop

•Origin

•Well-known Discretionary attributes : 모든 Update Messsage 에 있을 수도 있고 없을 수도 있다 .

•Local Preference

•Atomic Aggregate : Router 가 route 를 aggregation 한 사실을 전달

Page 47: Chapter 6. Configuring Basic Border Gateway Protocol

47

Page 48: Chapter 6. Configuring Basic Border Gateway Protocol

48

Optional Attributes

Optional attributes : BGP Implementation 에 따라 인식 될 수도 있고 , 그렇지 않을 수도 있는 Attributed 이다 .

•Optional transitive attributes : 만약 인식되지 않으면 Partial 로 Mark 되고 다른 Neighbor 로는 전파되는 Attribute 이다 .

•Aggregator: Route Aggregation 을 수행한 Router 의 ID 와 AS 번호를 전달한다 .•Community

•Optional non-transitive attributes : 만약 인식되지 않으면 버려지고 , 다른 Neighbor 로도 전파되지 않는 Attribute 이다 .

•MED

Page 49: Chapter 6. Configuring Basic Border Gateway Protocol

49

BGP Attributes

BGP attributes include(* 은 Well-known mandatory attribute이다 .)

•AS-path *

•Next-hop *

•Local preference

•Multi-exit-discriminator (MED)

•Origin *

•Community

Page 50: Chapter 6. Configuring Basic Border Gateway Protocol

50

AS 65500192.168.3.0

AS 65000192.168.2.0

AS 64500192.168.1.0

A B

C

AS-Path Attribute*

192.168.1.0 :(65500,64500)

Route 가 경유하는 AS List 를 나타내는 Attribute 이다 . (Router B 에서 192.168.1.0 에 대한 Path 는 65500 64500 이다 .) AS-Path 는 BGP Router 로 하여금 Loop-Free Routing 을 보장한다 .BGP Router 가 자기자신의 AS 가 들어간 AS-Path Attribute 를 가진 Route 를 받으면 BGP Router 는 이 Route 를 받아 들이지 않는다 .

Page 51: Chapter 6. Configuring Basic Border Gateway Protocol

51

Page 52: Chapter 6. Configuring Basic Border Gateway Protocol

52

Needs to go to AS 500

AS 500

AS 400

172.16.0.0

A

AS 200

AS 300

AS 65100

AS Path Prepend

ExampleRouter B

– router bgp 500– neighbor x.x.x.x remote-as 300– neighbor x.x.x.x route-map TEST1 out– !– route-map TEST1 permit 10– match as-path 2– set as-path prepend 500 500– !– ip as-path access-list 2 permit ^$ ( 자신의 AS

에서 발생한것 )

B

RTA172.16.0.0/16 100 200 500 172.16.0.0/16 300 500 500 500

Page 53: Chapter 6. Configuring Basic Border Gateway Protocol

53

Page 54: Chapter 6. Configuring Basic Border Gateway Protocol

54

AS 64500

172.20.0.0

172.16.0.0

AS 6500010.10.10.1

10.10.10.3

172.20.10.1 172.20.10.2

B

A

C

Next-Hop Attribute*

Route 에 도달하기 위한 Next Hop 을 나타내는 Attribute 이다 .•Router A 가 network 172.16.0.0 에 대해서 EBGP Peer Router 인 Router B에 게 Next Hop Attribute 를 10.10.10.3 으로 하여 Advertise 한다 . •이를 받은 라우터 B 가 IBGP Peer 인 Router C 에게 Next Hop Attribute 를 10.10.10.3 으로 하여 Update 한다 .

Page 55: Chapter 6. Configuring Basic Border Gateway Protocol

55

Page 56: Chapter 6. Configuring Basic Border Gateway Protocol

56

172.16.0.010.10.10.3

10.10.10.1

10.10.10.2

172.30.0.0

B C

A

AS 65000

AS 64500

172.20.0.0

EBGP

Next-Hop on a Multiaccess Network

Multiaccess Network(LAN 등 ) 에서 Route B 는 172.30.0.0 네트워크를 Router A 에 Update 시 10.10.10.2 를 Next Hop 으로 하여 Update 한다 . 이는 172.30.0.0 의 Packet 이 전달 되는데 있어 unnecessary hop 을 제거하는 효과가 있다

Page 57: Chapter 6. Configuring Basic Border Gateway Protocol

57

RTC, RTD: Running OSPFRTC-RTA: BGPRTC: can reach 180.20.0.0 via 170.10.20.3RTC: RTA 에 180.20.0.0 에 대한 Update 를 보낼 때 Next Hop 으로 170.10. 20.3 사용 RTC 를 통하는 별도의 Hop 을 만들 지 않음RTC will advertise 180.20.0.0 to RTA with a NextHop 170.10.20.3.

Next-Hop on a Multiaccess Network

Page 58: Chapter 6. Configuring Basic Border Gateway Protocol

58

172.16.0.010.10.10.3

A

FR

A AS 64500

B C

10.10.10.2

172.30.0.0172.20.0.0

10.10.10.1

AS 65000

EBGP

Next-Hop on an NBMA Network

NBMA Network 에서도 Route B 는 172.30.0.0 네트워크를 Router A 에 Update 시 10.10.10.2 를 Next Hop 으로 하여 Update 한다 . Router A 가 10.10.10.2 를 인식할 수 있도록 Frame-Realy Map 을 잡던지 , Router B 가 Next Hop 을 자기자신으로 Advertise 하도록 (neighbor 10.10.10.3 next-hop-self) 설정할 수 있다 .

Page 59: Chapter 6. Configuring Basic Border Gateway Protocol

59

Needs to go to AS 65350

AS 65350

B AS 64500

172.16.0.0

Local Pref = 200

Local Pref = 150

A

AS 65250

AS 65500

AS 65000

Local Preference Attribute

Well-Known Discretionary Attribute 로서 AS 내의 라우터들에게 어떤 경로가 나가는 경로로 선호되는 지를 표시하며 , 높은 값이 우선이다 . Cisco Router 에서 Default 값은 100 이다 .Local Preference 는 IBGP Neighbor 에게만 전달된다 .

Page 60: Chapter 6. Configuring Basic Border Gateway Protocol

60

!Router Crouter bgp 256neighbor 1.1.1.1 remote-as 100neighbor 128.213.11.2 remote-as 256bgp default local-preference 150

!Router Drouter bgp 256neighbor 3.3.3.4 remote-as 300neighbor 128.213.11.1 remote-as 256bgp default local-preference 200

어떤 Route(172.10.0.0) 에 대한 Local Preference Attribute 는 각각의 Router 에서 bgp default local-preference 명령으로 설정되며 (Default 는 100 이다 ), AS 안의 IBGP Router 간에만 교환된다 . Routr C 는 AS 100 으로 부터 172.10.0.0 네트워크를 Update 받으면 그 경로에 대한 Local Preference 값은 150 으로 되고 , Router D 는 AS 300 으로 부터 172.10.0.0 네트워크를 Update 받으면 그 경로에 대한 Local Preference 값은 200 으로 되어 , Router C 와 Router D 가 172.10.0.0 네트워크에 대한 Route 를 교환한다 . 결국 172.10.0.0 으로 가는 Packet 은 모두 라우터 D 를 경유하여 AS 300 을 통해서 나가게 된다 .

Local Preference Attribute

Page 61: Chapter 6. Configuring Basic Border Gateway Protocol

61

AS 65000

172.20.0.0

172.16.0.0

AS 65500

MED = 150MED = 200

B

A

C

MED(Multi-Exit Discriminator) Attribute

AS 65000 에 있는 라우터 A 가 AS 65500 에 있는 라우터 B 와 C 에 Multiple Exit 으로 연결된 경우 , Router B 와 Router C 가 AS 65000 에 있는 라우터 A 에 대해 이 AS(65500) 로 오는 데 있어서의 MED Attribute 값을 다르게 주어서 적은 값을 갖는 라우터 (B) 를 최적의 경로로 선택하게 한다 .MED 는 External BGP Neighbor 간에만 교환되며 다른 AS 로는 전달되지 않는다 .)•Router A 서의 Network 172.20.0.0 의 경로에 대한 MED 비교는 Neighbor Router(B,C) 들이 동일한 AS 소속인 경우에만 일어난다 .bgp always-compare-med 명령을 사용하면 as 가 다른 경우에도 MED 가 비교된다 .

Page 62: Chapter 6. Configuring Basic Border Gateway Protocol

62

!Router Arouter bgp 100neighbor 2.2.2.1 remote-as 300neighbor 3.3.3.3 remote-as 300neighbor 4.4.4.3 remote-as 400

MED(Multi-Exit Discriminator) Attribute

!Router Brouter bgp 400neighbor 4.4.4.4 remote-as 100neighbor 4.4.4.4 route-map SETMEOUT outneighbor 5.5.5.4 remote-as 300Route-map SETMEOUT permit 10Set metric 50

!Router Crouter bgp 300neighbor 2.2.2.2 remote-as 100neighbor 2.2.2.2 route-map SETMEOUT outneighbor 5.5.5.5 remote-as 400neighbor 1.1.1.2 remote-as 300route-map SETMEOUT permit 10set metric 120

!Router Drouter bgp 300neighbor 3.3.3.2 remote-as 100neighbor 3.3.3.2 route-map SETMEOUT outneighbor 1.1.1.1 remote-as 300route-map SETMEOUT permit 10set metric 200

Page 63: Chapter 6. Configuring Basic Border Gateway Protocol

63

Default 로 BGP 라우터 A 는 어떤 경로에 대한 MED 비교를 동일한 AS 300 에 속하는 Router C 와 D 의 경로만을 비교하므로 Network 180.10.0.0 네트워크에 대한 최적의 경로로 Router C 를 택하게 된다 . bgp always-compare-med 명령을 사용하면 모든 AS 의 Router 들이 특정 경로에 대한 Metric 값을 비교하는데 대상이 되므로 180.10.0.0 네트워크에 대한 Router A 에서의 최적의 경로는 MED 값을 50 으로 Update 한 Router B 로 선택된다 .

!Router Arouter bgp 100neighbor 2.2.2.1 remote-as 300neighbor 3.3.3.3 remote-as 300neighbor 4.4.4.3 remote-as 400bgp always-compare-med

MED(Multi-Exit Discriminator) Attribute

Page 64: Chapter 6. Configuring Basic Border Gateway Protocol

64

Origin Attribute*

IGP : 어떤 경로가 AS 내부의 IGP Protocol(Static Routing 포함 ) 에 의해 만들어진 Route 이다 . network Router Configuration 명령으로 BGP 로 Inject 시키는 경우에 설정된다 . show ip bgp Exec 명령으로 보면 i 로 나타난다 . EGP :EGP Protocol 에 의해서 알게 된 경로가 가지는 Origin Attribute 이다 . show ip bgp Exec 명령으로 보면 e 로 나타난다 .

Incomplete :Redistribute 에 의해 Route 가 BGP 로 유입된 경우의 Origin Attribute이다 . show ip bgp Exec 명령으로 보면 ?로 나타난다 .

10.0.0.011.0.0.012.0.0.0

static

Redistribute

13.0.0.0IGP

Network11.0.0.0

Redistribute

10.0.0.0 Origin Incomplete11.0.0.0 Origin IGP12.0.0.0 Origin Incompete13.0.0.0 Origin Incompete

Page 65: Chapter 6. Configuring Basic Border Gateway Protocol

65

모든 BGP router 는 incoming, outgoing update 되는 Route 및 Redistribution 되는 Route 에 Tag 를 붙일 수 있다

모든 라우터는 Community(Tag) 에 근거하여 incoming, outgoing update 되는 Route 를 Filtering 하거나 , Preferred Route 를 선택할 수 있다 .

Community 는 AS 에 국한되지 않는 Attribute 이며 , Physical Boundary 도 갖지 않는다 .

Community 는 Optional Transitive Attribute 로 다른 AS 로 전파된다 . Route-map 을 사용하여 community 설정 Predefined Communities

No-export : don’t advertise to eBGP peers No-advertise : don’t advertise to any peer Internet : 이 route 를 internet community 로 advertise

Default 로 Propagate 하지 않음 Neighbor x.x.x.x send-community

Community Attribute

Page 66: Chapter 6. Configuring Basic Border Gateway Protocol

66

• RTB’s configurationbgp router 2 network 160.10.0.0 neighbor 3.3.3.1 remote-as 3 neighbor 3.3.3.1 send-community neighbor 3.3.3.1 route-map SETCOMMUNITY outroute-map SETCOMMUNITY permit 10 match ip adress 1 set community no-exportroute-map SETCOMMUNITY permit 20access-list 1 permit 160.10.0.0 0.0.255.255

Community Filtering

• RTC’s configurationbgp router 3 network 170.10.0.0 neighbor 3.3.3.2 remote-as 2 neighbor 3.3.3.2 route-map check-community in route-map check-community permit 10 match community 1 set weight 20 route-map check-community permit 20 match community 2 set weight 10 route-map check-community permit 30 match community 3ip community-list 1 permit 100ip community-list 2 permit 200ip community-list 3 permit internet

Page 67: Chapter 6. Configuring Basic Border Gateway Protocol

67

AS 64500

AS 65000

Weight = 200 Weight = 150

AS 65500172.20.0.0

AS 65250

DB

A

C

Weight Attribute (Cisco Only)

Weight Attribute 는 동일한 목적지에 나가는 경로가 두개 이상인 경우에 사용된다 . Cisco Only 이며 Weight Attribute 는 Local Router 에서만 의미가 있으며 , Routing Update 시에 전파되지 않는다 . 동일한 Destination 에 다수의 Route 가 있는 경우 , 높은 Weight 값을 가진 경로가 선호 된다 . Weight Attribute 의 Default 값은 0 이다 .( 라우터 자체가 만들어낸 Route 는 32768 의 Weight Value 를 갖는다 .)

Page 68: Chapter 6. Configuring Basic Border Gateway Protocol

68

!Router Crouter bgp 300neighbor 1.1.1.1 remote-as 100neighbor 1.1.1.1 weight 2000neighbor 2.2.2.2 remote-as 200neighbor 2.2.2.2 weight 1000

Weight Attribute (Cisco Only)

Page 69: Chapter 6. Configuring Basic Border Gateway Protocol

69

Page 70: Chapter 6. Configuring Basic Border Gateway Protocol

70

라우터 A 와 C 는 라우터 B 를 통하여 IGBP Session 을 맺고 있다 . 라우터 A 가 라우터 D 로부터 130.20.0.0 에 대한 정보를 전달 받으면 IBGP Neighbor 인 라우터 C 에게 전달하며 , 라우터 C 는 이 정보를 다시 라우터 E 에게 전달한다 . AS300 에 있는 라우터는 130.20.0.0 으로 가려는 트래픽을 라우터 C 에게 전달할 것이다 . 그리고 라우터 C 는 해당 트래픽을 라우터 B 에게 전달할 것이다 . 그런데 아직 라우터 B 가 라우터 A 로부터 130.20.0.0 에 대한 정보를 받지 못했다고 가정하면 라우터 B 는 해당 트래픽을 폐기해 버릴 것이다 . BGP 에서 다른 두 개 이상의 AS 를 연결하는 역할을 하는 AS 100 이 있을 경우 AS100 의 BGP 라우터들은 BGP Router 로부터 받은 목적지에 대한 경로를 IGP Router 로부터 얻을때까지는 해당 경로를 다른 BGP 라우터에게 알려주지 않는 것을 Synchronization 이라고 한다 . Synchronization 이 활성화되어 있다면 라우터 C 는 라우터 A 로부터 받은 목적지에 대한 경로정보를 라우터 B 로부터 모두 전달받을때까지 기다렸다가 이후 라우터 E 에게 전달한다 . 따라서 라우터 B 에서 트래픽이 폐기되는 것을 방지할 수 있게 된다 .

BGP Synchronization

A-B: IGPB-C: IGPA-C: IBGP

Page 71: Chapter 6. Configuring Basic Border Gateway Protocol

71

Synchronization 은 Routing Information 의 전달을 지연시키는 원인이 될 수 있는데 , 다음과 같은 상황에서는 Synchronization 은 필요하지 않을 수 있다 . •자신의 AS 가 다른 AS 간의 트래픽을 중계하지 않을때 (Stub AS 일때 )•다른 AS 간의 트래픽을 중계하는 라우터들이 모두 IBGP 를 운영할때 CISCO 라우터의 BGP 에서는 기본적으로 Synchronization 이 활성화되어 있는데 Synchronization 을 비활성화하는 방법은 다음과 같다 . Router(config)# router bgp 65000Router(config-router)# no synchronization

참고 : 쥬니퍼 라우터의 경우는 BGP 에서 Default 로 Synchronization이 Disable 되어 있다 .

no synchronization

Page 72: Chapter 6. Configuring Basic Border Gateway Protocol

72

BGP Operation

• BGP Message Types• Route Selection Decision Process• CIDR and Aggregate Addresses

Page 73: Chapter 6. Configuring Basic Border Gateway Protocol

73

BGP Message Types

Open :TCP Connection 이 맺어진 후 BGP 라우터간에 처음으로 교환되는 메시지이다 . 상호간에 Open Message 가 확인되면 (OpenSent 및 OpenConfirm) BGP Session 이 맺어지고 이후 Update, Keepalive, Notification Message가 교환된다 . Version, Sender 의 AS Number,hold time, Sender 의 router ID(OSPF 의 Router ID 와 동일하다 .),Optional Parameter(Authentication) 정보를 담고 있다 .

Keepalive : BGP Peer 간에 BGP Connection 이 Alive 한지를 확인하기 위한 Messsage 이다 . Peer 간 Keepalive 는 Default 로 60초이며 , Hold Time 은 Default 로 180초이다 .

Update : 단지 하나의 Path 에 대한 정보로 path attributes 및 Network 을 정보로 담고 있다 . BGP Peers 간에 연결이 이루어지면 처음에는 Full Routing Table 을 교환하고 이후에는 Incremental Update 를 한다 .

Notification :Error 가 Detection 되면 BGP Router 는 Notification Message를 보낸 후 BGP Connection 을 종료한다 .BGP Neighbor State 에는 Idle, Connect, Active, OpenSent, OpenConfirm, Established 가 있으며 , Established State 에서만 Update, Keepalive, Notification Message 가 교환된다 .

Page 74: Chapter 6. Configuring Basic Border Gateway Protocol

74

Page 75: Chapter 6. Configuring Basic Border Gateway Protocol

75

Page 76: Chapter 6. Configuring Basic Border Gateway Protocol

76

Page 77: Chapter 6. Configuring Basic Border Gateway Protocol

77

Page 78: Chapter 6. Configuring Basic Border Gateway Protocol

78

Page 79: Chapter 6. Configuring Basic Border Gateway Protocol

79

Route Selection Decision Process

다른 AS 로부터의 Update 를 받은 BGP 는 하나의 Destination 에 대해서 오직하나의 Path 를 선택한다 .

Route 에 AS Loop 이 없고 , Synchronized 된 Route 이며 , 유효한 Next Hop 을 가진 Route 에 대해서 다음의 우선 순위로 Route 를 Selection 한다 .

•Highest Weight (Router 내에서만 유효하다 .)•Highest Local Preference (AS 내에서만 유효하다 .)

•Local Preference 가 같은 경우 BGP 라우터 자신으로부터 발생된 경로를 선택한다 .•Shortest AS-path•Lowest Origin Code (IGP(0) < EGP(1) < incomplete(2))•Lowest MED •IBGP 에 의해 얻은 경로보다 EBGP 에 의해 얻은 경로를 선택한다 .

•EBGP administrative Distance : 20, IBGP: 200•AS 내의 Internal Route 인 경우 , 가장 가까운 IGP Neighbor 로부터의 Path 를 선택한다 .•Flapping 으로 인하여 동일 Attribute 의 EBGP Route 가 존재하는 경우 오래된 Route 가 선호 된다 .( 즉 BGP Table 에 먼저 들어온 Route 가 선호된다 .) •BGP Router ID 가 낮은 Route 가 선호된다 .•BGP Router ID 가 같은 경우는 Neighbor 설정의 IP Address 가 낮은 경로가 선호된다 .

Page 80: Chapter 6. Configuring Basic Border Gateway Protocol

80

BGP 는 Destination 에 대한 하나의 경로만을 선택한다 .여러 개의 Attribute가 Tie Breaker 가 되어 하나의 Destination 에 대해서는 하나의 경로만을 선택한다 .Maximum-path 명령을 주는 경우 라우팅테이블에 나타나기는 하나 (*, 즉 valid), 최적의 경로는 하나만을 선택한다 .(*>, 즉 best)대체로 경로에 대한 Weight, Local Preference 등이 동일하기 때문에 경로결정에 가장 큰 영향을 미치는 요소는 AS_path 의 길이다 .

Route Selection Decision Process

Page 81: Chapter 6. Configuring Basic Border Gateway Protocol

81

AS 64500

192.168.1.0/24

AS 65500

192.168.0.0/16

AS 65000AS 65250

192.168.2.0/24

D

B C

A

CIDR and Aggregate Addresses

Route 는 AS 를 통과시에 Aggregate 될 수 있다 . Router C 와 D 로 부터 각각 192.168.2.0/24, 192.168.1.0/24 네트워크를 Update 받은 Router A 는 192.168.0.0/18 네트워크로 Aggregation 하여 Router B 로 Update 한다 . Well-known Discretionary Attribute 인 Atomic Aggregate 는 Router A 가 Route 를 Aggregation 한 사실을 전달한다 .Optional Transitive Attribute 인 aggregator 는 Route Aggregation 을 수행한 Router 의 ID 와 AS 번호를 전달한다 .

Page 82: Chapter 6. Configuring Basic Border Gateway Protocol

82

Page 83: Chapter 6. Configuring Basic Border Gateway Protocol

83

!Router Crouter bgp 300neighbor 3.3.3.3 remote-as 200neighbor 2.2.2.2 remote-as 100network 160.10.0.0aggregate-address 160.0.0.0 255.0.0.0

Aggregation

Aggregation 후 RouterA 의Routing Table

Page 84: Chapter 6. Configuring Basic Border Gateway Protocol

84

BGP Routing Table 에 Specific Route 를 갖고 있지 않다면 Router 는 Network을 Aggregation 할 수 없다 . Specific Route 는 다른 AS 와의 BGP Update, IGP 로부터의 Redistribution 에 의해서 , network 명령에 의해서 BGP Routing Table 에 Inject 될 수 있다 . Router C 가 Specific Route 는 제외하고 Prefix Route 만을 Update 하기를 원하는 경우 , aggregate-address 160.0.0.0 255.0.0.0 summary-only 명령을 사용한다 . 즉 Summary-only 키워드를 추가한다 .

Aggregation

Aggregation 후 RouterA 의Routing Table

Summary-only실행후 RouterA 의Routing Table

Page 85: Chapter 6. Configuring Basic Border Gateway Protocol

85

Router C 가 Router A 와 B 로 부터 각각 160.20.0.0 네트워크와 160.10.0.0 네트워크를 Update 받아 160.0.0.0/8 네트워크로 Aggregation 하여 Router D 에 Update하는 경우 , 라우터 D 에서의 160.0.0.0 네트워크에 대한 AS_Path 는 300 으로 AS 300이 160.0.0.0 네트워크의 Origin 이 된다 . Router D 가 다른 Route 를 통하여 AS 100 에 연결되어 있는 경우 , 160.0.0.0 네트워크가 Router D 로 부터 Router A 에 네트워크 Origin 이 Router C 인 것으로 Update 된다면 Router A 와 B 사이에서 Routing Loop 이 발생할 수 있다 .Routing Loop 문제를 해결하기 위하여 as-set 키워드와 함께 Aggregation 을 하게 되면 160.0.0.0 네트워크의 Origin 이 AS 100(Router A) 및 AS 200(Router B) 으로 설정된다 .

Aggregation and AS-SET

!Router Cneighbor 3.3.3.3 remote-as 200neighbor 2.2.2.2 remote-as 100neighbor 4.4.4.4 remote-as 400aggregate-address 160.0.0.0 255.0.0.0 as-set

Page 86: Chapter 6. Configuring Basic Border Gateway Protocol

86

Page 87: Chapter 6. Configuring Basic Border Gateway Protocol

87

Configuring BGP

• Peer Groups• Basic BGP Commands• Basic BGP Commands Example• Changing the Next-hop Attribute• Disabling BGP Synchronization• Creating a Summary Address in the BGP Table• Resetting BGP• Another BGP Example

Page 88: Chapter 6. Configuring Basic Border Gateway Protocol

88

Peer Groups

다수의 Neighbor 라우터가 동일한 Outbound Policy 를 갖는 경우 , 일정 Parameter Set 을 갖는 Template 를 정의하여 BGP Router Configuration 을 용이하게 할 수 있다 . Peer Group 의 Member 들은 Inbound Policy 의 경우는 다양한 Policy 를 가질 수 있다 .

Configuring BGP

Page 89: Chapter 6. Configuring Basic Border Gateway Protocol

89

Basic BGP Commands

Enables the BGP routing protocol 을 Enable 시킨다 .

Router(config)#router bgp autonomous-system

Router(config-router)#neighbor {ip-address | peer-group-name} remote-as autonomous-system

EBGP 는 Default 로 TTL 값을 1 로 설정하여 Message 를 교환한다 .(IBGP 는 TTL 값 255 를 사용한다 .) 1홉 이상 떨어져 있는 EBGP Router간의 연결을 위해서는 neighbor {ip-address | peer-group-name} ebgp-multihop [ttl] 명령을 추가로 사용한다 . Loopback Interface 를 사용하여 Neighbor 를 설정하는 경우도 ebgp–multihop 키워드를 사용하여야 한다 . ebgp–multihop 키워드를 사용하면 TTL 값이 255 로 설정되며 명시적으로 한정할 수도 있다 .

Neighbor 설정시 , Loopback Interface 를 사용하는 경우에는 추가로 neighbor {ip-address | peer-group-name} update-source loopback interface-number 명령을 사용하여 neighbor 에 대해 알린다 .

Page 90: Chapter 6. Configuring Basic Border Gateway Protocol

90

BGP 는 BGP Session 을 맺기 위해 Transport Protocol 로 Transmission Control Protocol (TCP) 을 이용한다 . BGP Session 을 맺은 상대측 라우터를 Neighbor 혹은 Peer 라고 하는데 , TCP Session 을 사용하므로 BGP 에서 Neighbor 간에 직접 연결되어 있을 필요는 없다 .

Neighbor 의 IP Address 를 지정할때 유의하여야 할 점은 해당 Neighbor 까지 갈 수 있는 경로가 Routing Table 에 등록되어 있어야 한다는 점이다 . 일반적으로 EBGP Session 은 다른 AS 에 있는 라우터와 직접 연결한 뒤 맺어지기 때문에 항상 Neighbor 가 Routing Table 에 등 록 이 되 어 있 는 반 면 , IBGP Session 은 직 접 연결되어 있지 않은 내부 라우터간에도 맺어지기 때문에 잘못 조작을 하였을 경우 Neighbor 가 Routing Table 에 등록되어 있지 않을 수도 있다 . Neighbor 를 Routing Table 에 등록하는 방법은 IGP 를 정확히 조작해 주거나 Static Route 등을 등록하면 된다 .

Basic BGP Commands

Page 91: Chapter 6. Configuring Basic Border Gateway Protocol

91

Basic BGP Commands

라우터에 직접 연결된 네트워크만을 의미하는 것이 아니라 , Advertise하려는 모든 네트워크로 반드시 자신의 AS 에 속한 Network Address 를 모두 열거하여야 한다 . IGP Routing Table 에 있는 Route 만을 선언할 수 있다 . Subnetting 및 Supernetting 정보를 전달하려면 mask 파라미터를 사용하여야 한다 . Classless Prefix 를 지원하며 Prefix 는 IP Routing Table의 Entry 와 일치하여야 한다 . Mask 를 사용하지 않으면 Classful 로 전달된다 .Supernet 을 IGP Routing Table 에 생성하려면 Null 0 로 Static Route 를 잡을 수 있다 .IOS 12.0 Version 이하에서는 200 개까지의 network 을 선언할 수 있으며 12.0 이상에서는 NVRAM 또는 RAM 의 용량에 제한될 뿐이다 .

Router(config-router)#network network-number mask network-mask

Page 92: Chapter 6. Configuring Basic Border Gateway Protocol

92

AS 64500AS 65000

10.1.1.110.1.1.2

172.16.0.0 172.17.0.0BA

BGP Example

RtrB(config)#router bgp 65000

RtrB(config-router)#neighbor 10.1.1.2 remote-as 64500

RtrB(config-router)#network 172.17.0.0 mask 255.255.0.0

RtrA(config)#router bgp 64500

RtrA(config-router)#neighbor 10.1.1.1 remote-as 65000

RtrA(config-router)#network 172.16.0.0

Page 93: Chapter 6. Configuring Basic Border Gateway Protocol

93

Router(config-router)#neighbor {ip-address | peer-group-name} next-hop-self

next-hop-self

Neighbor Router 에 Update 하는데 있어서 이 라우터를 Next Hop 으로 설정하도록 강제한다 .

Page 94: Chapter 6. Configuring Basic Border Gateway Protocol

94

Disabling BGP Synchronization

Router(config-router)#no synchronization

BGP Synchronization 기능을 Disable 시킨다 . IGP 로 부터 루트를 Update 받기 전에도 Route 를 EBGP Router 에 Update 한다 .

Page 95: Chapter 6. Configuring Basic Border Gateway Protocol

95

Configuring BGP for Aggregate Addressing

Router(config-router)#aggregate-address ip-address mask [summary-only] [as-set]

BGP Table 에 aggregate (summary) entry 를 만든다 .

BGP Table 에 있는 Route 만 Aggregate 될 수 있다 .

Specific Route 가 아닌 Summary Route 만을 Advertise 시키려면 summary-option 키워드를 사용한다 .

Update 하는 Router 가 Route Origin 을 포함한 모든 AS_Path를 표시하도록 하려면 as-set 키워드를 사용한다 .

Page 96: Chapter 6. Configuring Basic Border Gateway Protocol

96

Resetting BGP

Router#clear ip bgp {* | address} [soft [in | out]]

BGP Table 의 Entry 를 제거하고 , BGP Session 을 Reset 시킨다 .

BGP Configuration 이 바뀌면 수행해 주어야 한다 .

*은 모든 Neighbor 를 address 는 특정 Neighbor 를 지정한다 .

Soft 를 사용하면 BGP Session 을 Reset 하지 않고 , 모든 라우팅 테이블을 다시 Update 한다 .in 은 Inbound, out 은 Outbound Update 를 의미한다 .

Peer Group 에 대한 reset 명령은 clear ip bgp peer-group peer-group-name을 사용한다 .

neighbor neighbor_address soft-reconfiguration 명령은 설정변경시에 Soft Update 를 한다 .

Page 97: Chapter 6. Configuring Basic Border Gateway Protocol

97

172.16.10.0AS 65000

172.16.20.0

192.168.2.0

10.1.1.1

10.1.1.2

172.16.0.0/16

AS 64500

192.168.1.49 192.168.1.50

A

BC

Note: There is no IGP running in this example

BGP Example

1. RtrB(config)#router bgp 65000

2. RtrB(config-router)#neighbor 10.1.1.2 remote-as 64500

3. RtrB(config-router)#neighbor 192.168.1.50 remote-as 65000

4. RtrB(config-router)#network 172.16.10.0 mask 255.255.255.0

5. RtrB(config-router)#network 192.168.1.0 mask 255.255.255.0

6. RtrB(config-router)#no synchronization

7. RtrB(config-router)#neighbor 192.168.1.50 next-hop-self

8. RtrB(config-router)#aggregate-address 172.16.0.0 255.255.0.0 summary-only

Page 98: Chapter 6. Configuring Basic Border Gateway Protocol

98

Verifying BGP

• Show ip bgp command output• Show ip bgp summary command output• Show ip bgp neighbors command output• Debug ip bgp updates command output

Page 99: Chapter 6. Configuring Basic Border Gateway Protocol

99

Verifying BGP

Keepalive, Update, Events 등의 Option 이 있다 .

BGP 에 대한 정보를 보여 준다 .Show ip bgp 는 BGP Routing Table 을 보여준다 .Show ip bgp summary 명령은 BGP Connection 의 Status 를 보여준다 .Show ip bgp neighbors 는 Neighbor 에 대한 TCP 및 BGP Connection 을 보여준다 .

Router#show ip bgp [summary | neighbors]

Router#debug ip bgp

Page 100: Chapter 6. Configuring Basic Border Gateway Protocol

100

RTRA#show ip bgp

BGP table version is 5, local router ID is 192.168.2.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

*> 172.16.0.0 10.1.1.1 0 65000 i

*> 192.168.1.0 10.1.1.1 0 0 65000 i

*> 192.168.2.0 0.0.0.0 0 32768 i

show ip bgp

R1# show ip bgp 192.168.0.0

BGP routing table entry for 192.168.0.0/24, version 2

Paths: (1 available, best #1)

65000

192.168.1.254 from 192.168.1.254

Origin IGP, metric 0, localpref 100, valid, external, best

Page 101: Chapter 6. Configuring Basic Border Gateway Protocol

101

show ip bgp summaryRTRA#show ip bgp sum

BGP table version is 5, main routing table version 5

3 network entries and 3 paths using 363 bytes of memory

3 BGP path attribute entries using 372 bytes of memory

BGP activity 3/0 prefixes, 3/0 paths

0 prefixes revised.

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

10.1.1.1 4 65000 14 13 5 0 0 00:08:03 2

Page 102: Chapter 6. Configuring Basic Border Gateway Protocol

102

RTRA#sh ip bgp nei

BGP neighbor is 10.1.1.1, remote AS 65000, external link

Index 1, Offset 0, Mask 0x2

BGP version 4, remote router ID 172.16.10.1

BGP state = Established, table version = 5, up for 00:10:47

Last read 00:00:48, hold time is 180, keepalive interval is 60 seconds

Minimum time between advertisement runs is 30 seconds

Received 16 messages, 0 notifications, 0 in queue

Sent 15 messages, 1 notifications, 0 in queue

Prefix advertised 1, suppressed 0, withdrawn 0

Connections established 1; dropped 0

Last reset 00:16:35, due to Peer closed the session

2 accepted prefixes consume 64 bytes

0 history paths consume 0 bytes

--More--

show ip bgp neighbors

show ip bgp neighbors 는 Neighor 에 대한 BGP Connection 정보를 보여준다 .

Page 103: Chapter 6. Configuring Basic Border Gateway Protocol

103

RTRA#debug ip bgp updatesBGP updates debugging is onRTRA#clear ip bgp *3w5d: BGP: 10.1.1.1 computing updates, neighbor version 0, table version 1, starting at 0.0.0.03w5d: BGP: 10.1.1.1 update run completed, ran for 0ms, neighbor version 0, start version 1, throttled to 1, check point net 0.0.0.03w5d: BGP: 10.1.1.1 rcv UPDATE w/ attr: nexthop 10.1.1.1, origin i, aggregated by 65000 172.16.10.1, path 650003w5d: BGP: 10.1.1.1 rcv UPDATE about 172.16.0.0/163w5d: BGP: nettable_walker 172.16.0.0/16 calling revise_route3w5d: BGP: revise route installing 172.16.0.0/16 -> 10.1.1.13w5d: BGP: 10.1.1.1 rcv UPDATE w/ attr: nexthop 10.1.1.1, origin i, metric 0, path 650003w5d: BGP: 10.1.1.1 rcv UPDATE about 192.168.1.0/243w5d: BGP: nettable_walker 192.168.1.0/24 calling revise_route3w5d: BGP: revise route installing 192.168.1.0/24 -> 10.1.1.1

debug ip bgp

Page 104: Chapter 6. Configuring Basic Border Gateway Protocol

104

Page 105: Chapter 6. Configuring Basic Border Gateway Protocol

105

BGP Case Studiesin the field

Page 106: Chapter 6. Configuring Basic Border Gateway Protocol

106

Traffic 조절 방안• Inbound Traffic 조절

– 정보제공업체를 제외한 대부분의 ISP/ 기업들이 Inbound Traffic 조절 필요

• Outbound Traffic 조절– 정보제공업체들이 외부와 연결된 복수개의 회선을 효율적으로

이용하기 위해 Outbound Traffic 조절 필요

• Inbound Traffic 을 조절하기 위해서는 내가 전달하는 라우텅정보를 조절하여야 함– 내가 원하는 대로 제어하는 것이 쉽지 않음

• Outbound Traffic 을 조절하기 위해서는 내가 전달받는 라우팅정보를 조절하여야 함– 내가 원하는 대로 거의 100% 제어 가능

• BGP 에서 목적지로 가는 경로는 항상 1 개임– Best Path 는 1 개– 100% 50:50 traffic 분산은 불가능

• AS-Path & Prefix Filtering

Page 107: Chapter 6. Configuring Basic Border Gateway Protocol

107

Traffic 조절 수단• Inbound

– as-path 길이– MED 값– prefix 길이

• Outbound– weight (only Cisco IOS)– local_preference– as-path 길이– MED 값

• Wegiht: 값을 클수록 best path

• Local Preference: 값이 클수록 best path

• As-path 길이 : 길이가 짧을수록 best path

• MED: 값이 작을수록 best path

• prefix 길이 : 길이가 길수록 best path

Page 108: Chapter 6. Configuring Basic Border Gateway Protocol

108

DACOMAS3786

KTAS4766

KTAS3559

CUSTAS100

ISP1AS2000

ISP2AS3000

10.1.1.0/24

*>10.1.1.0/24 3786 100 i 10.1.1.0/24 4766 3559 100 i

Example-1• as-path 길이가 짧은 것이 우선함

Page 109: Chapter 6. Configuring Basic Border Gateway Protocol

109

DACOMAS3786

INETAS3976

CUSTAS100

ISP1AS2000

ISP2AS3000

10.1.1.0/24

*>10.1.1.0/24 3786 100 i 10.1.1.0/24 3976 100 i

10.1.1.0/24 3786 100 i*>10.1.1.0/24 3976 100 i

Example-2

• as-path 길이가 같은 경우는 router-ID 가 작은 것을 best path 로 선택함

Page 110: Chapter 6. Configuring Basic Border Gateway Protocol

110

DACOMAS3786

INETAS3976

CUSTAS100

ISPAS200

12.1.1.0/2414.1.1.0/24

Set MED=10 outfor 12.1.1.0/24

Set MED=10 out for 14.1.1.0/24

Example-3

• 다른 두 ISP 에게 MED 를 조정해서 내보내는 것은 inbound traffic 에 거의 영향을 미치지 못함

12.1.1.0/24 로 가는 traffic

14.1.1.0/24 로 가는 traffic

MED 는 External BGP Neighbor 간에만 교환되며 다른 AS 로는 전달되지 않는다 .)

Page 111: Chapter 6. Configuring Basic Border Gateway Protocol

111

Example-4

• ISP 가 MED 를 받아들인다면 동일 ISP 에게 MED 를 설정해서 보내는 것은 inbound traffic 을 조절할수 있는 수단

DACOMAS3786

CUSTAS100

12.1.1.0/2414.1.1.0/24 Set MED=10 out

for 12.1.1.0/24

Set MED=10 out for 14.1.1.0/24

*>12.1.1.0/24 n-h1 med=null 100 i 12.1.1.0/24 n-h2 med=10 100 i 14.1.1.0/24 n-h1 med=10 100 i*>14.1.1.0/24 n-h2 med=null 100 i

12.1.1.0/24 로 가는 traffic

14.1.1.0/24 로 가는 traffic

n-h1

n-h2

Lowest MED

Page 112: Chapter 6. Configuring Basic Border Gateway Protocol

112

Example-5

• as-path prepend 로 inbound traffic 조절

DACOMAS3786

KTAS4766

KTAS3559

CUSTAS100 Internet

10.1.1.0/24

as-path prepend 100 out

*>10.1.1.0/24 3786 100 10.1.1.0/24 4766 3559 100

10.1.1.0/24 3786 100 100*>10.1.1.0/24 4766 3559 100

•DACOM 과 연결된 회선의 Inbound traffic 이 100% 에 가까운 반면 KT 와 연결된 회선의 Inbound traffic 이 50% 이하임

Page 113: Chapter 6. Configuring Basic Border Gateway Protocol

113

Example-6

• as-path prepend 로 inbound traffic 조절

DACOMAS3786

INETAS3976

CUSTAS100

Traffic 폭주

DACOMAS3786

INETAS3976

CUSTAS100

As-path prepend100 out

Page 114: Chapter 6. Configuring Basic Border Gateway Protocol

114

Example-7

• as-path prepend 를 네트웍별로 적용하여 inbound traffic 조절

CUSTAS100

12.1.1.0/2414.1.1.0/24 As-path prepend

100 for 12.1.1.0/24

As-path prepend100 for 14.1.1.0/24

*>12.1.1.0/24 3786 100 12.1.1.0/24 3976 100 100

14.1.1.0/24 3786 100 100*>14.1.1.0/24 3976 100

DACOMAS3786

INETAS3976

Internet

Page 115: Chapter 6. Configuring Basic Border Gateway Protocol

115

Example-8

• Prefix Length 로 inbound traffic 을 조절

CUSTAS100

12.1.0.0/16 12.1.0.0/17 12.1.128.0/17

DACOMAS3786

KTAS3559

Internet

12.1.0.0/1612.1.0.0/17

12.1.0.0/1612.1.128.0/17

12.1.128.0/17

12.1.128.0/17

12.1.0.0/17

12.1.0.0/17

•DACOM 과 연결된 회선의 대역은 50%, KT 와 연결된 회선의 대역은 100% 를 이용 ( 병목현상 )하는 상황 발생

Page 116: Chapter 6. Configuring Basic Border Gateway Protocol

116

Example-9

• MED 로 outbound path 를 선택할 수 있음

DACOMAS3786

INETAS3976

CUSTAS100

CUSTAS200

10.1.1.0/24

12.1.1.0/24

InternetSet MED=10 in for AS200

*>12.1.1.0/24 MED=null 3786 200 i 12.1.1.0/24 MED=10 3976 200 i

Page 117: Chapter 6. Configuring Basic Border Gateway Protocol

117

Example-10

• MED 를 선택적으로 적용• outbound 조절용

DACOMAS3786

INETAS3976

CUSTAS100

CUSTAS200

12.1.1.0/2414.1.1.0/24

Set MED=10 in for 12.1.1.0/24

*>12.1.1.0/24 MED=null 3786 200 i 12.1.1.0/24 MED=10 3976 200 i 14.1.1.0/24 MED=10 3786 200 i *>14.1.1.0/24 MED=null 3976 200 i

Set MED=10 in for 14.1.1.0/24

Page 118: Chapter 6. Configuring Basic Border Gateway Protocol

118

Example-11

• Default 만을 설정하여 outbound traffic 을 처리하는 방법– 국내 BGP 정보를 받는 경우– 아무 정보도 받지 않은 경우

DACOMAS3786

INETAS3976

Internet

default

default

Page 119: Chapter 6. Configuring Basic Border Gateway Protocol

119

Example-12

• 2 개의 라우터를 이용하는 경우– unbalanced outbound traffic 가능성이 높음– 그러나 안정적

Internet

default

default

DACOMAS3786

INETAS3976

Page 120: Chapter 6. Configuring Basic Border Gateway Protocol

120

Config-1

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

router bgp 3786 neigh 1.1.1.1 remote-as 100 neigh 1.1.1.1 filter-list 50 in neigh 1.1.1.1 distribute-list 120 in no sync no auto-summary!ip as-path access-list 50 permit ^(100_)+$!access-list 120 permit host 10.1.1.0 host 255.255.255.0

router bgp 3976 neigh 2.2.2.1 remote-as 100 neigh 2.2.2.1 filter-list 11 in neigh 2.2.2.1 distribute-list 130 in no sync no auto-summary!ip as-path access-list 11 permit ^(100_)+$!access-list 130 permit host 10.1.1.0 host 255.255.255.0

Page 121: Chapter 6. Configuring Basic Border Gateway Protocol

121

Config-2

10.1.1.0/241.1.1.2

1.1.1.1

2.2.2.22.2.2.1

AS3559

AS3786AS100

Interface loopback 0 ip address 192.168.1.1 255.255.255.252!router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3559 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 192.168.2.1 remote-as 3786 neigh 192.168.2.1 ebgp-multihop 3 neigh 192.168.2.1 update-source loopback0 neigh 192.168.2.1 filter-list 10 out neigh 192.168.2.1 distribute-list 100 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1ip route 0.0.0.0 0.0.0.0 3.3.3.1ip route 192.168.2.1 255.255.255.252 2.2.2.1ip route 192.168.2.1 255.255.255.252 3.3.3.1

3.3.3.23.3.3.1

192.168.1.1/30192.168.2.1/30

Interface loopback 0 ip address 192.168.2.1 255.255.255.252!router bgp 3786 neigh 192.168.1.1 remote-as 100 neigh 192.168.1.1 ebgp-multihop 3 neigh 192.168.1.1 update-source loopback0 neigh 192.168.1.1 filter-list 10 in neigh 192.168.1.1 distribute-list 100 in no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 192.168.2.1 255.255.255.252 2.2.2.2ip route 192.168.2.1 255.255.255.252 3.3.3.2

Page 122: Chapter 6. Configuring Basic Border Gateway Protocol

122

10.1.0.0/16

1.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

Config-3

• AS3786 회선에 inbound traffic 이 많을때

router bgp 100 network 10.1.0.0 mask 255.255.0.0 network 10.1.128.0 mask 255.255.128.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 110 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0!access-list 110 permit host 10.1.0.0 host 255.255.0.0access-list 110 permit host 10.1.128.0 host 255.255.128.0!ip route 10.1.0.0 255.255.0.0 null0ip route 10.1.128.0 255.255.128.0 null0ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Page 123: Chapter 6. Configuring Basic Border Gateway Protocol

123

10.1.0.0/16

1.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3559

AS100

Config-4

• AS3786 회선에 inbound traffic 이 많을때

router bgp 100 network 10.1.0.0 mask 255.255.0.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 route-map PREPEND out neigh 2.2.2.1 remote-as 3559 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0!route-map PREPEND permit 10 set as-path prepend 100!ip route 10.1.0.0 255.255.0.0 null0ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Page 124: Chapter 6. Configuring Basic Border Gateway Protocol

124

10.1.0.0/16/16

1.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

Config-5

• AS3786 회선에 inbound traffic 이 많을때

router bgp 100 network 10.1.0.0 mask 255.255.0.0 network 10.1.128.0 mask 255.255.128.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 route-map PREPEND out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0access-list 100 permit host 10.1.128.0 host 255.255.128.0!access-list 110 permit host 10.1.128.0 host 255.255.128.0!route-map PREPEND permit 10 match ip address 110 set as-path prepend 100route-map PREPEND permit 20!ip route 10.1.0.0 255.255.0.0 null0ip route 10.1.128.0 255.255.128.0 null0ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Page 125: Chapter 6. Configuring Basic Border Gateway Protocol

125

Config-6

• Network 별로 inbound traffic 을 분리 / 조절하기 위해

10.1.0.0/16

1.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.0.0 mask 255.255.0.0 network 10.1.0.0 mask 255.255.128.0 network 10.1.128.0 mask 255.255.128.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 110 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0access-list 100 permit host 10.1.128.0 host 255.255.128.0!access-list 110 permit host 10.1.0.0 host 255.255.0.0access-list 110 permit host 10.1.0.0 host 255.255.128.0!ip route 10.1.0.0 255.255.0.0 null0ip route 10.1.0.0 255.255.128.0 null0ip route 10.1.128.0 255.255.128.0 null0ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Page 126: Chapter 6. Configuring Basic Border Gateway Protocol

126

1.1.1.2

2.2.2.2

3.3.3.2

4.4.4.2

1.1.1.1

2.2.2.1

3.3.3.1

4.4.4.1

10.1.0.0/1610.1.0.0/1810.1.64.0/1810.1.128.0/1810.1.192.0/18

AS100 192.168.0.1

192.168.1.1

192.168.2.1

192.168.3.1

Interface loopback 0 ip address 192.168.0.1 255.255.255.252!router bgp 100 network 10.1.0.0 mask 255.255.0.0 network 10.1.0.0 mask 255.255.192.0 network 10.1.64.0 mask 255.255.192.0 neigh 192.168.2.1 remote-as 3786 neigh 192.168.2.1 ebgp-multihop 3 neigh 192.168.2.1 update-source loopback 0 neigh 192.168.2.1 filter-list 10 out neigh 192.168.2.1 distribute-list 100 out neigh 10.1.0.2 remote-as 100 neigh 10.1.0.2 next-hop-self no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0access-list 100 permit host 10.1.0.0 host 255.255.192.0access-list 100 permit host 10.1.64.0 host 255.255.192.0!ip route 10.1.0.0 255.255.0.0 null0ip route 10.1.0.0 255.255.192.0 null0ip route 10.1.64.0 255.255.192.0 null0ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1ip route 0.0.0.0 0.0.0.0 10.1.0.2 10ip route 192.168.2.1 255.255.255.252 1.1.1.1ip route 192.168.2.1 255.255.255.252 2.2.2.1

AS3786

10.1.0.1

10.1.0.2

Config-7

• 데이콤에 여러 개의 회선을 안정성을 위해 분리 접속할 경우

Page 127: Chapter 6. Configuring Basic Border Gateway Protocol

127

Config-8

1.1.1.2

2.2.2.2

3.3.3.2

4.4.4.2

1.1.1.1

2.2.2.1

3.3.3.1

4.4.4.1

10.1.0.0/1610.1.0.0/1810.1.64.0/1810.1.128.0/1810.1.192.0/18

AS100 192.168.0.1

192.168.1.1

192.168.2.1

192.168.3.1

Interface loopback 0 ip address 192.168.0.1 255.255.255.252!router bgp 100 network 10.1.0.0 mask 255.255.0.0 network 10.1.0.0 mask 255.255.192.0 network 10.1.64.0 mask 255.255.192.0 neigh 192.168.2.1 remote-as 3786 neigh 192.168.2.1 ebgp-multihop 3 neigh 192.168.2.1 update-source loopback 0 neigh 192.168.2.1 filter-list 10 out neigh 192.168.2.1 distribute-list 100 out neigh 10.1.0.2 remote-as 100 neigh 10.1.0.2 next-hop-self no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0access-list 100 permit host 10.1.0.0 host 255.255.192.0access-list 100 permit host 10.1.64.0 host 255.255.192.0access-list 100 permit host 10.1.128.0 host 255.255.192.0!ip route 10.1.0.0 255.255.0.0 null0ip route 10.1.0.0 255.255.192.0 null0ip route 10.1.64.0 255.255.192.0 null0ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1ip route 0.0.0.0 0.0.0.0 10.1.0.2 10ip route 192.168.2.1 255.255.255.252 1.1.1.1ip route 192.168.2.1 255.255.255.252 2.2.2.1

AS3786

10.1.0.1

10.1.0.2

• 데이콤에 여러 개의 회선을 안정성을 위해 분리 접속할 경우

Page 128: Chapter 6. Configuring Basic Border Gateway Protocol

128

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-9

• 양 사업자가 주는 국내정보를 받을때

Page 129: Chapter 6. Configuring Basic Border Gateway Protocol

129

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 filter-list 20 in neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 filter-list 20 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 20 deny .*!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-10

• 양 사업자로부터 아무 정보도 받지 않고 default 로 outbound traffic 분산

Page 130: Chapter 6. Configuring Basic Border Gateway Protocol

130

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out no neigh 1.1.1.1 filter-list 20 in neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 filter-list 20 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 20 deny .*!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-11

• 국내는 AS3786 을 통해 가게하고 , 해외는 양사업자로 분산해서 가게 할떄

Page 131: Chapter 6. Configuring Basic Border Gateway Protocol

131

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3559

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 filter-list 20 in neigh 2.2.2.1 remote-as 3559 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 filter-list 30 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 20 3786$ip as-path access-list 30 3559$!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-12

• AS3559, AS3786 영역은 직회선을 이용하게 하고 , 나머지는 임의로 분산해서 가도록 함

Page 132: Chapter 6. Configuring Basic Border Gateway Protocol

132

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3559

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 filter-list 20 in neigh 2.2.2.1 remote-as 3559 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 filter-list 30 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 20 permit 3786$ip as-path access-list 30 permit .*!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-13

• AS3786 으로는 직회선 이용 , 나머지는 KT회선 이용 , 해외는 임의로 분산

Page 133: Chapter 6. Configuring Basic Border Gateway Protocol

133

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3559

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3559 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 filter-list 30 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 30 deny (3786|3976)ip as-path access-list 30 permit .*!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-14

• AS3786,AS3976으로 가는 것은 AS3786 과의 직회선을 이용하게 하고 , 나머지는 임의 분산

Page 134: Chapter 6. Configuring Basic Border Gateway Protocol

134

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 route-map INET in no sync no auto-summary!Ip as-path access-list 10 permit ^$ip as-path access-list 20 permit (4766|2563|1237|3608)!access-list 100 permit host 10.1.1.0 host 255.255.255.0!route-map INET permit 10 match ip as-path 20 set metric 100route-map INET permit 20!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-15

• AS4766,2563,1237,3608 로 가는 traffic은 AS3786 과의 직회선을 이용하게 하고 , 나머지는 임의 분산

Page 135: Chapter 6. Configuring Basic Border Gateway Protocol

135

Config-16

• Outbound 가 많은 site 에서 ISP 와 연결된 회선대역이 틀릴 경우

10.1.1.0/241.1.1.2

1.1.1.1

2.2.2.22.2.2.1

AS3559

AS3786AS100 3.3.3.2

3.3.3.1192.168.1.1/30

192.168.2.1/30

Interface loopback 0 ip address 192.168.1.1 255.255.255.252!router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3559 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 filter-list 20 in neigh 192.168.2.1 remote-as 3786 neigh 192.168.2.1 ebgp-multihop 3 neigh 192.168.2.1 update-source loopback0 neigh 192.168.2.1 filter-list 10 out neigh 192.168.2.1 distribute-list 100 out neigh 192.168.2.1 filter-list 30 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 20 permit (3559|4766|7563)ip as-path access-list 30 permit (3786|1237|2563)!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1ip route 0.0.0.0 0.0.0.0 3.3.3.1ip route 192.168.2.1 255.255.255.252 2.2.2.1ip route 192.168.2.1 255.255.255.252 3.3.3.1

Page 136: Chapter 6. Configuring Basic Border Gateway Protocol

136

Page 137: Chapter 6. Configuring Basic Border Gateway Protocol

137

BGP 에서 Traffic 제어

Page 138: Chapter 6. Configuring Basic Border Gateway Protocol

138

Traffic 조절 대상• Inbound Traffic 조절

– 정보제공업체를 제외한 대부분의 ISP/ 기업들이 Inbound Traffic 조절 필요

• Outbound Traffic 조절– 정보제공업체들이 외부와 연결된 복수개의 회선을 효율적으로

이용하기 위해 Outbound Traffic 조절 필요

Page 139: Chapter 6. Configuring Basic Border Gateway Protocol

139

Traffic 조절시 유의사항

• Inbound Traffic 을 조절하기 위해서는 내가 전달하는 라우텅정보를 조절하여야 함– 내가 원하는 대로 제어하는 것이 쉽지 않음

• Outbound Traffic 을 조절하기 위해서는 내가 전달받는 라우팅정보를 조절하여야 함– 내가 원하는 대로 거의 100% 제어 가능

• BGP 에서 목적지로 가는 경로는 항상 1 개임– Best Path 는 1 개– 100% 50:50 traffic 분산은 불가능

• AS-Path & Prefix Filtering

Page 140: Chapter 6. Configuring Basic Border Gateway Protocol

140

상황요소들• 라우터 개수

• 연결된 ISP 의 AS 구성 방식

• 1 개의 ISP 에 연결된 회선 수

• 회선대역

• IP block 개수

• IP block 이 ISP IP block 에 포함되는 경우

Page 141: Chapter 6. Configuring Basic Border Gateway Protocol

141

Traffic 조절 수단• Inbound

– as-path 길이– MED 값– prefix 길이

• Outbound– weight (only Cisco IOS)– local_preference– as-path 길이– MED 값

Page 142: Chapter 6. Configuring Basic Border Gateway Protocol

142

Traffic 조절 수단 (cont.)

• Wegiht: 값을 클수록 best path

• Local Preference: 값이 클수록 best path

• As-path 길이 : 길이가 짧을수록 best path

• MED: 값이 작을수록 best path

• prefix 길이 : 길이가 길수록 best path

Page 143: Chapter 6. Configuring Basic Border Gateway Protocol

143

상황 1

• ABC-A 기업– Cisco 2501 라우터 1 대– 512Kbps 1회선씩 2 개의 ISP 에 연결 .– Inbound Traffic 이 많음– IP block 200.200.200.0/24 이용– AS Number 9999

Page 144: Chapter 6. Configuring Basic Border Gateway Protocol

144

상황 1 에 대한 검토• Cisco 2501 라우터 1 대

– ISP 로부터 정보를 전달받지 않고 , ISP 에게 200.200.200.0/24 만을 전달하는 것이 바람직

– LAN Interface 가 10M Ethernet 이므로 3Mbps 이상 외부와의 Traffic 처리 곤란 . 그러나 512Kbps 회선이 2 개이므로 문제없음

– 2Mbps 2회선을 이용할 경우에는 LAN Interface 를 100M Interface 로 교체해주는 것이 바람직하며 , 이 경우 상위 기종 라우터 이용 필요

– 혹은 10M Interface 가 2 개 이상 지원되는 라우터 이용해야 함– 라우터가 1 대이므로 장애 가능성 잠재

• 512Kbps 1회선씩 2 개의 ISP 에 연결– 동일대역의 회선이므로 outbound traffic 은 default route 를 2 개만을 선언하여 50:50

으로 분산 가능 . – 국내정보를 2 개의 ISP 로부터 받을 수 있는 라우터를 이용한 경우 default route

만으로는 outbound traffic 분산이 완전하지 않을 수 있음 . 이 경우에는 weight, local_preference, as-path, metric 등으로 outbound traffic 조절 필요

– 동일대역 회선이더라도 연결된 사업자에 따라 inbound traffic 이 매우 불균형상태일수 있음 . 이 경우 as-path, MED, prefix 길이 등으로 traffic 조절 필요

– 2 개의 ISP 에게 연결되어 있으므로 전체장애 발생 가능성은 낮음

• Inbound Traffic 이 많음– outbound traffic 조절보다는 inbound traffic 조절 방법 숙지 필요– 불균형한 상태로 회선이 이용될 경우 , 필요에 따라서는 어느 1 개의 회선대역 증가 필요

• IP block 200.200.200.0/24 이용– C Class 1 개 block 을 이용하므로 prefix 길이를 이용한 inbound traffic 조절은 곤란

Page 145: Chapter 6. Configuring Basic Border Gateway Protocol

145

Case 1

• 상황 1 에서 AS100, AS200 에 연결

Internet

AS100

국내인터넷

AS200

AS9999

1.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

Page 146: Chapter 6. Configuring Basic Border Gateway Protocol

146

Case1 Config 설정interface ethernet0

ip address 200.200.200.1 255.255.255.0ip route-cache same-interfaceno ip directed-broadcast

!router bgp 9999

no synchronizationno auto-summarynetwork 200.200.200.0neighbor 1.1.1.1 remote-as 100neighbor 2.2.2.1 remote-as 200neighbor 1.1.1.1 filter-list 10 outneighbor 2.2.2.1 filter-list 10 outneighbor 1.1.1.1 filter-list 20 inneighbor 2.2.2.1 filter-list 20 inneighbor 1.1.1.1 distribute-list 100 outneighbor 2.2.2.1 distribute-list 100 out

ip as-path access-list 10 permit ^$!ip as-path access-list 20 deny .*!access-l 100 per ip host 200.200.200.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Page 147: Chapter 6. Configuring Basic Border Gateway Protocol

147

Case2

• Case1 에서 Cisco2501 이 상위기종으로 교체되어 국내정보를 받을 수 있는 상황이 됨– 국내 ISP 들은 대개 국내정보만을 전달함

router bgp 9999no synchronizationno auto-summarynetwork 200.200.200.0neighbor 1.1.1.1 remote-as 100neighbor 2.2.2.1 remote-as 200neighbor 1.1.1.1 filter-list 10 outneighbor 2.2.2.1 filter-list 10 out

no neighbor 1.1.1.1 filter-list 20 inno neighbor 2.2.2.1 filter-list 20 in neighbor 1.1.1.1 distribute-list 100 outneighbor 2.2.2.1 distribute-list 100 out

Page 148: Chapter 6. Configuring Basic Border Gateway Protocol

148

Case3

• Case2 에서 AS100 과 연결된 회선의 Inbound traffic 이 100% 에 가까운 반면 AS200 과 연결된 회선의 Inbound traffic 이 50% 이하임

• 원인– AS100 에 정보제공시스템이 많거나– AS9999 에 대해 다른 네트웍관점에서 AS100 을

경유하는 것이 as-path 길이가 짧을 경우

• 해결방안– as-path 길이를 조절

• as-path prepend

Page 149: Chapter 6. Configuring Basic Border Gateway Protocol

149

Case3 (cont.)

AS9999AS9999

AS200AS200 AS300AS300

AS100AS100

AS500AS500

AS400AS400

AS600AS600

200.200.200.0/24

*>200.200.200.0 100 9999*>200.200.200.0 300 200 9999

*>200.200.200.0 100 9999*>200.200.200.0 300 200 9999

Page 150: Chapter 6. Configuring Basic Border Gateway Protocol

150

Case3 (cont.)

AS9999AS9999

AS200AS200 AS300AS300

AS100AS100

AS500AS500

AS400AS400

AS600AS600

*>200.200.200.0 100 9999 9999*>200.200.200.0 300 200 9999

*>200.200.200.0 100 9999 9999*>200.200.200.0 300 200 9999

AS9999

200.200.200.0/24

Page 151: Chapter 6. Configuring Basic Border Gateway Protocol

151

Case3(cont.)

router bgp 9999no synchronizationno auto-summarynetwork 200.200.200.0neighbor 1.1.1.1 remote-as 100neighbor 2.2.2.1 remote-as 200neighbor 1.1.1.1 filter-list 10 outneighbor 2.2.2.1 filter-list 10 outneighbor 1.1.1.1 distribute-list 100 outneighbor 2.2.2.1 distribute-list 100 out

neighbor 1.1.1.1 route-map MY-PREPEND out!route-map MY-PREPEND permit 10 set ip as-path prepend 9999

Page 152: Chapter 6. Configuring Basic Border Gateway Protocol

152

Case4

• Case2 에서 AS100 과 연결된 회선을 100% 가깝게 (병목현상 ), AS200 과 연결된 회선을 80% 정도 이용시

• 이 경우에는 AS100 과 연결된 회선대역을 늘려주어야 하는 것이 바람직함 .

• Case3 에서와 같이 as-path prepend 를 이용해 문제를 해결해 보려고 시도할 수는 있으나 , 그 경우 AS100 과 연결된 회선의 대역은 50%, AS200 과 연결된 회선의 대역은 100% 를 이용 (병목현상 ) 하는 상황 발생

Page 153: Chapter 6. Configuring Basic Border Gateway Protocol

153

Case5

• Case1 에서 IP block 을 1 개 더 얻은 경우– 200.200.201.0/24 추가

• 200.200.200.0/23• 상황

– AS100 과 연결된 회선은 100% 이용 (병목현상 ) 하는 반면 , AS200 과 연결된 회선은 50% 이하 이용

• 원인– Case3 과 동일한 원인일 가능성이 높음

• 해결방안– as-path prepend– specific prefix 전달

Page 154: Chapter 6. Configuring Basic Border Gateway Protocol

154

Case5(cont.)

AS9999AS9999

AS200AS200 AS300AS300

AS100AS100

AS500AS500

AS400AS400

AS600AS600

200.200.200.0/24200.200.201.0/24

200.200.200.0/24 9999 9999 200.200.201.0/24 9999

*>200.200.200.0/24 300 200 9999*>200.200.200.0/24 100 9999 9999 *>200.200.201.0/24 300 200 9999*>200.200.201.0/24 100 9999

200.200.200.0/24 9999200.200.201.0/24 9999

Page 155: Chapter 6. Configuring Basic Border Gateway Protocol

155

Case 5(cont.)router bgp 9999

no synchronizationno auto-summarynetwork 200.200.200.0network 200.200.201.0neighbor 1.1.1.1 remote-as 100neighbor 2.2.2.1 remote-as 200neighbor 1.1.1.1 filter-list 10 outneighbor 2.2.2.1 filter-list 10 outneighbor 1.1.1.1 distribute-list 100 outneighbor 2.2.2.1 distribute-list 100 out

neighbor 1.1.1.1 route-map MY-PREPEND out!route-map MY-PREPEND permit 10

match ip address 110set ip as-path prepend 9999

route-map MY-PREPEND permit 20!access-li 100 per ip host 200.200.200.0 ho 255.255.255.0

Page 156: Chapter 6. Configuring Basic Border Gateway Protocol

156

Case5(cont.)

AS9999AS9999

AS200AS200 AS300AS300

AS100AS100

AS500AS500

AS400AS400

AS600AS600

200.200.200.0/23

*>200.200.200.0/23 100 9999*>200.200.200.0/23 300 200 9999*>200.200.200.0/24 300 200 9999

200.200.200.0/23

*>200.200.200.0/23 9999*>200.200.200.0/24 9999

Page 157: Chapter 6. Configuring Basic Border Gateway Protocol

157

Case5 (cont.)router bgp 9999

no synchronizationno auto-summarynetwork 200.200.200.0 mask 255.255.254.0network 200.200.200.0neighbor 1.1.1.1 remote-as 100neighbor 2.2.2.1 remote-as 200neighbor 1.1.1.1 filter-list 10 outneighbor 2.2.2.1 filter-list 10 outneighbor 1.1.1.1 distribute-list 100 outneighbor 2.2.2.1 distribute-list 110 out

!access-li 100 per ip host 200.200.200.0 ho 255.255.254.0!access-li 110 per ip host 200.200.200.0 ho 255.255.254.0access-li 110 per ip host 200.200.201.0 ho 255.255.255.0!ip route 200.200.200.0 255.255.254.0 Null0

Page 158: Chapter 6. Configuring Basic Border Gateway Protocol

158

상황 2

• ABC-B 기업– Cisco 4500 라우터 2 대– 2Mbps 3회선

• 2회선은 ISP-AS100, 1회선은 ISP-AS200 에 접속

– Inbound Traffic 이 많음– IP block 200.200.200.0/22 이용– AS Number 9999

Page 159: Chapter 6. Configuring Basic Border Gateway Protocol

159

상황 2 에 대한 검토• 4500 라우터가 2 대이므로 , 회선을 분산해서 수용하는

것이 바람직– AS100 에 연결된 2회선을 각각 다른 라우터에 수용하는

경우 및 분산 수용하는 경우에 따라 Traffic 조절 방법이 다름

• 4500 라우터에서 RAM 이 32M 라고 할 경우 국내 정보를 모두 받을 수 있으므로 국내정보 모두 유지

Page 160: Chapter 6. Configuring Basic Border Gateway Protocol

160

Case6• 동일 ISP 에 연결되는 회선은 동일 라우터에 수용

• one BGP session with AS100

Internet국내인터넷

AS200

AS99991.1.1.2 1.1.1.1

2.2.2.2 2.2.2.1AS100

3.3.3.2 3.3.3.1

L0: 4.4.4.1

L0: 6.6.6.1

A

BB

200.200.200.1

200.200.200.2

Page 161: Chapter 6. Configuring Basic Border Gateway Protocol

161

Case6(cont.)! Router Ainterface loopback 0

ip address 4.4.4.1 255.255.255.252router bgp 9999

no synchronizationno auto-summarynetwork 200.200.200.0 mask 255.255.252.0neighbor 6.6.6.1 remote-as 100neighbor 6.6.6.1 ebgp-multihop 3neighbor 6.6.6.1 update-source loopback 0neighbor 6.6.6.1 filter-list 10 outneighbor 6.6.6.1 distribute-list 100 outneighbor 200.200.200.2 remote-as 9999neighbor 200.200.200.2 next-hop-self

!ip route 6.6.6.1 255.255.255.255 1.1.1.2ip route 6.6.6.1 255.255.255.255 2.2.2.2!ip as-path access-list 10 permit ^$ip route 200.200.200.0 255.255.252.0 Null0access-li 100 per ip host 200.200.200.0 ho 255.255.252.0

Page 162: Chapter 6. Configuring Basic Border Gateway Protocol

162

Case6(cont.)! Router Brouter bgp 9999

no synchronizationno auto-summarynetwork 200.200.200.0 mask 255.255.252.0neighbor 3.3.3.1 remote-as 100neighbor 3.3.3.1 filter-list 10 outneighbor 3.3.3.1 distribute-list 100 outneighbor 200.200.200.1 remote-as 9999neighbor 200.200.200.1 next-hop-self

!access-li 100 per ip host 200.200.200.0 ho 255.255.252.0ip as-path access-list 10 permit ^$ip route 200.200.200.0 255.255.252.0 Null0

Page 163: Chapter 6. Configuring Basic Border Gateway Protocol

163

Case7

• 동일 ISP 에 연결되는 회선은 동일 라우터에 수용

• Two BGP sessions with AS100

Internet국내인터넷

AS200

AS99991.1.1.2 1.1.1.1

2.2.2.2 2.2.2.1AS100

3.3.3.2 3.3.3.1

L0: 4.4.4.1

L0: 6.6.6.1

A

BB

200.200.200.1

200.200.200.2

Page 164: Chapter 6. Configuring Basic Border Gateway Protocol

164

Case7(cont.)! Router Ainterface loopback 0

ip address 4.4.4.1 255.255.255.252router bgp 9999

no synchronizationno auto-summarynetwork 200.200.200.0 mask 255.255.252.0neighbor 1.1.1.1 remote-as 100neighbor 1.1.1.1 filter-list 10 outneighbor 1.1.1.1 distribute-list 100 outneighbor 2.2.2.1 remote-as 100neighbor 2.2.2.1 filter-list 10 outneighbor 2.2.2.1 distribute-list 100 out neighbor 200.200.200.2 remote-as 9999neighbor 200.200.200.2 next-hop-self

!ip as-path access-list 10 permit ^$ip route 200.200.200.0 255.255.252.0 Null0access-li 100 per ip host 200.200.200.0 ho 255.255.252.0

Page 165: Chapter 6. Configuring Basic Border Gateway Protocol

165

Case7(cont.)

• 이 configuration 에는 큰 문제점이 있습니다 . 무슨 문제일까요 ?

Page 166: Chapter 6. Configuring Basic Border Gateway Protocol

166

Case7(cont.) -> 해결방안! Router A……..router bgp 9999

……..network 200.200.200.0 mask 255.255.252.0network 200.200.200.0 mask 255.255.254.0network 200.200.202.0 mask 255.255.254.0 neighbor 1.1.1.1 remote-as 100neighbor 1.1.1.1 filter-list 10 outneighbor 1.1.1.1 distribute-list 100 outneighbor 2.2.2.1 remote-as 100neighbor 2.2.2.1 filter-list 10 outneighbor 2.2.2.1 distribute-list 110 out ……...

!access-li 100 per ip host 200.200.200.0 ho 255.255.252.0access-li 100 per ip host 200.200.200.0 ho 255.255.254.0!access-li 110 per ip host 200.200.200.0 ho 255.255.252.0access-li 110 per ip host 200.200.202.0 ho 255.255.254.0

Page 167: Chapter 6. Configuring Basic Border Gateway Protocol

167

Case7(cont.) -> 해결방안! Router B……..router bgp 9999

……..network 200.200.200.0 mask 255.255.252.0network 200.200.200.0 mask 255.255.254.0network 200.200.202.0 mask 255.255.254.0 neighbor 3.3.3.1 remote-as 100neighbor 3.3.3.1 filter-list 10 outneighbor 3.3.3.1 distribute-list 100 out……...

!access-li 100 per ip host 200.200.200.0 ho 255.255.252.0access-li 100 per ip host 200.200.200.0 ho 255.255.254.0access-li 100 per ip host 200.200.202.0 ho 255.255.254.0!! 만약 access-list 100 에서 ! host 200.200.200.0 ho 255.255.254.0 와! host 200.200.202.0 ho 255.255.254.0 가 없다면 문제점은 ?

Page 168: Chapter 6. Configuring Basic Border Gateway Protocol

168

Case8• 분산 수용

* 이 경우에는 bgp session 을 어떻게 맺으면 좋을까요 ?

Internet국내인터넷

AS200

AS99991.1.1.2 1.1.1.1

2.2.2.2

2.2.2.1AS100

3.3.3.2 3.3.3.1

L0: 4.4.4.1

L0: 6.6.6.1

A

BB

200.200.200.1

200.200.200.2

Page 169: Chapter 6. Configuring Basic Border Gateway Protocol

169

상황 3

• ABC-C 기업– Cisco 2501 라우터 1 대– 2Mbps 2 회선

• 1회선씩 ISP-AS100, ISP-AS200 에 접속– Outbound Traffic 이 많음– IP block 200.200.200.0/24 이용– AS Number 9999

Page 170: Chapter 6. Configuring Basic Border Gateway Protocol

170

Case9

• 구성도

Internet

AS100

국내인터넷

AS200

AS9999

1.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

Page 171: Chapter 6. Configuring Basic Border Gateway Protocol

171

Case9(cont.)

router bgp 9999…….neighbor 1.1.1.1 remote-as 100neighbor 2.2.2.1 remote-as 200neighbor 1.1.1.1 filter-list 10 outneighbor 2.2.2.1 filter-list 10 outneighbor 1.1.1.1 distribute-list 100 outneighbor 2.2.2.1 distribute-list 100 out

!! AS100 에 연결된 회선에 Outbound Traffic 이 높음! 어떻게 하면 될까요 ?

Page 172: Chapter 6. Configuring Basic Border Gateway Protocol

172

Case9(cont.) - 해결방안 1

router bgp 9999…….neighbor 1.1.1.1 remote-as 100neighbor 2.2.2.1 remote-as 200neighbor 1.1.1.1 filter-list 10 outneighbor 2.2.2.1 filter-list 10 outneighbor 1.1.1.1 distribute-list 100 outneighbor 2.2.2.1 distribute-list 100 outneighbor 1.1.1.1 filter-list 20 inneighbor 2.2.2.1 filter-list 20 in

!ip as-path access-list 20 deny .*!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1!! 회선대역이 틀릴 경우는 바람직하지 않음 ! 또 다른 한가지 문제점이라고 할 수 있는 것이 있는데 그것은 ?

Page 173: Chapter 6. Configuring Basic Border Gateway Protocol

173

Case9(cont.) - 해결방안 2

router bgp 9999…….neighbor 1.1.1.1 remote-as 100neighbor 2.2.2.1 remote-as 200neighbor 1.1.1.1 filter-list 10 outneighbor 2.2.2.1 filter-list 10 outneighbor 1.1.1.1 distribute-list 100 outneighbor 2.2.2.1 distribute-list 100 outneighbor 1.1.1.1 filter-list 20 in

!ip as-path access-list 20 permit ^(100_)+$!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1!! 회선대역이 틀릴 경우에도 이용할 수 있는 수단임 ! filter-list 20 의 내용을 정기적으로 변경 필요

Page 174: Chapter 6. Configuring Basic Border Gateway Protocol

174

Case9(cont.) - 해결방안 3router bgp 9999

…….neighbor 1.1.1.1 remote-as 100neighbor 2.2.2.1 remote-as 200neighbor 1.1.1.1 route-map HIGHMED in…….

!route-map HIGHMED permit 10

match ip as-path 20set metric 1000

route-map HIGHMED permit 20!ip as-path access-list 20 permit 300$ip as-path access-list 20 permit 300 900ip as-path access-list 20 permit 400ip as-path access-list 20 permit 700 800………….!

Page 175: Chapter 6. Configuring Basic Border Gateway Protocol

175

Appendix (For Your Info.)

• 데이콤 내부 교육용으로 만든 자료이니 참고하세요 .

• 앞에 있는 내용들과 중복된 사항들이 많습니다 .

• 오류가 있을 가능성도 있습니다 .

Page 176: Chapter 6. Configuring Basic Border Gateway Protocol

176

DACOMAS3786

KTAS4766

KTAS3559

CUSTAS100

ISP1AS2000

ISP2AS3000

10.1.1.0/24

*>10.1.1.0/24 3786 100 i 10.1.1.0/24 4766 3559 100 i

Example-1• as-path 길이가 짧은 것이 우선함

Page 177: Chapter 6. Configuring Basic Border Gateway Protocol

177

DACOMAS3786

INETAS3976

CUSTAS100

ISP1AS2000

ISP2AS3000

10.1.1.0/24

*>10.1.1.0/24 3786 100 i 10.1.1.0/24 3976 100 i

10.1.1.0/24 3786 100 i*>10.1.1.0/24 3976 100 i

Example-2

• as-path 길이가 같은 경우는 router-ID 가 작은 것을 best path 로 선택함

Page 178: Chapter 6. Configuring Basic Border Gateway Protocol

178

DACOMAS3786

INETAS3976

CUSTAS100

ISPAS200

12.1.1.0/2414.1.1.0/24

Set MED=10 outfor 12.1.1.0/24

Set MED=10 out for 14.1.1.0/24

Example-3

• 다른 두 ISP 에게 MED 를 조정해서 내보내는 것은 inbound traffic 에 거의 영향을 미치지 못함

12.1.1.0/24 로 가는 traffic

14.1.1.0/24 로 가는 traffic

Page 179: Chapter 6. Configuring Basic Border Gateway Protocol

179

Example-4

• ISP 가 MED 를 받아들인다면 동일 ISP 에게 MED 를 설정해서 보내는 것은 inbound traffic 을 조절할수 있는 수단

DACOMAS3786

CUSTAS100

12.1.1.0/2414.1.1.0/24 Set MED=10 out

for 12.1.1.0/24

Set MED=10 out for 14.1.1.0/24

*>12.1.1.0/24 n-h1 med=null 100 i 12.1.1.0/24 n-h2 med=10 100 i 14.1.1.0/24 n-h1 med=10 100 i*>14.1.1.0/24 n-h2 med=null 100 i

12.1.1.0/24 로 가는 traffic

14.1.1.0/24 로 가는 traffic

n-h1

n-h2

Page 180: Chapter 6. Configuring Basic Border Gateway Protocol

180

Example-5

• as-path prepend 로 inbound traffic 조절

DACOMAS3786

KTAS4766

KTAS3559

CUSTAS100 Internet

10.1.1.0/24

as-path prepend 100 out

*>10.1.1.0/24 3786 100 10.1.1.0/24 4766 3559 100

10.1.1.0/24 3786 100 100*>10.1.1.0/24 4766 3559 100

Page 181: Chapter 6. Configuring Basic Border Gateway Protocol

181

Example-6

• as-path prepend 로 inbound traffic 조절

DACOMAS3786

INETAS3976

CUSTAS100

Traffic 폭주

DACOMAS3786

INETAS3976

CUSTAS100

As-path prepend100 out

Page 182: Chapter 6. Configuring Basic Border Gateway Protocol

182

Example-7

• as-path prepend 를 네트웍별로 적용하여 inbound traffic 조절

CUSTAS100

12.1.1.0/2414.1.1.0/24 As-path prepend

100 for 12.1.1.0/24

As-path prepend100 for 14.1.1.0/24

*>12.1.1.0/24 3786 100 12.1.1.0/24 3976 100 100

14.1.1.0/24 3786 100 100*>14.1.1.0/24 3976 100

DACOMAS3786

INETAS3976

Internet

Page 183: Chapter 6. Configuring Basic Border Gateway Protocol

183

Example-8

• Prefix Length 로 inbound traffic 을 조절

CUSTAS100

12.1.0.0/16 12.1.0.0/17 12.1.128.0/17

DACOMAS3786

INETAS3976

Internet

12.1.0.0/1612.1.0.0/17

12.1.0.0/1612.1.128.0/17

12.1.128.0/17

12.1.128.0/17

12.1.0.0/17

12.1.0.0/17

Page 184: Chapter 6. Configuring Basic Border Gateway Protocol

184

Example-9

• MED 로 outbound path 를 선택할 수 있음

DACOMAS3786

INETAS3976

CUSTAS100

CUSTAS200

10.1.1.0/24

12.1.1.0/24

InternetSet MED=10 in for AS200

*>12.1.1.0/24 MED=null 3786 200 i 12.1.1.0/24 MED=10 3976 200 i

Page 185: Chapter 6. Configuring Basic Border Gateway Protocol

185

Example-10

• MED 를 선택적으로 적용• outbound 조절용

DACOMAS3786

INETAS3976

CUSTAS100

CUSTAS200

12.1.1.0/2414.1.1.0/24

Set MED=10 in for 12.1.1.0/24

*>12.1.1.0/24 MED=null 3786 200 i 12.1.1.0/24 MED=10 3976 200 i 14.1.1.0/24 MED=10 3786 200 i *>14.1.1.0/24 MED=null 3976 200 i

Set MED=10 in for 14.1.1.0/24

Page 186: Chapter 6. Configuring Basic Border Gateway Protocol

186

Example-11

• Default 만을 설정하여 outbound traffic 을 처리하는 방법– 국내 BGP 정보를 받는 경우– 아무 정보도 받지 않은 경우

DACOMAS3786

INETAS3976

Internet

default

default

Page 187: Chapter 6. Configuring Basic Border Gateway Protocol

187

Example-12• 2 개의 라우터를 이용하는 경우

– unbalanced outbound traffic 가능성이 높음– 그러나 안정적

Internet

default

default

DACOMAS3786

INETAS3976

Page 188: Chapter 6. Configuring Basic Border Gateway Protocol

188

Config-1

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

router bgp 3786 neigh 1.1.1.2 remote-as 100 neigh 1.1.1.2 filter-list 50 in neigh 1.1.1.2 distribute-list 120 in no sync no auto-summary!ip as-path access-list 50 permit ^(100_)+$!access-list 120 permit host 10.1.1.0 host 255.255.255.0

router bgp 3976 neigh 2.2.2.2 remote-as 100 neigh 2.2.2.2 filter-list 11 in neigh 2.2.2.2 distribute-list 130 in no sync no auto-summary!ip as-path access-list 11 permit ^(100_)+$!access-list 130 permit host 10.1.1.0 host 255.255.255.0

Page 189: Chapter 6. Configuring Basic Border Gateway Protocol

189

Config-2

10.1.1.0/241.1.1.2

1.1.1.1

2.2.2.22.2.2.1

AS3559

AS3786AS100

Interface loopback 0 ip address 192.168.1.1 255.255.255.252!router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3559 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 192.168.2.1 remote-as 3786 neigh 192.168.2.1 ebgp-multihop 3 neigh 192.168.2.1 update-source loopback0 neigh 192.168.2.1 filter-list 10 out neigh 192.168.2.1 distribute-list 100 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1ip route 0.0.0.0 0.0.0.0 3.3.3.1ip route 192.168.2.1 255.255.255.252 2.2.2.1ip route 192.168.2.1 255.255.255.252 3.3.3.1

3.3.3.23.3.3.1

192.168.1.1/30192.168.2.1/30

Interface loopback 0 ip address 192.168.2.1 255.255.255.252!router bgp 3786 neigh 192.168.1.1 remote-as 100 neigh 192.168.1.1 ebgp-multihop 3 neigh 192.168.1.1 update-source loopback0 neigh 192.168.1.1 filter-list 10 in neigh 192.168.1.1 distribute-list 100 in no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 192.168.2.1 255.255.255.252 2.2.2.2ip route 192.168.2.1 255.255.255.252 3.3.3.2

Page 190: Chapter 6. Configuring Basic Border Gateway Protocol

190

10.1.0.0/16

1.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

Config-3

• AS3786 회선에 inbound traffic 이 많을때

router bgp 100 network 10.1.0.0 mask 255.255.0.0 network 10.1.128.0 mask 255.255.128.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 110 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0!access-list 110 permit host 10.1.0.0 host 255.255.0.0access-list 110 permit host 10.1.128.0 host 255.255.128.0!ip route 10.1.0.0 255.255.0.0 null0ip route 10.1.128.0 255.255.128.0 null0ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Page 191: Chapter 6. Configuring Basic Border Gateway Protocol

191

10.1.0.0/16

1.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3559

AS100

Config-4

• AS3786 회선에 inbound traffic 이 많을때

router bgp 100 network 10.1.0.0 mask 255.255.0.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 route-map PREPEND out neigh 2.2.2.1 remote-as 3559 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0!route-map PREPEND permit 10 set as-path prepend 100!ip route 10.1.0.0 255.255.0.0 null0ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Page 192: Chapter 6. Configuring Basic Border Gateway Protocol

192

10.1.0.0/16/16

1.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

Config-5

• AS3786 회선에 inbound traffic 이 많을때

router bgp 100 network 10.1.0.0 mask 255.255.0.0 network 10.1.128.0 mask 255.255.128.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 route-map PREPEND out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0access-list 100 permit host 10.1.128.0 host 255.255.128.0!access-list 110 permit host 10.1.128.0 host 255.255.128.0!route-map PREPEND permit 10 match ip address 110 set as-path prepend 100route-map PREPEND permit 20!ip route 10.1.0.0 255.255.0.0 null0ip route 10.1.128.0 255.255.128.0 null0ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Page 193: Chapter 6. Configuring Basic Border Gateway Protocol

193

Config-6

• Network 별로 inbound traffic 을 분리 / 조절하기 위해

10.1.0.0/16

1.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.0.0 mask 255.255.0.0 network 10.1.0.0 mask 255.255.128.0 network 10.1.128.0 mask 255.255.128.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 110 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0access-list 100 permit host 10.1.128.0 host 255.255.128.0!access-list 110 permit host 10.1.0.0 host 255.255.0.0access-list 110 permit host 10.1.0.0 host 255.255.128.0!ip route 10.1.0.0 255.255.0.0 null0ip route 10.1.0.0 255.255.128.0 null0ip route 10.1.128.0 255.255.128.0 null0ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Page 194: Chapter 6. Configuring Basic Border Gateway Protocol

194

1.1.1.2

2.2.2.2

3.3.3.2

4.4.4.2

1.1.1.1

2.2.2.1

3.3.3.1

4.4.4.1

10.1.0.0/1610.1.0.0/1810.1.64.0/1810.1.128.0/1810.1.192.0/18

AS100 192.168.0.1

192.168.1.1

192.168.2.1

192.168.3.1

Interface loopback 0 ip address 192.168.0.1 255.255.255.252!router bgp 100 network 10.1.0.0 mask 255.255.0.0 network 10.1.0.0 mask 255.255.192.0 network 10.1.64.0 mask 255.255.192.0 neigh 192.168.2.1 remote-as 3786 neigh 192.168.2.1 ebgp-multihop 3 neigh 192.168.2.1 update-source loopback 0 neigh 192.168.2.1 filter-list 10 out neigh 192.168.2.1 distribute-list 100 out neigh 10.1.0.2 remote-as 100 neigh 10.1.0.2 next-hop-self no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0access-list 100 permit host 10.1.0.0 host 255.255.192.0access-list 100 permit host 10.1.64.0 host 255.255.192.0!ip route 10.1.0.0 255.255.0.0 null0ip route 10.1.0.0 255.255.192.0 null0ip route 10.1.64.0 255.255.192.0 null0ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1ip route 0.0.0.0 0.0.0.0 10.1.0.2 10ip route 192.168.2.1 255.255.255.252 1.1.1.1ip route 192.168.2.1 255.255.255.252 2.2.2.1

AS3786

10.1.0.1

10.1.0.2

Config-7

• 데이콤에 여러 개의 회선을 안정성을 위해 분리 접속할 경우

Page 195: Chapter 6. Configuring Basic Border Gateway Protocol

195

Config-8

1.1.1.2

2.2.2.2

3.3.3.2

4.4.4.2

1.1.1.1

2.2.2.1

3.3.3.1

4.4.4.1

10.1.0.0/1610.1.0.0/1810.1.64.0/1810.1.128.0/1810.1.192.0/18

AS100 192.168.0.1

192.168.1.1

192.168.2.1

192.168.3.1

Interface loopback 0 ip address 192.168.1.1 255.255.255.252!router bgp 100 network 10.1.0.0 mask 255.255.0.0 network 10.1.128.0 mask 255.255.192.0 network 10.1.192.0 mask 255.255.192.0 neigh 192.168.3.1 remote-as 3786 neigh 192.168.3.1 ebgp-multihop 3 neigh 192.168.3.1 update-source loopback 0 neigh 192.168.3.1 filter-list 10 out neigh 192.168.3.1 distribute-list 100 out neigh 10.1.0.1 remote-as 100 neigh 10.1.0.1 next-hop-self no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.0.0 host 255.255.0.0access-list 100 permit host 10.1.128.0 host 255.255.192.0access-list 100 permit host 10.1.192.0 host 255.255.192.0!ip route 10.1.0.0 255.255.0.0 null0ip route 10.1.128.0 255.255.192.0 null0ip route 10.1.192.0 255.255.192.0 null0ip route 0.0.0.0 0.0.0.0 3.3.3.1ip route 0.0.0.0 0.0.0.0 4.4.4.1ip route 0.0.0.0 0.0.0.0 10.1.0.1 10ip route 192.168.3.1 255.255.255.252 3.3.3.1ip route 192.168.3.1 255.255.255.252 4.4.4.1

AS3786

10.1.0.1

10.1.0.2

• 데이콤에 여러 개의 회선을 안정성을 위해 분리 접속할 경우

Page 196: Chapter 6. Configuring Basic Border Gateway Protocol

196

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out no sync no auto-summary!ip as-path access-list 10 permit ^$!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-9

• 양 사업자가 주는 국내정보를 받을때

Page 197: Chapter 6. Configuring Basic Border Gateway Protocol

197

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 filter-list 20 in neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 filter-list 20 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 20 deny .*!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-10

• 양 사업자로부터 아무 정보도 받지 않고 default 로 outbound traffic 분산

Page 198: Chapter 6. Configuring Basic Border Gateway Protocol

198

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out no neigh 1.1.1.1 filter-list 20 in neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 filter-list 20 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 20 deny .*!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-11

• 국내는 AS3786 을 통해 가게하고 , 해외는 양사업자로 분산해서 가게 할떄

Page 199: Chapter 6. Configuring Basic Border Gateway Protocol

199

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3559

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 filter-list 20 in neigh 2.2.2.1 remote-as 3559 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 filter-list 30 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 20 3786$ip as-path access-list 30 3559$!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-12

• AS3559, AS3786 영역은 직회선을 이용하게 하고 , 나머지는 임의로 분산해서 가도록 함

Page 200: Chapter 6. Configuring Basic Border Gateway Protocol

200

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3559

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 filter-list 20 in neigh 2.2.2.1 remote-as 3559 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 filter-list 30 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 20 permit 3786$ip as-path access-list 30 permit .*!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-13

• AS3786 으로는 직회선 이용 , 나머지는 KT회선 이용 , 해외는 임의로 분산

Page 201: Chapter 6. Configuring Basic Border Gateway Protocol

201

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3559

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3559 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 filter-list 30 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 30 deny (3786|3976)ip as-path access-list 30 permit .*!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-14

• AS3786,AS3976으로 가는 것은 AS3786 과의 직회선을 이용하게 하고 , 나머지는 임의 분산

Page 202: Chapter 6. Configuring Basic Border Gateway Protocol

202

10.1.1.0/24/241.1.1.2

1.1.1.1

2.2.2.2

2.2.2.1

AS3786

AS3976

AS100

router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3786 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 2.2.2.1 remote-as 3976 neigh 2.2.2.1 filter-list 10 out neigh 2.2.2.1 distribute-list 100 out neigh 2.2.2.1 route-map INET in no sync no auto-summary!Ip as-path access-list 10 permit ^$ip as-path access-list 20 permit (4766|2563|1237|3608)!access-list 100 permit host 10.1.1.0 host 255.255.255.0!route-map INET permit 10 match ip as-path 20 set metric 100route-map INET permit 20!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1

Config-15

• AS4766,2563,1237,3608 로 가는 traffic은 AS3786 과의 직회선을 이용하게 하고 , 나머지는 임의 분산

Page 203: Chapter 6. Configuring Basic Border Gateway Protocol

203

Config-16

• Outbound 가 많은 site 에서 ISP 와 연결된 회선대역이 틀릴 경우

10.1.1.0/241.1.1.2

1.1.1.1

2.2.2.22.2.2.1

AS3559

AS3786AS100 3.3.3.2

3.3.3.1192.168.1.1/30

192.168.2.1/30

Interface loopback 0 ip address 192.168.1.1 255.255.255.252!router bgp 100 network 10.1.1.0 mask 255.255.255.0 neigh 1.1.1.1 remote-as 3559 neigh 1.1.1.1 filter-list 10 out neigh 1.1.1.1 distribute-list 100 out neigh 1.1.1.1 filter-list 20 in neigh 192.168.2.1 remote-as 3786 neigh 192.168.2.1 ebgp-multihop 3 neigh 192.168.2.1 update-source loopback0 neigh 192.168.2.1 filter-list 10 out neigh 192.168.2.1 distribute-list 100 out neigh 192.168.2.1 filter-list 30 in no sync no auto-summary!ip as-path access-list 10 permit ^$ip as-path access-list 20 permit (3559|4766|7563)ip as-path access-list 30 permit (3786|1237|2563)!access-list 100 permit host 10.1.1.0 host 255.255.255.0!ip route 0.0.0.0 0.0.0.0 1.1.1.1ip route 0.0.0.0 0.0.0.0 2.2.2.1ip route 0.0.0.0 0.0.0.0 3.3.3.1ip route 192.168.2.1 255.255.255.252 2.2.2.1ip route 192.168.2.1 255.255.255.252 3.3.3.1

Page 204: Chapter 6. Configuring Basic Border Gateway Protocol

204

Page 205: Chapter 6. Configuring Basic Border Gateway Protocol

BGP Filtering(Policy Routing)

Page 206: Chapter 6. Configuring Basic Border Gateway Protocol

BGP Filtering

• Can Apply our Routing Policy

• Controlling the sending and receiving updates

• Prefix Filtering

• AS_Path Filtering

• Route-map Filtering

• Community Filtering

Page 207: Chapter 6. Configuring Basic Border Gateway Protocol

Network Example

AS1

2.2.2.2A

C

B

AS2

AS3

AS4

2.2.2.1 3.3.3.1

3.3.3.2

150.10.0.0/16 160.10.0.0/16

170.10.0.0/16

180.10.0.0/16

160.10.0.0/16network as-path150.10.0.0/16 170.10.0.0/16 3 180.10.0.0/16 3 2 4

network as-path150.10.0.0/16 170.10.0.0/16 3 180.10.0.0/16 3 2 4

network as-path150.10.0.0/16 1160.10.0.0/16 2170.10.0.0/16 180.10.0.0/16 2 4

network as-path150.10.0.0/16 1160.10.0.0/16 2170.10.0.0/16 180.10.0.0/16 2 4

Page 208: Chapter 6. Configuring Basic Border Gateway Protocol

Prefix Filtering

• RTC’s configurationbgp router 3 network 170.10.0.0 neighbor 3.3.3.2 remote-as 2 neighbor 2.2.2.2 remote-as 1 neighbor 2.2.2.2 distribute-list 1 outip as-path access-list 1 deny 160.10.0.0 0.0.255.255ip as-path access-list 1 permit any

Page 209: Chapter 6. Configuring Basic Border Gateway Protocol

AS_path Filtering

• RTC’s configurationbgp router 3 network 170.10.0.0 neighbor 3.3.3.2 remote-as 2 neighbor 2.2.2.2 remote-as 1 neighbor 2.2.2.2 filter-list 1 outip as-path access-list 1 deny ^2$ip as-path access-list 1 permit .*

• as-path access-list is only applied to AS_path in the bgp entries

• sh ip bgp regexp regular-expression– sh ip bgp re ^$– sh ip bgp re ^2$– sh ip bgp re ^2– sh ip bgp re 2

Page 210: Chapter 6. Configuring Basic Border Gateway Protocol

Regular Expression

• .

• *

• +

• ?

• ^

• $

• _

• [ ]

• -

match any single char, including white space

match 0 or more sequences of the pattern

match 1 or more sequences of the pattern

match 0 or 1 occurrence of the pattern

match the beginning of the input string

match the end of the input string

match comma, {, }, (, ), ^, $, space

designate a range of single-char patterns

separate the end points of a range

Page 211: Chapter 6. Configuring Basic Border Gateway Protocol

Regular Expression (cont.)

• ^$

• .*

• 300

• ^300

• ^300$

• ^300_

• _300$

• _300_

• ^(300_)*$

paths in local AS

paths

paths including 300

paths announced from AS300 directly

paths in AS300

equal to regexp ^300

paths originated from AS300

equal to regexp 300

^$, ^300$, ^300 300$, ^300 300 300$, ...

Page 212: Chapter 6. Configuring Basic Border Gateway Protocol

Route-map Filtering

• RTC’s configurationbgp router 3 network 170.10.0.0 neighbor 3.3.3.2 remote-as 2 neighbor 2.2.2.2 remote-as 1 neighbor 2.2.2.2 route-map AS2FILTER 1 outip as-path access-list 1 deny ^2$route-map AS2FILTER permit 10 match as-path 1router-map AS2FILTER permit 20

• route-map is more powerful than filter-list– because route-map can check many things and c

hange many attributes

Page 213: Chapter 6. Configuring Basic Border Gateway Protocol

Community Filtering

• RTB’s configurationbgp router 2 network 160.10.0.0 neighbor 3.3.3.1 remote-as 3 neighbor 3.3.3.1 send-community neighbor 3.3.3.1 route-map SETCOMMUNITY outroute-map SETCOMMUNITY permit 10 match ip adress 1 set community no-exportroute-map SETCOMMUNITY permit 20access-list 1 permit 160.10.0.0 0.0.255.255

• This prevents RTC from announcing the routes received from RTB to other peers.

Page 214: Chapter 6. Configuring Basic Border Gateway Protocol

Community Filtering (cont.)

• RTC’s configurationbgp router 3 network 170.10.0.0 neighbor 3.3.3.2 remote-as 2 neighbor 3.3.3.2 route-map check-community in route-map check-community permit 10 match community 1 set weight 20 route-map check-community permit 20 match community 2 exact set weight 10 route-map check-community permit 30 match community 3ip community-list 1 permit 100ip community-list 2 permit 200ip community-list 3 permit internet

Page 215: Chapter 6. Configuring Basic Border Gateway Protocol

BGP SUMMARY

Page 216: Chapter 6. Configuring Basic Border Gateway Protocol

216

Number of routes received

If no state is indeicated the state is up

Origin code

Statuscode

s—The table entry is suppressed.*—The table entry is valid.>—The table entry is the best entry to use for that network.i—The table entry was learned via an iBGP session.

Page 217: Chapter 6. Configuring Basic Border Gateway Protocol

217

P1R1 : show ip bgp

Page 218: Chapter 6. Configuring Basic Border Gateway Protocol

218

P1R1 : show ip route

DistanceiBGP : 200, eBGP : 20

Page 219: Chapter 6. Configuring Basic Border Gateway Protocol

219

P1R2 : show ip bgp

Page 220: Chapter 6. Configuring Basic Border Gateway Protocol

220

P1R2 : show ip route

DistanceiBGP : 200, eBGP : 20

Page 221: Chapter 6. Configuring Basic Border Gateway Protocol

221

P1R1 : redistribute static

Page 222: Chapter 6. Configuring Basic Border Gateway Protocol

222

P1R2 : Origin Attribute (incomplete)

Page 223: Chapter 6. Configuring Basic Border Gateway Protocol

223

BBR1 : Origin Attribute (incomplete)