كتاب صلاة المسافرين وقصرها
6  
The Book of Prayer - Travellers
(4)
Chapter: It is permissible to offer voluntary prayers atop one’s mount when travelling, no matter what direction it is facing
(4)
باب جَوَازِ صَلاَةِ النَّافِلَةِ عَلَى الدَّابَّةِ فِي السَّفَرِ حَيْثُ تَوَجَّهَتْ ‏‏
Sahih Muslim 700 f

Sa'id b. Yasar reported:

I was travelling along with Ibn 'Umar on the way to Mecca. Sa'id said: When I apprehended dawn, I dismounted (the ride) and observed Witr prayer and then again joined him. Ibn 'Umar said to me: Where were you? I said: I apprehended the appearance of dawn, so I dismounted and observed Witr prayer. Upon this 'Abdullah said: Is there not a model pattern for you in the Messenger of Allah (ﷺ)? I said: Yes, by Allah, and (then) he said: The Messenger of Allah (ﷺ) used to observe Witr prayer on the camel's back.
وَحَدَّثَنَا يَحْيَى بْنُ يَحْيَى، قَالَ قَرَأْتُ عَلَى مَالِكٍ عَنْ أَبِي بَكْرِ بْنِ عُمَرَ بْنِ عَبْدِ الرَّحْمَنِ بْنِ عَبْدِ اللَّهِ بْنِ عُمَرَ بْنِ الْخَطَّابِ، عَنْ سَعِيدِ بْنِ يَسَارٍ، أَنَّهُ قَالَ كُنْتُ أَسِيرُ مَعَ ابْنِ عُمَرَ بِطَرِيقِ مَكَّةَ - قَالَ سَعِيدٌ - فَلَمَّا خَشِيتُ الصُّبْحَ نَزَلْتُ فَأَوْتَرْتُ ثُمَّ أَدْرَكْتُهُ فَقَالَ لِي ابْنُ عُمَرَ أَيْنَ كُنْتَ فَقُلْتُ لَهُ خَشِيتُ الْفَجْرَ فَنَزَلْتُ فَأَوْتَرْتُ ‏.‏ فَقَالَ عَبْدُ اللَّهِ أَلَيْسَ لَكَ فِي رَسُولِ اللَّهِ صلى الله عليه وسلم أُسْوَةٌ فَقُلْتُ بَلَى وَاللَّهِ ‏.‏ قَالَ إِنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم كَانَ يُوتِرُ عَلَى الْبَعِيرِ ‏.‏
Reference : Sahih Muslim 700f
In-book reference : Book 6, Hadith 46
USC-MSA web (English) reference : Book 4, Hadith 1502
  (deprecated numbering scheme)