Prime Minister Mariano Rajoy's conservative government has said it will respond with "all necessary measures" to counter Catalan defiance, and is holding talks with opposition leaders in Madrid to forge a consensus over what to do.