The Greek city-states did know each other. They fought with each other, and teamed up against a common enemy with each other. They challenged each other to competitions. People were free to visit or even move to a different city-state if they wished.