본문 바로가기
network/ccie-bgp

Configuring a Transit AS

 
Configuring a Transit AS

## IBGP Neighbors 연결 (AS번호만 동일한 AS인지만 확인 한다.
## IBGP이기 떄문에 ip-address 는 루프백 주소 입력 
router(config-router)# neighbor ip-address remote-as as-number

## 해당 정보 주석
router(config-router)# neighbor ip-address description text

## IBGP는 아래와 같이 업데이트 인터페이스를 루프백으로 해야 업데이트 source 아이피가 루프백으로 간다,
router(config-router)# neighbor ip-address update-source interface


## 아래 토폴로지 에서 R1,4,5,6 구간을 IGP OSPF를 이용, IBGP를 구성 하는 LAB을 진행 해 본다.

 


## R1에서 같은 AS 123 으로 loopback 0 (1.1.1.1)으로 네이버를 서로 할 수 있도록 설정 한다.
## black hole 테스트를 위해 아직 full mash 로 구성 하지 않는다.
R1(config)#router bgp 123
R1(config-router)#neighbor 4.4.4.4 remote-as 123
R1(config-router)# neighbor 4.4.4.4 update-source Loopback0

## 4에서도 동일하게 설정 한다.(5,6 생략)
R4(config)#router bgp 123
R4(config-router)#neighbor 1.1.1.1 remote-as 123
R4(config-router)# neighbor 1.1.1.1 update-source Loopback0
R4(config-router)# neighbor 5.5.5.5 remote-as 123
R4(config-router)#neighbor 5.5.5.5 update-source Loopback0
R4(config-router)#neighbor 6.6.6.6 remote-as 123
R4(config-router)# neighbor 6.6.6.6 update-source Loopback0

## 네이버가 연결 되는 과정을 패킷으로 확인 하면 아래와 같이 서로의 루프백 주소로 네이버를 맺기 위해 
## EBGP와 동일 하기 tcp로 세션을 맺으며 open massage 등  EBGP와 동일하게 패킷을 주고 받는다.
## 이때 차이점은 ttl값이 EBGP와 틀리게 255로 나온다.

 

 

 


## EBGP를 할경우 아래와 같이 TTL값이 1로 설정되어 인접된  1node 장비와만 네이버가 된다.



## 이때 R6 에서는 split horizon 으로 loop 방지로 R4에서는 R1에서 보낸 BGP정보를 확인 할 수 있지만 R5,6에서는 
## 확인 할 수 없다는 것을 확인 한다.
R6#show ip bgp

R6#show ip bgp summ
R6#show ip bgp summary
BGP router identifier 6.6.6.6, local AS number 123
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
4.4.4.4         4   123      11      11        1    0    0 00:07:49        0



## 이때 full mash 로 하면 R6에서  R1에 있는 BGP테이블 정보를 수신 해서 올리는 것을 확인 할 수 있다.
R6(config-router)#do sho ip bgp
BGP table version is 3, local router ID is 6.6.6.6
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i1.0.0.0          1.1.1.1                  0    100      0 i
* i2.2.2.2/32       10.10.12.2               0    100      0 456 ?
* i10.10.12.0/24    10.10.12.2               0    100      0 456 ?
* i10.10.23.0/24    10.10.12.2               0    100      0 456 ?
* i22.22.22.22/32   10.10.12.2               0    100      0 456 ?
* i33.0.0.0         10.10.12.2               0    100      0 456 789 i
*>i111.111.111.111/32
                    1.1.1.1                  0    100      0 i
* i222.222.222.222/32
                    10.10.12.2               0    100      0 456 ?


## 그리고 R4에서는 해당 정보는 받았지만 ">" 가 없다 -> 즉 path 가 없다는 의미이다. 해당 내용은 AS번호가 틀리기 때문에 EDGE라우터에서 보낸 nexthop정보가
## 변경 되지 않기 때문이다.
R4#show ip bgp
BGP table version is 7, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i1.0.0.0          1.1.1.1                  0    100      0 i
* i2.2.2.2/32       10.10.12.2               0    100      0 456 ?
* i10.10.12.0/24    10.10.12.2               0    100      0 456 ?
* i10.10.23.0/24    10.10.12.2               0    100      0 456 ?
* i22.22.22.22/32   10.10.12.2               0    100      0 456 ?
* i33.0.0.0         10.10.12.2               0    100      0 456 789 i
*>i111.111.111.111/32
                    1.1.1.1                  0    100      0 i
* i222.222.222.222/32
                    10.10.12.2               0    100      0 456 ?

## 패킷을 확인 해도 next-hop 이 area 456,789 쪽으로 가는 경로 10.10.12.2는 모르기 때문에 R4에서는 통신이 안된다.
 

 



## R1에서 EBGP로 동작하는 외부 경로에 대하여 IBGP네이버에게 NEXT-hop정보를 변경 하기 위해 해당 네이버에게 1.1.1.1 이라는 
## 자신의 루프백 아이피로 변경 하도록 설정 한다.
R1(config-router)#neighbor 4.4.4.4 next-hop-self
R1(config-router)#neighbor 5.5.5.5 next-hop-self
R1(config-router)#neighbor 6.6.6.6 next-hop-self

## 설정 되에 아래와 같이 update mssage 를 다시 보내며 동일한 정보에 path attribute next hop 만 자기 자신의 루프백 아이피로 변경에서 보낸다.

 


## 또한 R5,6에서 bgp테이블에서 아래와 같이 ">"표시로 경로를 확인 할 수 있다.
R6#show ip bgp
BGP table version is 14, local router ID is 6.6.6.6
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*>i1.0.0.0          1.1.1.1                  0    100      0 i
*>i2.2.2.2/32       1.1.1.1                  0    100      0 456 ?
r>i4.4.4.4/32       4.4.4.4                  0    100      0 i
r>i5.5.5.5/32       5.5.5.5                  0    100      0 i
*> 6.6.6.6/32       0.0.0.0                  0         32768 i
*>i10.10.12.0/24    1.1.1.1                  0    100      0 456 ?
*>i10.10.23.0/24    1.1.1.1                  0    100      0 456 ?
*>i22.22.22.22/32   1.1.1.1                  0    100      0 456 ?
*>i33.0.0.0         1.1.1.1                  0    100      0 456 789 i
*>i111.111.111.111/32
                    1.1.1.1                  0    100      0 i
*>i222.222.222.222/32
                    1.1.1.1                  0    100      0 456 ?

## 만약 R4에서 네이버 연결을 끊고 R1와 R5, R5와 R6, R6과 R1만  네이버 연결이 되어 있을 경우 
## 기존에 R6에서 R2로 ping이 가는 것 을 확인 한후 테스트 한다.
R6#ping 2.2.2.2 source 6.6.6.6   
!!!!!

## 네이버를 연결 해제 한다.
R4(config-router)#neighbor 1.1.1.1 remote-as 123 sh
*Feb 29 14:29:01.527: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Down Admin. shutdown
R4(config-router)#neighbor 5.5.5.5 remote-as 123 sh
R4(config-router)#[~[~
*Feb 29 14:29:08.639: %BGP-5-ADJCHANGE: neighbor 5.5.5.5 Down Admin. shutdown
R4(config-router)#neighbor 6.6.6.6 remote-as 123 sh
R4(config-router)#
*Feb 29 14:29:19.015: %BGP-5-ADJCHANGE: neighbor 6.6.6.6 Down Admin. shutdown
R4(config-router)#

## 다시 ping 을 할 경우 R4가 블랙홀로 정보를 포워딩 할 수 없으므로 
## R6에 R4가 경로가 없다는 응답으로 메세지를 수신 할 수 있다.
R6#ping 2.2.2.2 source 6.6.6.6   

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 6.6.6.6
UUUUU
Success rate is 0 percent (0/5)




Configuring BGP Synchronization(*)

# 외부에서 들어온 정보를 내부로 재분배 할 경우 라우팅 테이블과BGP테이블과 일치가 되면 업데이트를 되도록 하는 경우를 BGP Sync라고 한다.
# 만약 no sync 일 경우 sync 가 되지 않더라도 업데이트 되지 않는다
# 모든 BGP정보를 IGP로 모두 동기화 할 수 없으로묘 no sync 를 한다.(Default no sync)

router(config-router)# no synchronization

## AD값 변경 
# 특별한 경우 아니면 변경 할 필요는 없다.
router(config-router)#  distance bgp external internal local

Scalability Limitations of IBGP-Based  Transit Backbones

full mash로 tcp세션을 맺을 경우 너무 많은 라우팅 트래픽이 발생 하고자 2가지 대안책이 있다.

Route reflectors (RR)
- full mash 를 사용하지 않기 위해 , IBGP로 받은 정보 IBGP로 업데이트 가능 -> BGP split horizon 무시 정책 

BGP confederations
- cisco,hawai  전용 -> 가상으로 내부에 private as 를 만들어 외부에서 받은 정보를 IBGP에서 받은 정보를 IBGP로 보내는 것이 아니라 EBGP로 보내는 
것을 만들어 split horizon 법칙을 속이는 정책


 

반응형

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

Outbound Route Filtering  (0) 2016.03.04
Forwarding Packets in a Transit AS  (0) 2016.03.04
Working with a Transit AS  (0) 2016.03.04
Configuring Basic BGP  (0) 2016.02.26
Processing BGP Routes  (0) 2016.02.26