(4) باب جَوَازِ صَلاَةِ النَّافِلَةِ عَلَى الدَّابَّةِ فِي السَّفَرِ حَيْثُ تَوَجَّهَتْ
Ibn 'Umar reported that the Apostle (ﷺ) used to pray on (the back of) his camel in whatever direction it took him.
Reference: Sahih Muslim 700 b
In-book reference: Book 6, Hadith 42
USC-MSA web (English) reference(deprecated numbering scheme): Book 4, Hadith 1498