The osmotic pressure in an electric double layer is studied by means o
f Monte Carlo simulations. The net osmotic pressure is calculated as t
he difference between the internal and external pressures calculated a
t the same chemical potential. This can be obtained with sufficient ac
curacy using the Widom insertion particle technique in the canonical e
nsemble. The same technique can also be applied in the calculation of
different pressure contributions. We find that the net osmotic pressur
e is always repulsive in a system with monovalent co- and counterions,
which is in agreement with the Poisson-Boltzmann equation as well as
with previous simulation studies. In asymmetric salts, when the coion
is multivalent we find that the external pressure exceeds the internal
pressure resulting in a net attractive interaction. This attraction a
ppears at high particle density or volume fraction in the double layer
, for example, at short separations, high salt concentration, and/or h
igh surface charge density. The origin of the attraction seems mainly
to be the hard-core interactions, which the ions experience in a dense
double layer, which is manifested in a high chemical potential. The c
orresponding bulk solution at this chemical potential has a very high
salt concentration and hence also a high osmotic pressure.