This paper considers a game-theoretic model of external control influence on opinion dynamics and reached consensus in a social network. The network participants are linked through an arbitrary communication graph. The goal of control is to keep the opinions of all network participants in the neighborhood of a given value. If there are several players, these target values may differ. The dynamic game under consideration belongs to the class of linear-quadratic games in discrete time. Optimal control and equilibrium are calculated using the Bellman equation. In the symmetric case, the solution is constructed analytically. Some numerical simulations illustrate the influence of the communication structure of a social network on the opinion dynamics and reached consensus.