본문 바로가기
network/ccie-bgp

Influencing BGP Route Selection with Weights

BGP Route Selection Criteria

- next hop 정책을 제외한 가장 첫번째 우선 순위
- cisco 전용으로 해당 장비에서만 인식 하며, 외부로 업데이트 되지 않는다.

• Prefer highest weight (local to router)
• Prefer highest local preference (global within AS)
• Prefer routes that the router originated
• Prefer shorter AS paths (only length is compared)
• Prefer lowest origin code (IGP < EGP < Incomplete)
• Prefer lowest MED
• Prefer external (EBGP) paths over internal (IBGP)
• For IBGP paths, prefer path through closest IGP neighbor
• For EBGP paths, prefer oldest (most stable) path
• Prefer paths from router with the lower BGP router-ID
•lower ip address

*단 med 값 까지 같을 경우 lodabalancing 옵션을 사용 가능 하다.

• BGP routing policy can be specified by using(bgp 라우팅 정책은 특별하게 사용 할 수 있다)
     – Weight: provides local routing policy (within a router) ->라우터 내부 정책 
     – Local preference: provides AS-wide routing policy -> AS내에서 대하여 정책을 제종

• BGP weights are specified per neighbor.
     – Default weight  -> 기본 설정으로 인한 설정
     – Complex criteria with route-maps - > route-map 으로 설정 

Configuring Per-Neighbor Weights

## 아래와 같이 weight 를 조절 할 수 있다.
## 해당 BGP경로로 오는 정보에 대하여 weight 값을 설정 할 수 있다.
## 높은 값이 우선 된다.
## outgoing 은 안되며, incoming update 에 대하여 정책이 된다.

router(config-router)#neighbor ip-address weight weight

- 아래 그림과 같이 weight 값 조절로 backup 구성이 가능 하다.



- show ip bgp 로 weight 값을 확인 가능 하며, 변경된 best path 를 확인 가능 하다.


Changing Weights with Route-Maps

- 아래와 같이 defualt 설정이 아닌 route-map 으로 설정 가능 하다.






## 아래 BGP테이블에서 2.2.2.2 /32 에 대한 정보는 as-path 가 짧은 10.10.12.2 로 가게 되는 경로를 BEST를 보게 된다


## 아래 acl과 route-map 을 이용하여 해당 10.10.13.3 에서 들어오는 네트워크 정보에 대하여
## 2.2.2.2 /32 로 들어오는 정보는 weight를 200 으로 설정 하는 filter 설정을 진행 한다.

R1(config)#access-list 98 permit 2.2.2.2 0.0.0.0
R1(config)#route-map w200 permit 10
 match ip address 98
 set weight 200
!
R1(config)#route-map w200 permit 20
!
R1(config)#router bgp 123
 neighbor 10.10.13.3 route-map w200 in

## 위 설정 적용후 정상적으로 BEST PATH가 AS PATH 가 길지만 변경 되었는것을 확인 할 수 있다.


## 해당 네트워크에 대한 detail 정보를 확인 하면 해당 10.10.13.3 네이버에 대한 weight 값이 200 으로 설정 되어 BSET로 나온 것을 확인 할 수 있다.
## 만약 별도 설정 없이 0 일 경우 별도로 나오지 않는다.


## 또한, 해당 route-map 설정후 양 네이버간 refrash 후 새로 update massage 를 수신 하게 되면 weight 값이 path attribute에 없다 .
## 즉, weight 는 자신의 장비에서만 설정 가능하며 , 해당 정보는 광고 되지 않는다. 
## 만약 광고 하면서 경로 지정?(필터링?) 하기 위해서는 lp 또는 metric 등 , path attribute에 있는 속성을 이용하여 진행 해야 한다.

 

BGP Route Selection and  Filtering Tools Summary

prefix-list-in -> filterlist in -> default weight - >route-map 순서로 먼저 처리 된다.
(filter-list weight 는 사용 안됨)

반응형

'network > ccie-bgp' 카테고리의 다른 글

Using AS-Path Prepending  (0) 2016.03.06
Setting BGP Local Preference  (0) 2016.03.06
Implementing Changes in BGP Policy  (0) 2016.03.05
Route-maps are very complex access-lists  (0) 2016.03.05
Filtering with Prefix-Lists  (0) 2016.03.05