Cinnamon and star anise essential oils are extracted from natural plants and provide a theoretical basis for the development and clinical application of compound essential oil pellets. However, cinnamon oil and star anise oil have the characteristics of a pungent taste, extreme volatility, poor palatability, and unstable physical and chemical properties, which limit their clinical use in veterinary medicine. In this study, the inhibitory effects of cinnamon oil and star anise oil on Escherichia coli and Salmonella were measured. Compound essential oil pellets were successfully prepared by centrifugal granulation technology. Subsequently, the in vitro dissolution of the pellets and their pharmacokinetics in pigs were investigated. The results showd that, cinnamon and star anise oils showed synergistic or additive inhibitiory effects on Escherichia coli and Salmonella. The oil pellets had enteric characteristics in vitro and high dissolution in vitro. The pharmacokinetic results showed that the pharmacokinetic parameters Cmax and AUC were directly correlated with the dosage and showed linear pharmacokinetic characteristics, which provided a theoretical basis for the development and clinical application of compound essential oil pellets.