2. If for any real number $a$, the equation about $x$
$$
x^{2}-2 a x-a+2 b=0
$$

has real roots, then the range of the real number $b$ is $\qquad$
2. $b \leqslant -\frac{1}{8}$.

According to the problem, we have
$$
\Delta=4 a^{2}-4(-a+2 b)=4 a^{2}+4 a-8 b \geqslant 0
$$

for all real numbers $a$, which means
$$
8 b \leqslant 4 a^{2}+4 a=(2 a+1)^{2}-1
$$

for all real numbers $a$.
Clearly, when $a=-\frac{1}{2}$, $(2 a+1)^{2}-1$ reaches its minimum value -1.
Thus, $8 b \leqslant -1 \Rightarrow b \leqslant -\frac{1}{8}$.