Moshe Dann has eloquently explained why there is absolutely nothing illegal about the Jewish towns located beyond the 1949 Armistice Lines. The key paragraphs are:
In 1967, under attack, Israel struck back and conquered the Golan Heights from Syria, the Sinai Peninsula and the Gaza Strip from Egypt, and Judea, Samaria and Jerusalem (the West Bank) from Jordan. Israel had been threatened with a second Holocaust, and few questioned its actions. No one spoke of a Palestinian state; there was no "Palestinian people."
Many legal experts accepted Israel's right to "occupy" and settle its historic homeland, because the areas had been illegally occupied by invading Arab countries since 1948.
One organization, however - the International Committee of the Red Cross - disagreed.
Meeting secretly in the early 1970s in Geneva, the ICRC determined that Israel was in violation of the Fourth Geneva Convention. Based on the Hague Convention, GC IV was drawn up after World War II to protect innocent civilians and restrict brutal occupations. Unilaterally, the ICRC turned it into a weapon to delegitimize and demonize Israel.
As far as is known, the ICRC did not rely on any legal precedents; it made up "the law."
Judge and jury, its decisions lacked the pretense of due process. Since all decisions and protocols of the ICRC in this matter are closed, even the identities of the people involved are secret. And there is no appeal. Without transparency or judicial ethics, ICRC rulings became "international law." Its condemnations of Israel provide the basis for accusing Israel of "illegal occupation" of all territory conquered in 1967.
Although most of the international community, its NGOs and institutions accept the authority of the ICRC and other institutions, such as the International Court of Justice, as sole arbiters of what is "legal," or not, it's strange that some Israeli politicians and jurists cannot defend Israel's legal claim to the territories. And Israel's case is strong.
ADOPTED IN 1945, the UN Charter (Article 80) states: "...nothing in this Chapter shall be construed in or of itself to alter in any manner the rights whatsoever of any states or any peoples or the terms of existing international instruments to which members of the United Nations may respectively be parties."
This means that the designation of "Palestine" as a "Jewish National Home," incorporated in the British Mandate and established by international agreements adopted by the League of Nations and US Congress, guarantees Israel's sovereign rights in this area. All Jewish settlement, therefore, was and is legal.
The sad part is that all of this is irrelevant. The world has decided that Jewish residence in Judea is illegal, and will not be deterred by facts. [Just as the Muslims are convinced, despite clear Quranic proof, that the Bet ha-Miqdash never stood on the Temple Mount.] It's nice for us to know. The rest of the world couldn't care.