During the Russian Civil War, Oleynikov returned to his home village in February 1918 and joined the partisan cavalry detachment of Boris Dumenko (later commanded by G.G. Kolpakov). With the detachment, he fought in battles against the Volunteer Army and White Cossacks. After the retreat to Tsaritsyn, the detachment was reorganized in May 1918 on its incorporation into the Red Army and Oleynikov became a Red Army man in the 3rd Don-Stavropol Regiment. With the regiment, he fought in battles against the forces of Pyotr Krasnov south of Martynovsky, Velikoknyazheskoy, Rostov-on-Don, Belaya Glina, and Yegorlykskaya. Oleynikov was concussed during the retreat from the Don Host Oblast in July 1919. In November the regiment was reorganized as the 21st Cavalry Regiment of the 4th Cavalry Division of the 1st Cavalry Army and fought in the Kharkov, Donbass, and Rostov–Novocherkassk operations, and the Battle of Yegorlykskaya. In April 1920 Oleynikov was sent to the commanders’ school of the 1st Cavalry Army, reorganized as the 5th Yelisavetgrad Cavalry Commanders School. As a cadet of the school he fought in battles against the Army of Wrangel, the suppression of the landing of Colonel Nazarov and the elimination of the Revolutionary Insurrectionary Army of Ukraine in Yekaterinoslav Governorate.