If your territories don't form a continuous stretch of land or water, you need the permission of other countries along the way to legally cross their territory or airspace (with the exception of missiles) in order to get to your enemy. Doing so without permission may be interpreted as an act of war. Alternatively, you could sign a
right of passage agreement (opens in new window).