thanks for your comment.
On the Cisco, I understand why 18.18.18.0/24 is not in the routing table, as the next hop is unaccessible.
R4#show ip bgp 18.18.18.0
BGP routing table entry for 18.18.18.0/24, version 33
Paths: (1 available, no best path)
Not advertised to any peer
Refresh Epoch 1
64870, (received & used)
10.20.1.6 (inaccessible) from 5.5.5.5 (5.5.5.5)
Origin IGP, localpref 100, valid, internal
rx pathid: 0, tx pathid: 0
What I do not understand is why Juniper updates the next hop. In my understanding, these two prefixes should not be in the routing table. right ?
root@vMX-5# run show route receive-protocol bgp 4.4.4.4
inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 22.22.22.0/24 10.10.1.2 0 100 64870 I
* 111.111.111.0/24 10.10.1.2 0 100 64870 I
[edit]
root@vMX-5# run show route 22.22.22.0/24
inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
22.22.22.0/24 *[BGP/170] 06:51:48, MED 0, localpref 100, from 4.4.4.4
AS path: 64870 I, validation-state: unverified
> to 10.10.10.4 via ge-0/0/2.0
Note: R4 and vMX5 peers via iBGP.
The following is configuration
R4
router bgp 64850
bgp log-neighbor-changes
no bgp default ipv4-unicast
neighbor 5.5.5.5 remote-as 64850
neighbor 5.5.5.5 update-source Loopback0
neighbor 10.10.1.2 remote-as 64870
neighbor 10.10.2.3 remote-as 64870
!
address-family ipv4
neighbor 5.5.5.5 activate
neighbor 5.5.5.5 soft-reconfiguration inbound
neighbor 10.10.1.2 activate
neighbor 10.10.1.2 as-override
neighbor 10.10.2.3 activate
neighbor 10.10.2.3 as-override
exit-address-family
vMX5
set protocols bgp group TovMX6 type external
set protocols bgp group TovMX6 peer-as 64870
set protocols bgp group TovMX6 neighbor 10.20.1.6 as-override
set protocols bgp group TovMX7 type external
set protocols bgp group TovMX7 local-address 192.168.4.5
set protocols bgp group TovMX7 peer-as 64870
set protocols bgp group TovMX7 neighbor 192.168.4.7
set protocols bgp group ToCisco4 type internal
set protocols bgp group ToCisco4 local-address 5.5.5.5
set protocols bgp group ToCisco4 peer-as 64850
set protocols bgp group ToCisco4 neighbor 4.4.4.4