Secretary of State John Kerry took a shot at Donald Trump during his Friday commencement speech to Northeastern University graduates, by saying no wall is big enough to keep dangerous terrorists out of the United States.

"Many of you were in elementary school when you learned the toughest lesson of all on 9/11," he said in his speech at Boston Garden. "There are no walls big enough to stop people from anywhere, tens of thousands of miles away, who are determined to take their own lives while they target others."

"So I think that everything that we've lived and learn tells us that we will never come out on top if we accept advice from sound-bite salesmen and carnival barkers who pretend the most powerful country on Earth can remain great by looking inward," Kerry added. "And hiding behind walls at a time that technology has made that impossible to do and unwise to even attempt."

Kerry didn't mention Trump by name, but Trump has repeatedly called for a wall on the southern U.S. border, and many Democrats, and some Republicans, have taken to calling him a carnival barker.

Kerry also seemed to dismiss the importance of national borders, and said technology has reshaped the world into one that the U.S. must engage at the risk of being left behind. He said Trump and others who want to look inward are making a mistake, even in the face of rising tension and violence in the world.

"For some people, that is all they need simply to climb under the sheets, close their eyes and push the world away," Kerry said. "And shockingly, we even see this attitude from some who think they ought to be entrusted with the job of managing international affairs."

"The future demands from us something more than a nostalgia for some rose-tinted version of the past that did not really exist in any case," he said. "You're about to graduate into a complex and borderless world."

This story was corrected to note that Kerry delivered his speech to graduates at Boston Garden.