The generation of acoustic waves by a line-focused laser pulse in an optically absorptive cylinder is studied experimentally and theoretically. Experiments are performed on a 5 mm diameter NG5 colored glass rod using Nd:yttrium aluminum garnet laser, which delivers 5 ns pulses. The numerical simulation is based on the semi-analytical model of a radially distributed thermoelastic source, which takes into account penetration of laser energy into the bulk of the sample. Good agreement between the experimental and calculated wave forms is observed. Comparison of these wave forms with an auxiliary simulation, which assumes the model of a dipole source located at the cylinder surface, reveals the effect of optical penetration on the shape of the wave form and also on the relative amplitude of bulk and surface waves.