Puberty is a critical developmental period of life characterized by marked physiological changes, including changes in the immune system and gut microbiota development. Exposure to inflammation induced by immune stressors during puberty has been found to stimulate central inflammation and lead to immune disturbance at distant sites from the gut; however, its enduring effects on gut immunity are not well explored. Therefore, in this study, we used a pubertal lipopolysaccharides (LPS)-induced inflammation mouse model to mimic pubertal exposure to inflammation and dysbiosis. We hypothesized that pubertal LPS-induced inflammation may cause long-term dysfunction in gut immunity by enduring dysregulation of inflammatory signaling and epigenetic changes, while prebiotic/probiotic intake may mitigate the gut immune system deregulation later in life. To this end, four-week-old female Balb/c mice were fed prebiotics/probiotics and exposed to LPS in the pubertal window. To better decipher the acute and enduring immunoprotective effects of biotic intake, we addressed the effect of treatment on interleukin (IL)-17 signaling related-cytokines and pathways. In addition, the effect of treatment on gut microbiota and epigenetic alterations, including changes in microRNA (miRNA) expression and DNA methylation, were studied. Our results revealed a significant dysregulation in selected cytokines, proteins, and miRNAs involved in key signaling pathways related to IL-17 production and function, including IL-17A and F, IL-6, IL-1β, transforming growth factor-β (TGF-β), signal transducer and activator of transcription-3 (STAT3), p-STAT3, forkhead box O1 (FOXO1), and miR-145 in the small intestine of adult mice challenged with LPS during puberty. In contrast, dietary interventions mitigated the lasting adverse effects of LPS on gut immune function, partly through epigenetic mechanisms. A DNA methylation analysis demonstrated that enduring changes in gut immunity in adult mice might be linked to differentially methylated genes, including Lpb, Rorc, Runx1, Il17ra, Rac1, Ccl5, and Il10, involved in Th17 cell differentiation and IL-17 production and signaling. In addition, prebiotic administration prevented LPS-induced changes in the gut microbiota in pubertal mice. Together, these results indicate that following a healthy diet rich in prebiotics and probiotics is an optimal strategy for programming immune system function in the critical developmental windows of life and controlling inflammation later in life.