Three months after Libya's constant provocation of its neighbors culminated in a military drubbing in a border war with Egypt, the government of Col. Muammar Qaddafi has entered a period of improved relations with Egypt, Tunisia and the Sudan.

The thaw could alleviate the fears of subversion and attack that have diverted Egyptian troops and aircraft from the Sinai front to the western border, and could signal reduced Libyan support for the radical government in Ethiopia, Sudan's bitter enemy.

The angry accusations, border closings, propaganda wars and military maneuvers of the summer have ended and have been replaced by cautious expressions of friendship and goodwill.

As usual with Qaddafi, it is not clear what has brought about this abrupt shift. It may be that Libya's reported internal problems and political instability have prompted him to seek an easing of tension in his foreign relations. Some analysts credit Palestinian leader Yasser Arafat's shuttle diplomacy with defusing the explosive feud between Libya and Egypt.

In any case, it is evident that a turn-around has occurred.

In Tunis last weekend, ailing President Habib Bourguiba gave a luncheon for Abdelanti Labidi, who headed Libya's delegation at a meeting of the Libya-Tunisia Joint Commission, a relic of their failed merger of 1974.

Labidi praised Bourguiba for his commitment to the "ties of solidarity and fraternal cooperation between the two countries, and he extended Qaddafi's "fraternal greetings, expressions of friendship and wishes for happiness and prosperity."

Both sides expressed gratification that a period of crisis was behind them and said they would work for still better bilateral relations. As recently as this summer, both sides were moving naval units into the waters of their coastal border in a dispute over oil drilling rights. The land border was closed even before that in a series of political feuds dating back to Bourguiba's refusal to proceed with the merger.

After Labidi's visit to Tunisia, Libya's official new agency and newspapers in Cairo reported that Egyptian President Anwar Sadat had sent a team of doctors, headed by his minister of health, to treat Qaddafi's son, who was suffering from gastroenteritis-gesture had been received "very favorably" in Libya. The Cairo press, which had been pillorying Qaddafi's as a Union, quoted him as saying of Sadat's gesture. "This is Sadat as I have al [TEXT OMITTED FROM SOURCE] brief war in July is to be placed under madman and a tool of the Soviet ways known him."

This era of good feeling was expanded when it was announced that Libya had repaired and returned to Egyptian control the Egyptian consulate in Benghazi, sacked by mobs earlier this year. The border area where the two countries fought their brief war in July is to be placed under joint administration, the authoritative Cairo newspaper Al Ahram said.

Earlier this month, commercial airline service was resumed between Cairo and the Libyan cities Benghazi and Tripoli, and the land border was reopened. This is a far cry from the situation in the summer, when Sadat sent his planes to bomb Libyan air bases and denounced Qaddafi as a would-be "Napoleon."

Egypt and the Sudan close allies, signed a defense pact in 1976 after an attempted coup against Sudanese President Jaafar Nimeri for which Nimeri blamed Libya, apparently on good evidence.

Since then Nimeri has been even more fervent than Sadat in his denunciations of Qaddafi, whose ties to the Soviet Union and support for the Marxist government in Ethiopia made him appear to Sadat and Nimeri as an agent of Soviet expansionism and radical policies in Africa.

Yesterday, however, the Sudanese radio carried a statement by Bona Malwal, the minister of information, that the Sudan was prepared to re-establish diplomatic relations with Libya. He was quoted as saying this would depend on Libyan cooperation in Sudanese efforts to preserve its national unity. Relations were broken after the 1976 coup attempt.

That announcement followed a visit to Cairo by Nimeri for a joint meeting of the Sudanese and Egyptian Parliaments. After that meeting, Sadat Told reporters that Egypt "has no interest in perpetuating our differences" with Libya. Nimeri said it was "natural to maintain close relations between Egypt and the Sudan on one side and Libya on the other."

It is likely that shifts are tactical rather than strategic, Bourguiba, Sadat and Nimeri are the antithesis of Qaddifi's revolution; they are moderate, pro-western and favorable toward a peace settlement with Israel. They regard him as a radical trouble-maker who refuses to play by accepted interntional rules. A hint of the enduring suspicion with which Sadat and Nimeri regard Qaddafi appeared in their pledge to "keep up their efforts to assure the stability" of Chad. Libya has annexed thousands of square miles of Chadian territory along their border, apparently in an attempt to develop uranium resources there.