The extracellular secreted mucus and the cell surface glycocalyx prevent infection by the vast numbers of microorganisms that live in the healthy gut. Mucin glycoproteins are the major component of these barriers. In this Review, we describe the components of the secreted and cell surface mucosal barriers and the evidence that they form an effective barricade against potential pathogens. However, successful enteric pathogens have evolved strategies to circumvent these barriers. We discuss the interactions between enteric pathogens and mucins, and the mechanisms that these pathogens use to disrupt and avoid mucosal barriers. In addition, we describe dynamic alterations in the mucin barrier that are driven by host innate and adaptive immune responses to infection.