  High ionisation lines in the soft X-ray band are generally associated to
either interstellar hot gas along the line of sight or to photoionised gas
intrinsic to the source. In the low-mass X-ray binary 4U 1820-30, the nature of
these lines is not well understood. We characterised the ionised gas present
along the line of sight towards the source producing the X-ray absorption lines
of Mg XI, Ne IX, Fe XVII, O VII, and O VIII. We analysed all the observations
available for this source in the XMM-Newton and Chandra archives, taken with
the RGS, HETG, and LETG spectrometers. The high-resolution grating spectra have
been accurately examined through a standard X-ray analysis based on the
$C$-statistic and through the Bayesian parameter inference. We tested two
physical models which describe a plasma in either collisional ionisation or
photoionisation equilibrium. We adopted the Bayesian model comparison to
statistically compare the different combinations of the models used for the
analysis.} We found that the lines are consistent with hot gas in the
interstellar medium rather than being associated with the intrinsic gas of the
X-ray binary. Our best-fit model reveals the presence of a collisionally
ionised plasma with a temperature of $T=(1.98\pm0.05)\times10^6 $ K. The
photoionisation model fails to fit the Fe XVII line (which is detected with a
significance of $6.5\sigma$) due to the low column density predicted by the
model. Moreover, the low inclination of the binary system is likely the reason
for the non-detection of ionised gas intrinsic to the source.}
