Sayyiduna Ibn Abbas (may Allah be pleased with them both) said: I travelled with the Messenger of Allah (peace and blessings be upon him) in Ramadan. He (peace and blessings be upon him) fasted until he reached Usfan, then he called for a vessel and drank from it so that the people could see him. Then he broke his fast when he entered Makkah, and he conquered Makkah in Ramadan. Ibn Abbas (may Allah be pleased with them both) said: The Messenger of Allah (peace and blessings be upon him) both fasted and broke his fast while travelling; so whoever wishes may fast, and whoever wishes may not fast.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10899