Hi Rob,
As you see in my previous post for "Default", the second step would choose Path 2 over Path 3 though Path-3's MED value was lower.
However in your case, we have 2 AS in AS_PATH, then the left most would be considered for MED comparison.
path1: via EBGP; AS Path of 65000,20000; MED of 200
path2: via EBGP; AS Path of 65000,10000; MED of 100.
Path 2 would choosen because of lowest MED value.
I wouldn't call it as peer AS number, as the local administrator can always overrule this. Just like as below:
Prefix : 200/24
path1: via eBGP; Nbr: 172.168.1.2; Peer AS : 500; MED 10
path1: via eBGP; Nbr: 3.3.3.3; Peer AS : 200; MED 0
With above data, we can say MED wouldn't be compared, but look at below:
show bgp neighbor | match Peer:
Peer: 3.3.3.3+58155 AS 200 Local: 1.1.1.1+179 AS 100
NLRI for restart configured on peer: inet-unicast
NLRI advertised by peer: inet-unicast
Peer: 172.168.1.2+63071 AS 500 Local: 172.168.1.1+179 AS 100
NLRI for restart configured on peer: inet-unicast
NLRI advertised by peer: inet-unicast
inet.0: 50 destinations, 51 routes (49 active, 0 holddown, 1 hidden)
200.0.0.0/24 (2 entries, 1 announced)
*BGP Preference: 170/-101
Next hop type: Indirect
Address: 0x944d8b4
Next-hop reference count: 3
Source: 3.3.3.3
Next hop type: Router, Next hop index: 605
Next hop: 10.0.1.2 via ge-2/1/6.0, selected
Session Id: 0x252
Protocol next hop: 3.3.3.3
Indirect next hop: 9504000 2097150 INH Session ID: 0x255
State: <Active Ext>
Local AS: 100 Peer AS: 200
Age: 2:10 Metric2: 0
Validation State: unverified
Task: BGP_200.3.3.3.3+58155
Announcement bits (3): 0-KRT 2-BGP_RT_Background 5-Resolve tree 1
AS path: 4000 200 I
Accepted
Localpref: 100
Router ID: 3.3.3.3
BGP Preference: 170/-101
Next hop type: Router, Next hop index: 606
Address: 0x944c8f8
Next-hop reference count: 1
Source: 172.168.1.2
Next hop: 172.168.1.2 via ge-3/0/0.0, selected
Session Id: 0x253
State: <NotBest Ext>
Inactive reason: Not Best in its group - Route Metric or MED comparison
Local AS: 100 Peer AS: 500
Age: 2:21 Metric: 10
Validation State: unverified
Task: BGP_500.172.168.1.2+63071
AS path: 4000 500 I
Accepted
Localpref: 100
Router ID: 10.255.178.58
Regards
Surya