The leaders of Austria and Hungary met in Vienna on Tuesday and pledged to closely cooperate to challenge the EU's migration policy.
Austrian Chancellor Sebastian Kurz met with Viktor Orban to discuss the closure of the Balkan migration route and the security of the EU's borders.
Kurz, whose government is backed by a far-right party, sided with eastern European states in saying Brussels should stop pushing countries to take quotas of asylum seekers.
"A key task of the EU - of us as member states - must be to stop illegal migration into Europe and to develop aid in the countries of origin. Only distributing (refugees) in Europe does not work," he told a joint news conference with Orban.
He said he would position Austria as a "bridge builder" between the "Visegrad group" of eastern European nations and their western counterparts.
The Visegrad group includes Hungary and Poland, which frequently defy Brussels on issues ranging from immigration to fundamental rights.
Orban said: "If we want Schengen, external borders must be closed and internal borders open. What's happening nowadays is they want to open the outer borders and close the internal ones. That's the exact opposite of what we call Schengen."
But the neighbours differ on several other issues.
Budapest has criticised an Austrian plan to cut child benefits for foreign workers, while Austria said this month it would sue the European Commission for allowing Hungary to expand its Paks power plant.