Human milk oligosaccharides (HMO) affect gut microbiota during neonatal development, particularly with respect to the immune system. Bovine milk-based infant formulas have low oligosaccharide contents. Thus, efforts to fortify infant formulas with HMO are being undertaken. Two major HMO, 2'-fucosyllactose (2'-FL) and 6'-sialyllactose (6'-SL), exert anti-inflammatory effects; however, the associations between anti-inflammatory effects induced by 2'-FL and 6'-SL cotreatment and gut microbiota composition and metabolite modulation remain unclear. Therefore, in this study, we evaluated the effects of a mixture of these HMO. To determine the optimal HMO ratio for anti-inflammatory effects and elucidate its mode of action, LPS-induced inflammatory HT-29 epithelial cells and intestinal-inflamed suckling mice were treated with various mixtures of 2'-FL and 6'-SL. A 2'-FL:6'-SL ratio of 5:1 was identified as the most effective pretreatment HMO mixture in vitro; thus, this ratio was selected and used for low-, middle-, and high-dose treatments for subsequent in vivo studies. In vivo, high-dose HMO treatment restored LPS-induced inflammation symptoms, such as BW loss, colon length reduction, histological structural damage, and intestinal gene expression related to inflammatory responses. High-dose HMO was the only treatment that modulated the major phyla Bacteroidetes and Firmicutes and the genera Ihubacter, Mageeibacillus, and Saccharofermentans. These changes in microbial composition were correlated with intestinal inflammation-related gene expression and short-chain fatty acid production. To our knowledge, our study is the first to report the effects of Ihubacter, Mageeibacillus, and Saccharofermentans on short-chain fatty acid levels, which can subsequently affect inflammatory cytokine and tight junction protein levels. Conclusively, the HMO mixture exerted anti-inflammatory effects through changes in microbiota and metabolite production. These findings suggest that supplementation of infant formula with HMO may benefit formula-fed infants by forming unique microbiota contributing to neonatal development.