An Israeli border guard was shot by a sniper and seriously wounded today outside the walls of the Moslem quarter of the Old City in an apparent vengeance attack.

The guard was struck in the abdomen by one bullet and was reported in satisfactory condition tonight after surgery. Security forces sealed off a large section of the Old City and made a house-to-house search detaining some Arab suspects for questioning.

The shooting followed the eight days of a series of assassination attempts, apparently by ultranationalist Jewish settlers, on three West Bank Arab mayors. Nablus Mayor Bassam Shaka lost both legs and Ramallah Mayor Karim Khalaf lost a foot in nearly simultaneous car bombings. El Bireh Mayor Ibrahim Tawil narrowly escaped when a bomb blew up in the face of a demolitions specialist, blinding him.

Today's sniper attack occurred outside the Crusader-era stone walls of the Old City, near Herod's Gate, in an area normally crowded with tourists. t

Police said the guard, whose name was withheld, was walking with two other armed and uniformed border policemen when several shots rang out from the top of the wall. Border guards are routinely used for security service in East Jerusalem and the West Bank, and are easily identifiable by their distinctive green berets.

The shooting occurred not far from where slogans appeared on the walls immediately after the car bombings. One sign, in Arabic, warned, "We will avenge Bassam Shaka."

Military authorities had said they feared that the car bombings, which apparently were in retaliation for the May 2 Arab machine gun ambush attack in Hebron, would trigger a cycle of terror attacks between Arabs and Jewish settlers in the West Bank. Six settlers died in the Hebron ambush. j

Meanwhile, an attorney for the families of Shaka and Khalaf charged today that the Israeli police have taken "no serious steps" to investigate the attacks on the mayors.

Felicia Langer, the lawyer, said at a news conference that more than a week after the bombings, authorities have not even interviewed members of the mayor's families who were in the vicinity when the explosions occurred.

Langer said one of Shaka's daughters, Hanna called police about footprints she discovered at the home, but that before anyone arrived to investigate, an Israeli Army officer trampled over the area and obliterated the evidence.

Langer said that if the investigation is not intensified, she will appeal to Israel's Supreme Court.

Officials of the military government denied there has been any coverup and said scores of investigators of the secret security service have been assigned to the case.

Prime Minister Menachem Begin, in a television interview, said "the most intensive investigation" was being conducted.

Although security officials say the bombings were almost certainly the work of extremist Jews, Begin said today that it is still unknown whether Arabs or Jews were responsible.

Immediately after the bombings some Israeli officials suggested that the attacks may have been part of an internecine war in the Palestine Liberation Organization.