Topological semimetals, extending the topological classification from insulators to metals, have greatly enriched our understanding of topological states in condensed matter. This is particularly true for topological nodal-line semimetals (TNLSs). In the present paper, we identify layered materials as promising candidates for hosting TNLSs. Based on first-principles calculations and effective model analysis, we propose that layered ferromagnetic rare-earth-metal monohalides LnX (Ln=La, Gd; X=Cl, Br) exhibit long pursued topological phases. Specifically, single-layer LaX and singlelayer GdX are ideal two-dimensional (2D) Weyl semimetals and large-gap 2D quantum anomalous Hall insulators (QAHIs), with band gaps up to 61 meV, respectively. In addition, 3D LaX and 3D GdX are TNLSs with a pair of mirror-symmetry protected nodal lines and 3D QAHIs, respectively. The nodal lines in 3D LaX extending through the whole Brillouin zone (BZ) are fairly robust against strong spin-orbit coupling (SOC) and located close to the Fermi level, providing a novel platform toward exploring the exotic properties in nodal-line fermions as well as related device designs. arXiv:1803.08486v2 [cond-mat.mtrl-sci]