MED(metric)
- MED는 인접 라우터에게 자신의 AS에 어떻게 들어와야 하는지 인입 경로를 광고할 때 사용.
- MED 값이 가장 낮은 경로를 선호한다.
- IGP 메트릭 값이 MED 값으로 사용된다.
- R1, R2에서 BGP에 3.3.3.0/24 네트워크를 중복 포함.
- R1, R2는 인접 AS에서 eBGP 네이버로부터 MED 값이 각각 다른 BGP 라우팅 정보를 수신하고, iBGP 네이버인 R1, R2 서로 간에 3.3.3.3/32에 대해 알린다.
R1#sh ip bgp 3.3.3.0
BGP routing table entry for 3.3.3.0/24, version 10
Paths: (1 available, best #1, table default)
Advertised to update-groups:
5
Refresh Epoch 1
34
1.1.13.3 from 1.1.13.3 (3.3.3.3)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
R2#sh ip bgp 3.3.3.0
BGP routing table entry for 3.3.3.0/24, version 10
Paths: (2 available, best #1, table default)
Advertised to update-groups:
2
Refresh Epoch 1
34
1.1.1.1 (metric 2) from 1.1.1.1 (1.1.1.1)
Origin IGP, metric 0, localpref 100, valid, internal, best
rx pathid: 0, tx pathid: 0x0
Refresh Epoch 1
34
1.1.24.4 from 1.1.24.4 (4.4.4.4)
Origin IGP, metric 2, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
R2 확장 ping (dst 3.3.3.3 sou 2.2.2.2)
(1.1.12.2)
(1.1.13.1)
(3.3.3.3)
(1.1.13.3)
(1.1.12.1)
(2.2.2.2) <*>
(0.0.0.0)
(0.0.0.0)
(0.0.0.0)
End of list
- R2는 3.3.3.0에 대해 R4에게 받았을 때 MED 값은 '2'이고, R1에게 받은 MED 값은 '0'으로 R1에게 받은 MED 값이 낮기 때문에, 목적지 3.3.3.0에 대해 R1이 우선하고, R1 ━ R3간의 경로를 통해 AS 34로 전송된다.
설정
R1
router ospf 12
network 1.1.1.0 0.0.0.255 area 0
network 1.1.12.0 0.0.0.255 area 0
!
router bgp 12
network 1.1.1.1 mask 255.255.255.255
neighbor 1.1.13.3 remote-as 34
neighbor 2.2.2.2 remote-as 12
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 next-hop-self
R2
router ospf 12
network 1.1.12.0 0.0.0.255 area 0
network 2.2.2.0 0.0.0.255 area 0
!
router bgp 12
network 2.2.2.2 mask 255.255.255.255
neighbor 1.1.1.1 remote-as 12
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 next-hop-self
neighbor 1.1.24.4 remote-as 34
R3
interface Loopback0
ip address 3.3.3.3 255.255.255.0
ip ospf network point-to-point
!
router ospf 34
router-id 3.3.3.3
network 1.1.34.0 0.0.0.255 area 0
network 3.3.3.3 0.0.0.0 area 0
!
router bgp 34
bgp router-id 3.3.3.3
network 3.3.3.0 mask 255.255.255.0
neighbor 1.1.13.1 remote-as 12
neighbor 4.4.4.4 remote-as 34
neighbor 4.4.4.4 update-source Loopback0
neighbor 4.4.4.4 next-hop-self
R4
router ospf 34
router-id 4.4.4.4
network 1.1.34.0 0.0.0.255 area 0
network 4.4.4.4 0.0.0.0 area 0
!
router bgp 34
bgp router-id 4.4.4.4
network 3.3.3.0 mask 255.255.255.0
neighbor 1.1.24.2 remote-as 12
neighbor 3.3.3.3 remote-as 34
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
'네트워크 > BGP' 카테고리의 다른 글
[BGP] 동기화(Synchronization) (0) | 2025.05.01 |
---|---|
[BGP] 속성7 - Prefer eBGP over iBGP (1) | 2025.04.30 |
[BGP] 속성5 - Origin Code (0) | 2025.04.29 |
[BGP] 속성4 - AS Path (0) | 2025.04.28 |
[BGP] 속성3 - Originate (0) | 2025.04.22 |