Hi Ler Sak,
BGP doesn’t differentiate between confed-internal or confed-external. When the two paths are the same, it’s up to the router ID to decide which one will be selected.
Here’s an example from the topology I used in this lesson:
R4#show ip bgp 55.55.55.55/32
BGP routing table entry for 55.55.55.55/32, version 5
Paths: (2 available, best #1, table default)
Flag: 0x800
Not advertised to any peer
Refresh Epoch 1
(35)
5.5.5.5 (metric 2) from 2.2.2.2 (2.2.2.2)
Origin IGP, metric 0, localpref 100, valid, confed-internal, best
rx pathid: 0, tx pathid: 0x0
Refresh Epoch 1
(35)
5.5.5.5 (metric 2) from 5.5.5.5 (55.55.55.55)
Origin IGP, metric 0, localpref 100, valid, confed-external
rx pathid: 0, tx pathid: 0
Above you can see the path from 2.2.2.2 has been selected. Let’s change the router ID on R2:
R2(config)#router bgp 24
R2(config-router)#bgp router-id 222.222.222.222
Now it prefers R5:
R4#show ip bgp 55.55.55.55/32
BGP routing table entry for 55.55.55.55/32, version 13
Paths: (2 available, best #2, table default)
Flag: 0x800
Advertised to update-groups: (Pending Update Generation)
2 4
Refresh Epoch 1
(35)
5.5.5.5 (metric 2) from 2.2.2.2 (222.222.222.222)
Origin IGP, metric 0, localpref 100, valid, confed-internal
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
(35)
5.5.5.5 (metric 2) from 5.5.5.5 (55.55.55.55)
Origin IGP, metric 0, localpref 100, valid, confed-external, best
rx pathid: 0, tx pathid: 0x0
Hope this helps!
Rene