This paper proposes a unified approach to analyze and synthesize consensus control laws for general linear leaderless multi-agent systems (MASs) subjected to input or state constraints. First, the problem of consensus under input constraint is investigated where the MAS is reformulated as a network of Lur'e systems. As a result, a sufficient condition for consensus and the design of consensus controller gain are derived from solutions of a distributed LMI convex problem. Next, the problem of consensus with state constraint is transformed into an equivalent problem of consensus under input constraint. Therefore, a similar method to the previous problem can be employed for this scenario, however an additional LMI constraint should be satisfied. Finally, a numerical example is introduced to illustrate the proposed theoretical approach.