The objective of the invariant ellipsoid method is to minimize the smallest invariant and attractive set of a linear control system operating under the influence of bounded external disturbances. In this paper, this method is extended into the leader-following consensus problem. Initially, a linear control protocol is designed for the Multi-agent System without disturbances. Subsequently, in the presence of bounded disturbances, by employing a similar linear control protocol, a necessary and sufficient condition is introduced to derive the optimal control parameters for the MAS such that the state of followers converge and remain in an minimal invariant ellipsoid around the state of the leader.