Obejectives: This study explored the immunomodulatory effects of a prebiotic formula consisting of 2′-fucosyllactose (2′-FL), galacto-oligosaccharides (GOSs), and fructo-oligosaccharides (FOSs) (hereinafter referred to as 2FGF) in cyclophosphamide (CTX)-induced immunosuppressed BALB/c mice and its underlying mechanisms. Methods: Sixty healthy female BALB/c mice were randomly divided into the following groups: normal control (NC) group; CTX treatment (CTX) group; 2FGF low-dose (2FGF-L) group; 2FGF medium-dose (2FGF-M) group; and 2FGF high-dose (2FGF-H) group. An immunosuppressed model was established in the 2FGF-H group by intraperitoneal injection of 80 mg/kg CTX. After 30 days of 2FGF intervention, peripheral blood, spleen tissue, thymus tissue, and intestinal tissue from the mice were collected and analyzed. The changes in weight and food intake of the mice were recorded weekly. Hematoxylin-eosin (HE) staining was used to observe the histological change of the spleen tissue. Enzyme-linked immunosorbent assay (ELISA) was employed to detect cytokine levels in peripheral blood. Flow cytometry was used to analyze T lymphocyte subgroup ratio of splenic lymphocytes. Western blot analysis was conducted on intestinal tissues to assess the expression of proteins involved in the tight junction, toll-like receptor 4 (TLR4), mitogen-activated protein kinase (MAPK), and nuclear factor kappa-light-chain-enhancer of activated B cell (NF-κB) signaling pathways. Additionally, molecular techniques were used to analyze the intestinal microbiota. Results: The results showed that 2FGF restored CTX-induced splenic injury, increased the number of splenic T lymphocytes, and elevated serum cytokines such as interleukin-4 (IL-4) and IL-10. In the intestine, 2FGF upregulated the expression of intestinal epithelial tight junction proteins such as Claudin-1 and zonula occludens 1 (ZO-1), thereby enhancing intestinal barrier function and activating the MAPK and NF-κB pathways via TLR4. Furthermore, 2FGF elevated the α-diversity (Shannon and Simpson indices) of the gut microbiota in CTX-induced immunosuppressed mice, enriching bacteria species positively correlated with anti-inflammatory cytokines (e.g., IL-4) such as g_Streptomyces and g_Bacillus and negatively correlated with pro-inflammatory cytokines (e.g., IL-1β) such as g_Saccharomyces. The results suggest that 2FGF may enhance immunity via the gut–immune axis. Conclusions: The 2FGF prebiotic formula showed an immunomodulatory effect in CTX-induced immunosuppressed mice, and the mechanism of which might involve optimizing the gut flora, enhancing intestinal homeostasis, strengthening the intestinal barrier, and promoting the expression of immune factors by regulating the TLR-4/MAPK/NF-κB pathway.