Peppermint oil does repel rats, as they do not like the smell of peppermint. You can use peppermint oil to keep rats away by placing it near areas where you think they may exploit, such as holes or openings. You can also try placing a few drops of peppermint oil on a cotton ball and place it near the machine.