Deep inside Ethiopia, Somali troops and their guerrilla allies are digging in for a long bitter defense against Ethiopian efforts to recapture land seized by the Somalis last summer.

The Somalis hold strong positions at the Kara Marda Pass, just west of here, which controls the only real road through these mountains. Along the rugged ridges and deep in the thorny valleys, almost as far west as Harrar, Somali troops and the guerrillas of the Western Somali Liberation Front are stockpiling ammunition in anticipation of a major Ethiopian offensive. It is beginning to look like a long war in which Somalia, though outmanned and outgunned, will not give way easily.

THe Ethiopian drive that was reported last month now is seen as more of a softening-up operation to prepare for an all-out campaign that could still be months away, analysts in Mogadishu, the Somali capital, believe. The foreign experts expect that counteroffensive to concentrate on retaking Jigjiga, either by a frontal assault through the pass or an end run along the flatlands to the north.

They believe that the Somalis would lose such a battle. That would leave the Ethiopians, supported by the Soviet Union and Cuba, free to drive on Hargeisa. Somalia's second city, 120 miles east of here, or to turn south across the barren Ogaden region, which the Ethiopians lost to the Somalis last year.

Most observers in Mogadishu believe that the government of President Mohammed Siad Barre, anticipating that the Ethiopians will either defeat the Somalis at Jigjiga of isolate them there, is looking for a way to get negotiations started before that happens.

Simultaneously the Somalis are now giving a much more relaxed account of what is taking place. Having failed to persuade the United States and Western European countries to rush in supplies to thwart the march of Soviet power across the Horn of Africa, the Somalis now omit references to any dramactic Ethiopian blitzkrieg. This revised account seems closer to the truth.

In a two-day tour of Jigjiga and the hills to the west that took them within 12 miles of Harrar. Western correspondents saw not a single airplane, not even an artillery spotter, let alone he squadrons of Cuban-piloted Migs that the Somalis say have been filling the skies.

Sporadic artillery fire could be heard throughout the day, mostly around Babile to the west where the front has stabilized, but there was no sign of any clashes between ground troops. On this front at least, the lines are essentially staic, giving the Somalis time to strenghthen their defensesand to adjust their tactics and train troops in the frontal fighting that will be new to them.

The Somalis, though vastly inferior in numbers and equipment, appear to be in a position to make any Ethiopian counteroffensive extremely difficult. Even if the Ethiopians regain control of the area, which the Somalis claim is historically theirs, the Somalis are preparing for a long guerrilla campaign. Even the Ethiopian leader, Lt. Col. Mengistu Haile Mariam has said that if the Somalis are forced out of the Ogaden region, through military force or through negotiation, it will not bring peace.

The Somalis have the advantages of intimate knowledge of the rugged terrain, sympathetic local populace, and high morale. Ultimately, as the strength of the Ethiopian army grows and its discipline is restored, these may not be enough.Yet the immediate prospect here is for a lengthy campaign.

The Somalis admit making some 'tactical withdrawals" in the face of mechanized Ethiopian thrusts last month. They were pushed back from their positions in Harrar and were cleared out of some of the pockets they held around the Ethiopian city of Dire Dawa. Now a lull has set in.

In the remote guerrilla outposts, supplied by donkey caravan up the rugged slopes, loped commanders have learned a new respect for air power. The correspondents saw evidence that some villages have been strafed by cannon and rocket fire, if not actually bombed, and now the Somalis move at night and shift their outposts daily to avoid the planes.

But recruits and ammunition are coming in and there is no air of panic. In Jigjiga itself, there is every sign the Somalis expert to be in control for a long time - water service has been restored and electricians are working on the power lines. A former Ethiopian army based is used to train recruits and to house a few refugees who fled their homes when the Ethiopians advanced in January.

The situation is apparently more serious for the Somalis along the northern front which follows the rail line linking Addis Ababa, Ethiopia's capital, to Djibouti. The line runs through Somali-occupied territory and has been cut for almost a year.

There the Somalis admit they are caught between Ethiopian forces driving northward from Dire Dawa and southward from the little town of Adigala. The Ethiopians who strunk at Adigala last week apparently got there by rolling eastward across the open desert from the Addis Ababa-Assab highway.

Ethiopia would certainly like to reopen the railroad, which was its principal outlet to the sea, but some military experts believe that campaign is only a feint, a prelude to a drive eastward to attack Jigjiga from the north or to bypass it and dash for Hargeisa.

The Somalis says that is impossible because of the terrain, but an Arab military specialist in Mogadishu observed that "it is not more difficult than the terrain in Lebanon and you saw that the Syrians brought their tanks over that."

Reports differ on the outcome of the Adigala clash and the other encounters along the railroad. The Liberation Front has made some claims that strain credulity, such as knocking out 43 tanks in one battle.

It does appear that the Somalis are suffering severe casualties. Hospitals are generally off-limits to foreigners, but a few sources who have visted them say they are full of wounded. The four lumbering twin-engined Antonovs that constitute Somalia's air transport fleet, shuttle from Hargeisa to Mogadishu throughout the night, carrying ammunition to the north and reportedly bringing back casualties.

Although both the Somalis and the Ethiopians have taken correspondents on tours in the past week, no one has seen any actual fighting and little hard information about it has emerged. On the Jigjiga-Harrar front the situation appears to be this:

The units seen by the correspondents on their tour, except at the pass, had no heavy weapons, no antitank missiles, no anti-aircraft missiles and no helicopters. The Somali army certainly has some of this kind of equipment, though not enough for its needs. The unanswered question is, where is it? No one interviewed here could say.

Foreign military experts believe that the Somalis have committed nearly all of their estimated 30,000 regular troops and most of an approximately equal number of guerrillas to the defenses around Jigjiga. If that is true, then the Somalis, who suffer from poor field communications, a lack of transport equipment and a shortage of manpower, might not be able to defend that zone and protect themselves against an end run from the north.

Abdi Nassir, deputy chairman of the Western Somali Liberation Front, said in an interview that "you can see that we are outgunned, even with the total support of the Somali army, the [front] cannot resist the power and resources of the Soviet Union, Cuba and what's left of the Ethiopian army."

That reflects the virtually unanimous opinion of observers in Mogadishu - for all their valor and sense of righteousness, the Somalis must eventually give way to superior Ethiopian resources.

Until last year, the Somali armed forces were considered superior to Ethiopia's in many respects, even though Ethiopia has about nine times Somalia's population. Trained and equipped by the Soviet until their falling out last year, the Somalis had a respectable air force and armor superiority, Western analysts say.

The flow of Soviet equipment into Ethiopia, which coincided with the cutoff of arms supplies to Somalia, has altered the balance. The Ethiopians are now superior in the air and ahead in armored strength.

The Somalis are believed to have lost a considerable number of their estimated 250 tanks, and no replacements are coming in. The air force, which includes two squadrons of Mig 21 fighters, has been held back because the Somalis cannot afford to lose any planes that might eventually be needed for the defense of Somali proper. The tanks and planes the Somalis do have are said to be suffering from accumulated maintenance problems since Somalia ousted its Soviet military advisers in October.

Reports differ on what kinds of weapons Somalia is now getting. So far there is no credible evicence to show that the Somalis are getting any thing more than small arms and ammunition, not the tanks and rockets and airplanes they need. Egypt has supplied several planeloads of supplies, but the Somalis have been forced to scour the international free market in arms for new weapons.

"They get some things, but there's no pipeline andno big stuff and no spare parts for what they have," a well-placed source said.

Those deficiencies may tip the military balance against Somalia if the Ethiopians mount a sustained drive backed by all their planes and armor. That has not yet happened, however, and even if it does the outlook along the northern front is for a protracted struggle that could leave both sides exhausted.

When darkness falls over the Fafen Valley here, the Somali troops and the guerrillas - seemingly indistinguishable from one another - gather for a meal of rice and tea and then move off into the night. It is hard to miss the parallels of the Vietcong or of the Kurdish rebels in Iraq. Everyone of the soldiers interviewed during the tour seemed to accept as an article of faith that the people of this region are spiritually wedded to Somalia. They appeared to be prepared to extract a high price from the Ethiopians they regard as military occupiers.

There is no doubt that sheer military strength is on the side of Ethiopia - the Somalis admit it, and are shopping urgently for aid. Yet it seems unlikely, on the craggy ridges of these mountains, that Ethiopia can reclaim the land in a quick or tidy campaign.