  A class of exactly solvable models describing carbon nanotubes in the
presence of an external inhomogeneous magnetic field is considered. The
framework of the continuum approximation is employed, where the motion of the
charge carriers is governed by the Dirac- Weyl equation. The explicit solution
of a particular example is provided. It is shown that these models possess
nontrivial integrals of motion that establish N = 2 nonlinear supersymmetry in
case of metallic and maximally semiconducting nanotubes. Remarkable stability
of energy levels with respect to small fluctuations of longitudinal momentum is
demonstrated
