This article addresses the problem of designing optimal strategies in consensus protocols for networks vulnerable to adversarial attacks. First, a set of necessary conditions for optimal control is given in the case of the dynamic (multi-stage) weight selection problem of consensus protocols. Under some mild conditions, it turns out that only one-stage is sufficient for reaching consensus, and the article derives a closed-form solution for the optimal control. Second, a (zero-sum) game theoretical model with a “convex-convex” quadratic objective function is considered for the problem of a network with an adversary corrupting the control signal with noise. Mixed-strategy saddle-point (MSSP) strategies are obtained for the players (the adversary and the network designer) in the resulting game. Further, a totally distributed gradient method that computes the optimal control is provided. Simulation results show that an adversary using an MSSP strategy can drive the system away from consensus, while an adversary using a uniform random strategy does not cause as much damage.