We investigate a 6D Dirac fermion on a rectangle. It is found that the 4D spectrum is governed by N = 2 supersymmetric quantum mechanics. Then we demonstrate that the supersymmetry is very useful for classifying all the allowed boundary conditions and to expand the 6D Dirac field in Kaluza-Klein modes. A striking feature of the model is that even though the 6D Dirac fermion has non-vanishing bulk mass, the 4D mass spectrum can contain degenerate massless chiral fermions, which may provide a hint to solve the problem of the generation of quarks and leptons. It is pointed out that zero-energy solutions are not affected by the presence of the boundaries, while the boundary conditions work well for determining the positive-energy solutions. We also provide a brief discussion on possible boundary conditions in the general case, especially those on polygons. © The Author(s) 2017.