Yes,
mountain ranges do separate Portugal and Spain. The main mountain range that separates them is the
Meseta Central, which is a large plateau in the center of Spain. The
Cantabrian Mountains also form a part of the border in the north, and the
Sierra Morena in the south.
However, it's important to note that these are not continuous, impenetrable walls. There are valleys and passes that allow for travel between the two countries.