In this article we study the simplest one-dimensional transport equation u (t) +au (x) =f and study the implementation of the boundary condition using a penalty method combined with a P1 finite element discretization. We discuss the convergence of the method when both the penalty parameter I mu and the mesh size h go to zero, in sequence or simultaneously. Some numerical simulations are reported also showing the efficiency of the method. Numerical simulations are also made for the similar problem in space dimension 2.