In summary, the results demonstrate that the protective mechanism of COS on the LPS-induced inflammatory response and oxidative stress depend on the TLR4/nuclear factor-κB (NF-κB) and Nrf2 signaling pathways, indicating that COS could serve as natural protective agents for alleviating BMECs in mastitis. The gene discussed is NFE2L2; the disease is mastitis.