Coast guards also enforce maritime law, maintain aids to navigation such as beacons and buoys, and provide other services for the benefit of mariners. Most coast guards are run on military lines and serve as an auxiliary to the national navy. During wartime coast guards are responsible for harbour defense, port security, naval counterintelligence and coastal patrols.