A new crystal potential has been developed for magnesium oxide. This is based on electron-gas calculations of the interaction energy for like and unlike pairs of ions, in the presence of a model crystal field. The calculated potentials are checked by calculating perfect lattice properties: cohesive energy, elastic constants, dielectric constants and some phonon frequencies; adjustments of potential parameters are made to ensure the best fit to these properties. Damping of the long-range dispersion energy is introduced during fitting of the potential and in the calculation of perfect lattice and defect properties.Similar methods have been used to develop a potential for lithium oxide. The calculated phonon dispersion in Li2O is in good agreement with experimental results from neutron scattering. The calculated defect energies are compared with experimental values from ionic conductivity and NMR measurements. Mg2+ substitutionals and Li+ vacancies exhibit a high degree of association, which is responsible for the curvature in the extrinsic region of the conductivity plot.