The magnitude of the Coulomb interaction F between two ions of charge q and Q a distance R apart is given by 
directed along the axis between the two ions, where a positive value represents a repulsive force and vice versa. 
Trapping techniques include variations on the Paul trap and Penning trap, where the former uses only electric fields while the latter also uses magnetic fields to confine the ions. Considering the simple case of two ions confined in a linear Paul trap, we have a radiofrequency oscillating field, which itself can confine a single ion in the (axial?) direction.