Tens of thousands of Muslims have gathered outside Lakemba Mosque in Sydney's south-west to celebrate Eid al Adha.

An estimated crowd of 20,000 people lined the streets outside the mosque for prayers and speeches to mark the festival of sacrifice, which also celebrates the end of the annual pilgrimage, or hajj, to Mecca.

Security has been strengthened for the event after the mosque received threats in the wake of recent anti-terrorism raids.

Federal politicians told the gathering Australians were united by what they had in common, not their differences.

Immigration Minister Scott Morrison joined Labor leader Bill Shorten and New South Wales Premier Mike Baird in addressing the event.

Mr Shorten told the crowd he knew ignorance and prejudice had made some Muslims feel isolated.

He said Australia faced challenges when it came to racism.

"I am sure that from time to time you have to deal with the shouting of ignorant intolerance. These challenges have occurred before in Australian history," he said.

"Just ask Aboriginal and Torres Strait Islander people, the Vietnamese boat people, even the Irish Catholics."

Mr Baird said it was a testing time for the nation.

Thousands of people celebrated Eid at Lakemba Mosque. ( ABC News: Antonette Collins )

"Friends let's be honest, over the past few days and months it has been a difficult time," he said.

"But what I want to say is that we are all one family, we have different faiths, we have different backgrounds but we are all one family.

"It is something that we should be celebrating."

Muslim leader Samier Dandan said too many Australians were allowing the atrocities committed by Islamic extremists to shape their view of the religion.

Mr Dandan, who is the head of the Lebanese Muslim Association, urged non-Muslims not to believe unfair stereotypes.

"Events over the past few weeks confirm the worst fears of many," he said.

"Whilst mainstream society increasingly fears Muslims, Muslims themselves perceive mainstream society at best antagonistic and at worst openly hostile to their faith."