Classical swine fever (CSF) caused by classical swine fever virus (CSFV) is one of the most detrimental diseases, and leads to significant economic losses in the swine industry. Despite efforts by many government authorities to stamp out the disease from national pig populations, the disease remains widespread. Here, antiviral small hairpin RNAs (shRNAs) were selected and then inserted at the porcine Rosa26 (pRosa26) locus via a CRISPR/Cas9-mediated knock-in strategy. Finally, anti-CSFV transgenic (TG) pigs were produced by somatic nuclear transfer (SCNT). Notably, in vitro and in vivo viral challenge assays further demonstrated that these TG pigs could effectively limit the replication of CSFV and reduce CSFV-associated clinical signs and mortality, and disease resistance could be stably transmitted to the F1-generation. Altogether, our work demonstrated that RNA interference (RNAi) technology combining CRISPR/Cas9 technology offered the possibility to produce TG animal with improved resistance to viral infection. The use of these TG pigs can reduce CSF-related economic losses and this antiviral strategy may be useful for future antiviral research.