R1과 R2 eBGP 구성
R1
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
router bgp 1
bgp log-neighbor-changes
network 1.1.1.0 mask 255.255.255.0
neighbor 192.1.12.2 remote-as 2
R2
router bgp 2
neighbor 192.1.12.1 remote-as 1
R2, R3, R4 OSPF 구성
R2
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
router ospf 1
network 2.2.2.2 0.0.0.0 area 0
network 192.1.23.0 0.0.0.255 area 0
R3
router ospf 1
network 192.1.23.0 0.0.0.255 area 0
network 192.1.34.0 0.0.0.255 area 0
R4
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
router ospf 1
network 4.4.4.4 0.0.0.0 area 0
network 192.1.34.0 0.0.0.255 area 0
R2와 R4 iBGP 구성
R2
router bgp 2
neighbor 4.4.4.4 remote-as 2
neighbor 4.4.4.4 update-source Loopback0
R4
router bgp 2
neighbor 2.2.2.2 remote-as 2
neighbor 2.2.2.2 update-source Loopback0
R4와 R5 eBGP 구성
R4
router bgp 2
neighbor 192.1.45.5 remote-as 3
R5
router bgp 3
neighbor 192.1.45.4 remote-as 2
1.1.1.0/24에 대한 BGP 테이블 확인
R2#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 192.1.12.1 0 0 1 i
R3#sh ip bgp
% BGP not active
R4#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
* i 1.1.1.0/24 192.1.12.1 0 100 0 1 i
R5#sh ip bgp
R4#sh ip route 192.1.12.1
% Network not in table
R2
router bgp 2
neighbor 4.4.4.4 next-hop-self
R4
router bgp 4
neighbor 2.2.2.2 next-hop-self
두 가지 변경 사항. 첫 째, '>' 기호 표시와(라우팅 테이블에 2.2.2.2 경로를 설치할 수 있음을 의미) 넥스트 홉이 R2의 루프백 인터페이스로 변경. (192.1.12.1 → 2.2.2.2)
R4#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*>i 1.1.1.0/24 2.2.2.2 0 100 0 1 i
R4에서 라우팅 테이블에 설치하였으므로 R5에 접두사 광고.
R5#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 192.1.45.4 0 2 1 i
R5#sh ip rou bgp
1.0.0.0/24 is subnetted, 1 subnets
B 1.1.1.0 [20/0] via 192.1.45.4, 00:07:02
R3 - iBGP 구성
R3
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
router ospf 1
network 3.3.3.3 0.0.0.0 area 0
!
router bgp 2
neighbor 2.2.2.2 remote-as 2
neighbor 2.2.2.2 update-source Loopback0
neighbor 4.4.4.4 remote-as 2
neighbor 4.4.4.4 update-source Loopback0
R2
router bgp 2
neighbor 3.3.3.3 remote-as 2
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
R4
router bgp 2
neighbor 3.3.3.3 remote-as 2
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
R3에서 iBGP 구성 후 R3, R1에서 1.1.1.0/24의 BGP 테이블 확인
R3#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*>i 1.1.1.0/24 2.2.2.2 0 100 0 1 i
ping 확인
R2#ping 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/3 ms
R3#ping 1.1.1.1
.....
Success rate is 0 percent (0/5)
R4#ping 1.1.1.1
.....
Success rate is 0 percent (0/5)
R5#ping 1.1.1.1 sou 5.5.5.5
.....
Success rate is 0 percent (0/5)
R3에서 여전히 ping 안 됨, R3의 테이블 확인시 목적지까지 경로에 대해 문제 없으며, R1의 테이블 확인 필요.
R1#sh ip route
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Loopback0
L 1.1.1.1/32 is directly connected, Loopback0
192.1.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.1.12.0/24 is directly connected, GigabitEthernet0/0
L 192.1.12.1/32 is directly connected, GigabitEthernet0/0
R1은 R3으로의 경로가 없으며, R3으로부터 다음의 IP 패킷을 수신한다.
- src ip : 5.5.5.5
- dst ip : 1.1.1.1
R3가 R1에 도달하는 것은 중요하지 않고, R5가 R1에 도달 하길 원한다.
R5에서 5.5.5.5/32를 BGP에 포함시키고 R1에서 BGP 및 라우팅 테이블 확인.
R5
router bgp 3
network 5.5.5.5 mask 255.255.255.255
R1#sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 0.0.0.0 0 32768 i
*> 5.5.5.5/32 192.1.12.2 0 2 3 i
R1#sh ip route
B 5.5.5.5 [20/0] via 192.1.12.2, 00:43:21
ping 확인
R5#ping 1.1.1.1 sou 5.5.5.5
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/3/7 ms
R4#ping 1.1.1.1
.....
Success rate is 0 percent (0/5)
R3#ping 1.1.1.1
.....
Success rate is 0 percent (0/5)
R1#ping 5.5.5.5 sou 1.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/3/4 ms
라우팅 테이블 확인
R1#sh ip route
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Loopback0
L 1.1.1.1/32 is directly connected, Loopback0
5.0.0.0/32 is subnetted, 1 subnets
B 5.5.5.5 [20/0] via 192.1.12.2, 00:43:21
192.1.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.1.12.0/24 is directly connected, GigabitEthernet0/0
L 192.1.12.1/32 is directly connected, GigabitEthernet0/0
R2#sh ip route
1.0.0.0/24 is subnetted, 1 subnets
B 1.1.1.0 [20/0] via 192.1.12.1, 06:47:59
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.1.23.3, 05:36:30, GigabitEthernet0/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/3] via 192.1.23.3, 05:29:04, GigabitEthernet0/1
5.0.0.0/32 is subnetted, 1 subnets
B 5.5.5.5 [200/0] via 4.4.4.4, 00:43:22
192.1.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.1.12.0/24 is directly connected, GigabitEthernet0/0
L 192.1.12.2/32 is directly connected, GigabitEthernet0/0
192.1.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.1.23.0/24 is directly connected, GigabitEthernet0/1
L 192.1.23.2/32 is directly connected, GigabitEthernet0/1
O 192.1.34.0/24 [110/2] via 192.1.23.3, 06:47:46, GigabitEthernet0/1
R3#sh ip route
1.0.0.0/24 is subnetted, 1 subnets
B 1.1.1.0 [200/0] via 2.2.2.2, 05:09:17
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/2] via 192.1.23.2, 06:47:43, GigabitEthernet0/1
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/2] via 192.1.34.4, 05:29:08, GigabitEthernet0/2
5.0.0.0/32 is subnetted, 1 subnets
B 5.5.5.5 [200/0] via 4.4.4.4, 00:43:21
192.1.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.1.23.0/24 is directly connected, GigabitEthernet0/1
L 192.1.23.3/32 is directly connected, GigabitEthernet0/1
192.1.34.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.1.34.0/24 is directly connected, GigabitEthernet0/2
L 192.1.34.3/32 is directly connected, GigabitEthernet0/2
R4#sh ip route
1.0.0.0/24 is subnetted, 1 subnets
B 1.1.1.0 [200/0] via 2.2.2.2, 05:28:49
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/3] via 192.1.34.3, 05:29:09, GigabitEthernet0/2
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.1.34.3, 05:29:09, GigabitEthernet0/2
4.0.0.0/32 is subnetted, 1 subnets
C 4.4.4.4 is directly connected, Loopback0
5.0.0.0/32 is subnetted, 1 subnets
B 5.5.5.5 [20/0] via 192.1.45.5, 00:43:21
O 192.1.23.0/24 [110/2] via 192.1.34.3, 05:29:09, GigabitEthernet0/2
192.1.34.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.1.34.0/24 is directly connected, GigabitEthernet0/2
L 192.1.34.4/32 is directly connected, GigabitEthernet0/2
192.1.45.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.1.45.0/24 is directly connected, GigabitEthernet0/0
L 192.1.45.4/32 is directly connected, GigabitEthernet0/0
R5#sh ip route
1.0.0.0/24 is subnetted, 1 subnets
B 1.1.1.0 [20/0] via 192.1.45.4, 05:29:00
5.0.0.0/32 is subnetted, 1 subnets
C 5.5.5.5 is directly connected, Loopback0
192.1.45.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.1.45.0/24 is directly connected, GigabitEthernet0/0
L 192.1.45.5/32 is directly connected, GigabitEthernet0/0
'네트워크 > BGP' 카테고리의 다른 글
[BGP] 동기화(Synchronization) (0) | 2025.05.01 |
---|---|
[BGP] 속성7 - Prefer eBGP over iBGP (1) | 2025.04.30 |
[BGP] 속성6 - MED(metric) (0) | 2025.04.29 |
[BGP] 속성5 - Origin Code (0) | 2025.04.29 |
[BGP] 속성4 - AS Path (0) | 2025.04.28 |