WINDHOEK, NAMIBIA -- Far removed from the unending bush war fought by Namibian guerrillas and South African troops along the Angolan border, frustrated politicians in this tranquil capital are waging their own, thus far ineffectual battle for negotiated independence.

The groping for political autonomy for what nationalists describe as "Africa's last colony" is an extremely complex quest, riddled with local ethnic politics and constantly skewed by international pressure. Like the two-decades-long war on the northern border, it seems to have no end.

Yet, whites and blacks continue to sit together in a marathon effort to hammer out a constitution that would create an independent parliament and executive branch acceptable to the diverse tribal and ethnic groups in this mineral-rich desert territory.

More importantly, it would have to be acceptable to the government of South Africa, which has administered South-West Africa/Namibia since the end of World War I and which must sign off on any independence plan.

The most recent constitutional push, involving 17 months of tough negotiations and hard-won compromises, is drawing to a close amid diminished expectations and a pervasive sense that independence, at best, is a long shot for the time being.

The seemingly interminable struggle has driven many Namibians to despair. Or, as one politician, Kenneth Abrahams of the Namibian Independent Party, succinctly put it, "After 21 years, any reasonable person would ask, 'Why am I still doing this?' "

Namibia's multiracial transitional government now appears headed toward a major showdown with South Africa over its new constitutional demands.

Accompanying the demands is an "action program" for 1987 whose main goals are the official adoption of Namibia as the territory's only name; the creation of a national flag and anthem; a study of the possible introduction of border control posts and the establishment of a purely Namibian Ministry of Internal Security.

The two-year-old interim government will begin talks Friday with South African Foreign Minister Roelof F. (Pik) Botha and Defense Minister Magnus Malan to discuss a draft constitution. But the proposed charter is certain to go against the grain of Pretoria's entrenched policy and could even lead to an eventual dissolution of the interim government here if negotiations break down.

A precedent for such a step was set in 1982, when an earlier interim government was abolished by Pretoria and direct control of the territory reverted to a South African administrator-general.

South African President Pieter W. Botha, through his current administrator-general here, Louis Pienaar, already has threatened to pull the plug on the six-party transitional government if it does not broaden its representational base and guarantee minority white rights in any constitution that emerges. Botha, political sources here said, repeated that warning when he met with the transitional Cabinet in Cape Town on May 22.

Moreover, the conservative swing in South Africa's May 6 whites-only parliamentary elections has exacerbated fears here that South Africa will harden its demand for guarantees of "minority group rights," a term widely viewed by Namibians as a euphemism for the rights of the territory's 100,000 whites, who comprise only about 8 percent of the country's 1.2 million population.

Four of the six partners in the Pretoria-appointed interim government have demanded that ethnicity be abolished as a structural basis for governing, opting instead for individual liberties to protect ethnic group rights implicitly rather than explicitly.

The perception of leading politicians here, expressed in a broad range of interviews, is that President Botha is determined not to set an example in Namibia that goes against the principles of cautious power-sharing reform measures he is considering for South Africa. Those principles stress protection of ethnic group rights and separation of governance of the groups' "own affairs" -- the cornerstone of South Africa's system of racial segregation, or apartheid.

"In this country, political parties are normally based on ethnic groupings. But it's one thing to have a political party based on ethnicity and another thing to have a government based on ethnicity. Personally, I would not participate in ethnic elections. We want nationwide elections," said Dirk Mudge, Namibia's finance minister and the man largely responsible for creating the transitional government.

The question of ethnic separation, however, is only one problem bedeviling this Texas-sized former German colony, which South Africa continues to administer in defiance of United Nations' resolutions and almost universal condemnation.

Since 1947 -- 32 years after South Africa routed Germany from South-West Africa during World War I -- the quest for Namibian independence has been mired in international dispute, South African intransigence and, more recently, U.S. demands linking independence to the withdrawal of an estimated 30,000 Cuban troops from neighboring Angola.

Nine years after its adoption, U.N. Security Council Resolution 435, which calls for an end to South Africa's "illegal" administration of Namibia and the holding of U.N.-supervised elections, appears no closer to being implemented.

Moreover, there appears to be no end in sight to the bush war with the South-West Africa People's Organization (SWAPO), which the U.N. General Assemby in 1973 recognized as the "sole and authentic representative" of the Namibian people.

Indeed, a resolution of the independence question here seems a remote possibility as long as SWAPO continues to assert its claim on running the country and as long as the Cuban troops remain in Angola.

The prevailing view in Pretoria is that while Resolution 435 is acceptable as a basis for an internal independence process, a SWAPO victory would give impetus to the revolutionary movement inside South Africa and provide the outlawed African National Congress with a sanctuary from which it could wage its guerrilla war against apartheid.

SWAPO continues to insist on the full implementation of the U.N. resolution, without the withdrawal of the Cubans from Angola.

"We are not prepared to talk about this document {the draft constitution} being enacted without the U.N. troops and staff coming to supervise free elections," SWAPO spokesman Anton Lubowski said in an interview here. "Namibia is an international problem and has been since 1920 {when the League of Nations granted South Africa a mandate to govern the former German colony}. The international community has a duty to play a role here."

Lubowski said irresistible pressure would be placed on South Africa to resolve the conflict if President Reagan dropped U.S. insistance on linkage between implementation of Resolution 435 and Cuban troop withdrawal from Angola.

In the meantime, the government of eight appointed ministers, two of them white, continues to grope for an internal solution through a home-grown constitution that it hopes will be acceptable to the white minority, the 10 fragmented tribal and ethnic groupings of Namibia, and to Pretoria.

Namibia's black justice minister, F.J. Kozonguizi, who is involved in the constitutional process, said he has no idea where the draft constitution will lead Namibia. But he urged caution and a gradual transitional process that could include a constituent assembly with SWAPO participation.

"We're trying to say to Mr. Botha, 'Let us go on and publish these proposals, and at some point we have to come together and marry these proposals. The problems are huge," said Kozonguizi, who -- unlike Finance Minister Mudge -- said he favors ethnic tiers in government because he fears a unitary system would lead to domination by the Ovambos of northern Namibia, who comprise 52 percent of the territory's population.

"The Ovambos live in a small part of the country. Would you allow them to dominate the rest of the country just because they are the majority? Ethnic politics is very difficult," the justice minister said.

He added, "At the end of the day, I feel a solution will only come if we in government and SWAPO can come together and agree on a constitution that is acceptable to the people. But to go into an election now and polarize the people, that's not the way."

Kozonguizi said he doubted whether an election would be held "this year or next."

Mudge, who besides being finance minister heads the centrist Republican Party and the Democratic Turnhalle Alliance of ethnic parties, said, "All I want is to see a constitution published, because SWAPO has a constitution and we don't. Whether South Africa will allow us to implement that constitution, I don't know. When they see our constituion, it won't be that much different from the SWAPO constitution."

Mudge, who is white and who in 1982 was displaced by Pretoria as head of the then-interim government, said he was fully prepared to join a black majority government based on the unitary system as long as it did not lead to a situation like that in Zimbabwe, where, he said, "the white group became a hated minority."

"I can't change my color, but I can change my politics. I want to join the majority. He {Botha} doesn't seem to understand that," said Mudge.

In theory, if a new constitution is approved by Pretoria and the United Nations says it conforms to Resolution 435, SWAPO could be persuaded to accept it, and elections could be held without the supervision of U.N. troops.

But Sean Cleary, a former South African adviser to Namibia who now runs a consulting firm, pointed out that there are still several obstacles to that kind of breakthrough, including the question of ethnicity.

Racial segregation, as known in South Africa, has been largely eliminated in Namibia, where blacks and whites live together in many neighborhoods and where the interim government has embarked on a major program of school desegregation.

However, the campaign has been only partly successful, largely because education grants comprise a main source of revenue for the regional, ethnic-based governments, whose tribal leaders often skim off school grants to fund other public services. The regional leaders, therefore, have a vested interest in maintaining the ethnic-based education system.