2. (15 points) Find all positive integers $n(n \geqslant 2)$ such that:

For any real numbers $x_{1}, x_{2}, \cdots, x_{n}$, when $\sum_{i=1}^{n} x_{i}=0$, it always holds that $\sum_{i=1}^{n} x_{i} x_{i+1} \leqslant 0$ (where $x_{n+1}=x_{1}$ ).
2. When $n=2$, from $x_{1}+x_{2}=0$, we get
$$
x_{1} x_{2}+x_{2} x_{1}=-2 x_{1}^{2} \leqslant 0 \text {. }
$$

Thus, the proposition holds for $n=2$.
When $n=3$, from $x_{1}+x_{2}+x_{3}=0$, we get
$$
\begin{array}{l}
x_{1} x_{2}+x_{2} x_{3}+x_{3} x_{1} \\
=\frac{\left(x_{1}+x_{2}+x_{3}\right)^{2}-\left(x_{1}^{2}+x_{2}^{2}+x_{3}^{2}\right)}{2} \\
=\frac{-\left(x_{1}^{2}+x_{2}^{2}+x_{3}^{2}\right)}{2} \leqslant 0 .
\end{array}
$$

Thus, the proposition holds for $n=3$.
When $n=4$, from $x_{1}+x_{2}+x_{3}+x_{4}=0$, we get
$$
\begin{array}{l}
x_{1} x_{2}+x_{2} x_{3}+x_{3} x_{4}+x_{4} x_{1} \\
=\left(x_{1}+x_{3}\right)\left(x_{2}+x_{4}\right)=-\left(x_{2}+x_{4}\right)^{2} \leqslant 0 .
\end{array}
$$

Thus, the proposition holds for $n=4$.
When $n \geqslant 5$, let $x_{1}=x_{2}=1, x_{4}=-2, x_{3}=x_{5}=\cdots$
$$
=x_{n}=0 \text {, then } \sum_{i=1}^{n} x_{i}=0 \text {. }
$$

But $\sum_{i=1}^{n} x_{i} x_{i+1}=1>0$, so the proposition does not hold for $n \geqslant 5$. In summary, the natural numbers $n$ for which the proposition holds are $2,3,4$.