Sometimes gatehouses defended a town by being built across a bridge , a river or a moat , as in Monmouth .
Sometimes gatehouses formed part of town fortifications , perhaps defending the passage of a bridge across a river or a moat , as Monnow Bridge in Monmouth . York has four important gatehouses , known as `` Bars '' , in its city walls .