2. Given two points $A(1,2)$ and $B(3,1)$, the distances from these points to line $l$ are $\sqrt{2}$ and $\sqrt{5}-\sqrt{2}$, respectively. The number of lines $l$ that satisfy the condition is ( ).
(A) 1
(B) 2
(C) 3
(D) 4
2.C.

Given $|A B|=\sqrt{5}$, construct two circles with $A$ and $B$ as centers and $\sqrt{2}$ and $\sqrt{5}-\sqrt{2}$ as radii, respectively. Then the two circles are externally tangent, and there are three common tangents.