Signal fires are the most basic solution.
Classically, beacons were fires lit at well-known locations on hills or high places, used either as lighthouses for navigation at sea, or for signalling over land that enemy troops were approaching, in order to alert defenses. As signals, beacons are an ancient form of optical telegraphy, and were part of a relay league.
Systems of this kind have existed for centuries over much of the world. The ancient Romans used beacons ...
In the 9th century, during the Arab–Byzantine wars, the Byzantine Empire used a beacon system to transmit messages from the border ... to the imperial palace in the Byzantine capital, Constantinople. ... Beacons were later used in Greece as well, while the surviving parts of the beacon system in Anatolia seem to have been reactivated in the 12th century by Emperor Manuel I Komnenos.
In Scandinavia many hill forts were part of beacon networks to warn against invading pillagers. In Finland these beacons were called vainovalkeat, "persecution fires", or vartiotulet, "guard fires", and were used to warn Finn settlements of imminent raids by the Vikings.
In Wales, the Brecon Beacons were named for beacons used to warn of approaching English raiders. In England, the most famous examples are the beacons used in Elizabethan England to warn of the approaching Spanish Armada. ... In the Scottish borders country, a system of beacon fires was at one time established to warn of incursions by the English. ... The Great Wall of China is also a beacon network.
In Spain, the border of Granada in the territory of the Crown of Castile had a complex beacon network to warn against Moorish raiders and military campaigns.
Wikipedia: Beacon: For defensive communications

Danby Beacon by Jim Champion (CC BY-SA 2.0)
Danby Beacon is at the summit of the aptly named Beacon Hill. The modern beacon sculpture stands on a Bronze Age burial mound, previously the site of a 1988 replica beacon and the original Armada-era beacon.