Malnutrition is the cause of major public health concerns worldwide. On the one hand, obesity and associated pathologies (also known as the metabolic syndrome) affect more than 10% of the world population. Such pathologies might arise from an elevated inflammatory tone. We have discovered that the inflammatory properties of high-fat diets were linked to the translocation of lipopolysaccharide (LPS). We proposed a mechanism associating the gut microbiota with the onset of insulin resistance and low-grade inflammation, a phenomenon that we called "metabolic endotoxemia." We and others have shown that bacteria as well as host-derived immune-related elements control microbial communities and eventually contribute to the phenotype observed during diet-induced obesity, diabetes, and metabolic inflammation. On the other hand, undernutrition is one of the leading causes of death in children. A diet poor in energy and/or nutrients causes incomplete development of the gut microbiota and may profoundly affect energy absorption, initiating stunted growth, edema, and diarrhea. In this review, we discuss how changes in microbiota composition are associated with obesity and undernutrition. We also highlight that opposite consequences exist in terms of energy absorption from the diet (obesity versus undernutrition), but interestingly the two situations share similar defects in term of diversity, functionality, and inflammatory potential.