President Jaafar Nimeri today threatened retaliatory action against Ethiopia for what he called its support of subversive activity against Sudan. He hinted that he might close the country's 1,000 mile border with Ethiopia.

Nimeri last week accused Ethipia of establishing training camps for conspirators against his country. Today he warned that Sudan "would hunt the attackers inside the borders they come from."

Nimeri said he could use the support of an estimated 140,000 Eritrean refugees and Ethiopian nationals in Sudan "to create trouble and problems" for the Ethiopian government.

Eritrea, a province in northern Ethiopia, is the scene of continuing guerrilla warfare between troops of Ethiopia's military government and natiionalists battling for independence.

Speaking on the occasion of the 21st anniversary of Sudan's independence from Britain, Nimeri accused Ethiopia of "committing massacres against Eritreans and Ethiopians alike, including children and women."

Last week, he said an invasion of Sudan by activists being trained in Ethiopia was imminent.

"I not only know of the camps . . . but also know of their location and the number of men in each," he said.

Nimeri said he had proof of a plot against Sudan being masterminded by an organization that he called the anti-Sudanese National Front. He said the front is led by former Sudanese Premier Sadik Mahdi, one-time leader of the Umma Pary, and other political dissidents who had fled from Sudan.

He had full details of this plot, he said, and of the movements of the National Front plotters in Addis Ababa, in Europe and in "a certain Arab capital."

The president's speech climaxed a week of increasingly strong accusations against Ethiopia. Earlier this week he had called on people in border areas to be especially vigilant and to be ready to repel any attack from Ethiopia.

he Ethiopian government this week expressed astonishment at the accusations and said in a response: "Everyone knows that Sudan is openly being used as a base of operations by the Eritrean secessionist elements as well by various counter-revolutionary groups opposed to the Ethiopian revolution."

Nimeri, whose army aborted a two-day revolt instigated against him by Libya last July, emphasized that Sudan has the "military might to crush any attempted aggression." Sudan signed a joint military pact with neighboring Egypt last July shortly after the attempted coup.

The 46-year-old president, who seized power in a bloodless coup in 1969, has survived three attempts to overthrow his government.

The Sudanese leader also said he may ask for the transfer of the Organization of African Unity head-quarters from Addis Ababa unless the government there "refrains from harboring elements working for agitation in members' countries."

Nimeri accused Ethiopia of having mistreated Sudanese ministers attending international conferences in Addis Ababa and said that Sudanese diplomats in the Ethiopian capital had also been mistreated.