본문 바로가기
network/ccie-bgp

Implementing BGP Peer Groups

 
Peer Group Requirements

- peer group 을 통하여 config 를 줄일 수 있다.
-  provider edge router이 여러개의  custormer edge 가 연결되어 있을 경우 사용 되며
, replector 가 많은 ibgp peer 있을 경우 peer group 사용하여 템플릿 처럼 사용 된다.
- peer group 을 이용하여 재사용성이 높게 한다.

- 아래 그림처럼 동일한 필터링기법이 있을 경우 사용 된다.

 


-아래 그림 처럼 as번호, 나가는 인터페이스 등이 동일 할 때도 사용 된다.

- 아래 그림 처럼 edge 라우터가 동일한 조건으로 peer 에 적용 하거나 변경 할 떄 사용 된다.



Peer Groups as a BGP Performance Tool

.  bgp네이버가 많을수록 cpu 부하가 높아 진다.
.  peer group 을 사용 시 네이버가 많아 져도 cpu 부하가 증가 하지 않는다.=> in/out 할때 peer group 프로세스 하나로 처리 되기 때문에 
프로세스가 증가 하지 않는다.
. 단순히 config 를 줄일 수 있을 뿐만 아니라 프로세스에서도 cpu 부하가 증가 하지 않는 장점이 있다.

. 하지만, 설정시 각각 의 네이버에 대한 out boud  정책은 적용 하지 않는다 -> out bound 프로세싱이 먼저 처리 된뒤 peer group 을 적용 하기 떄문에
out bound 에 대한 적용이 되지 않는다.(단, in 에대한 정책은 peer group 후 in 에 대한 정책은 처리 된다.)
. 또한,bgp 와 ebgp 섞어서 peer group을 적용 해서는 안된다.

- 아래 정책들을 peer group 에 적용 가능 하다.(만약  기존 설정이 있다면 지운 후에 진행 해야 한다) 
– Community propagation
– Source interface for TCP session
– EBGP multihop sessions
– MD5 password
– Neighbor weight
– Filter-lists and distribute-lists
– Route-maps

Peer Templates

• Peer session templates=> 세션을 맺기위한 템플릿(multi-hop,password...등 )
• Peer policy templates => 정책을 적용 하기 위한 템플릿(route-map ,community ... 등)

Configuring Peer Groups

# bgp peer group 을 생성 한다.(대소문자 구분)
router(config-router)#neighbor group-name peer-group

# 해당 peer group 에 특별한 bgp parameter 를 추가 한다.
router(config-router)#neighbor group-name any-BGP-parameter

# 해당 네이버를 peer group 에 적용 한다.
router(config-router)#neighbor ip-address peer-group peer-group-name

#해당 네이버에 개별적인 parameter 를 추가 하는데 in 만 가능 하다.
router(config-router)#neighbor ip-address any-BGP-parameter

- 아래 예제는 customers 라는 peer group 을 생성 하여, route-map filter-list 등 설정 한뒤 각각의 네이버에게 적용 하였다.
이때 , 2.3.4.5 에 대하여는 peer group 이 적용 안되고 in 으로 설정 된 filter list 가 적용 된다.



- 아래 예제 처럼 peergroup 을 통해서 config 를 줄일수 있으며, processing 을 줄일 수 있다.


- 아래 그림은 peering 이라는 peer-group 을 통해서 기존에 confing 된 설정을 지워서 over config 를 삭제 한다.


Monitoring Peer Groups

# 해당 peer group 정보
router>show ip bgp peer-group [peer-group-name]

# 해당 peer group 에 관련된 네이버 정보 출력
router>show ip bgp peer-group [peer-group-name] summary

# 특정 peer group 에 대한 clear
router>clear ip bgp [peer-group-name] [[soft] in|out]


## 기존 R4의 bgp 네이버 설정은 아래와 같이 되어 있다.
R4(config)#router bgp 123
 no synchronization
 bgp cluster-id 4.4.4.4
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 123
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 1.1.1.1 route-reflector-client
 neighbor 5.5.5.5 remote-as 123
 neighbor 5.5.5.5 update-source Loopback0
 neighbor 5.5.5.5 route-reflector-client
 neighbor 6.6.6.6 remote-as 123
 neighbor 6.6.6.6 update-source Loopback0
 neighbor 6.6.6.6 route-reflector-client
 no auto-summary

## 기존 설정을 제거 뒤 아래와 같이 peer-group 을 통하여 처리 할 수 있다.
R4(config)#router bgp 123
 neighbor peer_test peer-group
 neighbor peer_test remote-as 123
 neighbor peer_test update-source Loopback0
 neighbor peer_test route-reflector-client
 neighbor 1.1.1.1 peer-group peer_test
 neighbor 5.5.5.5 peer-group peer_test
 neighbor 6.6.6.6 peer-group peer_test

# show ip bgp peer-group 명령어로 peer group 의 정책 summary를 통해 자세한 정보를 확인 할 수 있다.
R4#show ip bgp peer-group
BGP peer-group is peer_test,  remote AS 123
  BGP version 4
  Default minimum time between advertisement runs is 0 seconds

 For address family: IPv4 Unicast
  BGP neighbor is peer_test, peer-group internal, members:
  1.1.1.1 5.5.5.5 6.6.6.6
  Index 0, Offset 0, Mask 0x0
  Route-Reflector Client
  Update messages formatted 0, replicated 0
  Number of NLRIs in the update sent: max 0, min 0

R4#show ip bgp peer-group  peer_test summary
BGP router identifier 4.4.4.4, local AS number 123
BGP table version is 51, main routing table version 51
15 network entries using 1755 bytes of memory
16 path entries using 832 bytes of memory
8/6 BGP path/bestpath attribute entries using 992 bytes of memory
4 BGP AS-PATH entries using 96 bytes of memory
2 BGP community entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 3723 total bytes of memory
BGP activity 15/0 prefixes, 32/16 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4   123      22      20       51    0    0 00:01:55       11
5.5.5.5         4   123      13      17       51    0    0 00:01:55        2
6.6.6.6         4   123      17      17       51    0    0 00:01:55        3



## 또한 , Maximum-Prefix를 조절하여 많은 양의 네트워크 광고를 조절 할 수 있다.
## 아래와 같이 기존에 11개의 네트워크를 1.1.1.1 로 받는데 10개를 받을 경우 아래와 같이 네이버를 종료 시킨다.

R4(config-router)#no neighbor 1.1.1.1 maximum-prefix 10
*Mar  9 15:59:05.850: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Down Maximum-Prefix restart timeout

## 네이버 상태를 확인 하면 해당 네이버 상태가 Idle (PfxCt) 상태로 자신의 장비에서 idle 상태로 timeout 시간 까지 네이버를 
## 다시 연결 하지 않는다.

R4#show ip bgp summary
BGP router identifier 4.4.4.4, local AS number 123
BGP table version is 106, main routing table version 106
4 network entries using 468 bytes of memory
5 path entries using 260 bytes of memory
4/2 BGP path/bestpath attribute entries using 496 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
1 BGP community entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 1272 total bytes of memory
BGP activity 37/33 prefixes, 54/49 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4   123      63      52        0    0    0 00:02:39 Idle (PfxCt)
5.5.5.5         4   123      28      37      106    0    0 00:12:50        2
6.6.6.6         4   123      36      37      106    0    0 00:12:50        3


##만약 restart 1로 할경우 다시 네이버를 맺을 timeout 시간을 변경 한다 1로 할 경우 1분 뒤 다시 네이버를 연결 하려고 한다.
R4(config-router)#neighbor 1.1.1.1 maximum-prefix 10 60 restart 1   

## warring only 를 추가 하면 경고만 하고 경고는 11개의 60프로가 넘을 경우 경고 메세지를 보낸다.
R4(config-router)#no neighbor 1.1.1.1 maximum-prefix 11 60 warning-only
R4#
*Mar  9 15:57:04.082: %BGP-3-MAXPFXEXCEED: No. of prefix received from 1.1.1.1 (afi 0): 11 exceed limit 11

 

반응형