Addressing tens of thousands of festival-goers, the Labour leader pointed out a slogan that read 'build bridges, not walls', saying 'there's a message' for the US president.
He was later seen posing for photographs with fans as he walked around Worthy Farm - and was even seen pouring a drink at the festival's Solstice bar.
During the short speech, Corbyn said: 'If you can see that far look on that wall that surround this wonderful festival there's a message on that wall for President Trump. You know what it says? Build bridges not walls.'
He then spoke about the recent general election campaign, saying what was 'inspiring was the number of young people who got involved for the very first time'.
The Islington North MP said: 'What was fascinating about the last seven weeks of election campaigning around Britain was that the commentariat got it wrong. The elites got it wrong.
'But what was even more inspiring was the number of young people who got involved for the very first time.
'Because they were fed up with being denigrated, fed up with being told they don’t matter, fed up with being told they never participate and utterly fed up with being told that their generation would pay more to get less in education and less in housing.'
Calling for peace around the world, he continued: 'When people across the world think the same, cooperate the same, maybe in different languages, different faiths, peace is possible and must be achieved.
'Let’s stop the denigration of refugees, people looking for a place of safety in a cruel and dangerous world. They are all human beings just like us here today.'
Corbyn also referred to the recent Grenfell Tower tragedy in his speech, saying: 'There’s a number of things, they’re very simple, very basic questions that we should ask ourselves.
'Is it right that so many people in our country have no home to live in and only a street to sleep on? Is it right that so many people are frightened of where they live at the moment having seen the horrors of what happened at Grenfell Tower?
'Is it right that so many people live in such poverty in a society surrounded by such riches? No it obviously is not.'
It comes as a host of stars, including Liam Gallagher, paid tribute to the victims of the devastating Grenfell Tower blaze during their performances at Glastonbury.
Grime artist Stormzy took a quiet moment during his set to remember those who were killed, before performing the rap he wrote for Simon Cowell's charity version of Bridge Over Troubled Water.
He also unzipped his tracksuit top to reveal a T-shirt emblazoned with a heart-shaped logo reading 'Grenfell'.
The rapper then led the crowd in a chant of 'Oh, Jeremy Corbyn', which appears to have become an unofficial Glastonbury anthem this year.