Sows exhibit metabolic syndrome and significant changes in intestinal microbiota during late gestation and lactation, affecting sow performance and piglet health. Dietary fiber (DF) is widely applied to improve sow performance by modulating gut microbiota and their by-products. Here, 60 sows were randomly allocated to groups, including CON (8% wheat bran), FBF-1 (1% fermented bamboo fiber), FBF-2 (2.5% fermented bamboo fiber), and FBF-3 (4% fermented bamboo fiber) from day 80 of gestation (G80d) to the end of lactation (L21d). Compared with CON, the FBF-3 diet decreased lactation backfat loss, increased average daily feed intake (ADFI) during lactation, and the weight gain of piglets, while supplementation of FBF increased fecal water content and reduced the rate of constipation in sows. Further, the yield and quality of milk of sows in FBF groups were improved. The FBF-3 diet significantly reduced markers of intestinal permeability (diamine oxidase and endotoxin) and systemic inflammation (interleukin-6 [IL-6] and tumor necrosis factor alpha) in sow serum during lactation, while it increased the anti-inflammatory marker (IL-10). Similarly, the piglets in the FBF-2 and FBF-3 groups had lower levels of IL-6 and higher levels of IgG, IgM, and insulin-like growth factor in serum. In addition, sows fed the 4% FBF diet had higher levels of acetate, propionate, butyrate, and total short-chain fatty acids (SCFAs) in feces than CON, and total SCFAs were promoted in piglets from the FBF-3 group. Spearman correlation analysis showed that immunity, inflammation, and intestinal microbiota are closely related to sow performance, which can affect piglet growth. The potential mechanism could be that FBF promoted the enrichment of beneficial genera such as Lachnospira, Lachnospiracea_XPB1014_Group, and Roseburia and the production of SCFAs in the sow's intestine, and reduced the relative abundance of harmful bacteria such as Fusobacterium, Sutterellaceae, and Sutterella. Meanwhile, the intake of FBF by sows affected the gut microbial composition of their offspring piglets, significantly increasing the relative abundance of beneficial bacteria Alistipes and Lachnoclostridium and decreasing the relative abundance of pathogenic bacteria Trueperella among colonic microorganisms. IMPORTANCE Dietary fiber is widely applied in the nutrition of sows due to its potential value in improving performance and intestinal health. Fermented bamboo fiber, rich in dietary fiber, has not been fully evaluated to be used in sow diets. Sows mobilize body reserves during gestation and lactation due to nutrients being prioritized for lactation purposes while feeding piglets, which generally leads to metabolism and immunity undergoing drastic changes. The main manifestations are increased inflammation and intestinal permeability and disturbed intestinal flora, which ultimately reduces the ADFI and milk quality, thus affecting the growth of piglets. The study described here is the first attempt to provide FBF for sows in late gestation and lactation can reverse this process. The 4% FBF was initially explored to have the most significantly beneficial effect. It provides a potentially effective method for dietary modification to control the gut microbiota and its metabolites to improve sow and piglet health. Moreover, the sow-piglet model offers a reference for investigating the impact of dietary fiber on the intestinal health of human mothers and infants.