The configuration-interaction method is applied to the exchange interaction between nearest-neighbor V2+ ion pairs in KMgF3. A linear cation-anion-cation four-electron model is assumed, taking into account the ionic configuration as well as anion-cation and cation-cation charge-transfer excitations. Numerical estimates indicate that the charge-transfer excitation between the cations is more important than that from an anion to its neighboring cation. These two charge-transfer processes together with the ionic configuration contribute the majority of the exchange interaction. The overlap integral between two neighboring cation d orbitals is also taken into account, and its contributions to the exchange integral are examined and found to be significant.