  In this paper, we study the connectedness of the commuting graph of a general
Lie algebra and provide a process to determine whether the commuting graph is
connected or not, as well as to compute an upper bound for its diameter. In
addition, we will examine the connectedness and diameter of the commuting
graphs of some remarkable classes of Lie algebras, including: (1) a class of
Lie algebras with one- or two-dimensional derived algebras; and (2) a class of
solvable Lie algebras over the real field of dimension up to $4$.
