An Ionic bond has a difference of more than 1.5 in electronegativity.
Metals like sodium have a very low electronegativity. (0.9)
Nonmetals like Chlorine have a very high electronegativity (3.0)
To achieve the great difference of electronegativity it is necessary to have a low electronegativity element combined with a high electronegativity element.
The only combination that results in the great difference in electronegativity is a metal with a non metal.