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