DUBAI, UNITED ARAB EMIRATES, SEPT. 10 -- Iraq and Iran mounted attacks on land and at sea today as United Nations Secretary General Javier Perez de Cuellar left on a peace mission to the Persian Gulf and Libya appeared to be drawing away from its ally, Iran.

In a joint communique, Libya and Iraq spoke of a desire to build ties. The two nations broke diplomatic relations in 1985 after Libya allied itself with Iran.

The fast-paced military and diplomatic developments left an air of uncertainty around Perez de Cuellar's mission, which is designed to win support for a cease-fire demanded by the U.N. Security Council .

Iraqi aircraft struck for the second day in a row at a wide range of targets inside Iran. Iranian artillery responded with heavy shelling that reportedly left the Iraqi city of Basra reeling.

In the Persian Gulf, Iranian gunboats raked a Cypriot-registered tanker off the coast of the United Arab Emirates with rocket and machine-gun fire, causing damage to the ship's superstructure but no injuries.

It was the first confirmed Iranian attack on a ship in a week, although shipping sources said there had been some reports of attacks that had not been corroborated. Iranian attacks had damaged eight vessels in four days between Aug. 31 and Sept. 3 in response to Iraqi attacks on vessels carrying Iranian crude oil.

The 232,164-ton tanker Haven was attacked by two gunboats about 2 a.m. after having been shadowed by the Iranian vessels for about two hours, the captain of the ship told Reuters news agency in a ship-to-shore telephone interview.

Television footage of the ship taken after it reached Dubai showed a number of holes near the crew's quarters, the bridge and smokestack, apparently from rocket fire. The pattern of fire indicated an attempt to hit the ship's crew. The vessel was carrying crude oil picked up in Saudi Arabia.

While a continuation of military activity on the eve of Perez de Cuellar's mission was foreseen by some here, today's joint Iraqi-Libyan communique, which heavily supported Baghdad's position, was not..

The communique stopped short of reestablishing formal relations, but did appear to leave Iran even more isolated than before in the Islamic world.

The communique, issued after a visit to Baghdad by Libyan Foreign Minister Jadallah Azzouz Talhi, called the Iran-Iraq war a "serious threat to peace in the region" and urged acceptance of the Security Council call for a cease-fire.

Baghdad has said it will accept the truce if Iran will, but Tehran so far has criticized the council for failing to condemn Iraq as the aggressor in the seven-year-old conflict. Iran, however, has said it will exercise restraint militarily during the Perez de Cuellar mission. Iraq, on the other hand, has vowed to continue to hit Iranian targets until Tehran accedes to the cease-fire call.

Perez de Cuellar stopped just short of criticizing the Iraqi position today as he left New York. "I think so far the Iraqis have initiated some military activities, but so far it doesn't go against the Security Council appeal because . . . the appeal was for a cease-fire while I was in the area. I am still in New York," he said.

The Peruvian secretary general also said that on the question of a lasting truce, the Iranians "have accepted a concept of a cease-fire, and we are going to discover what they understand by accepting the concept." He said he had hoped to see Iran's president, foreign minister and parliamentary speaker "but of course I cannot impose conditions . . . I thought that it would be a good idea to have the full leadership together, but they might have difficulties."

Moscow and Beijing also were the focus of diplomatic moves in the gulf war today. Should Tehran or Baghdad not agree to a long-term cease-fire, the Security Council is expected to consider possible sanctions, including an arms embargo. As permanent members of the council, both Moscow and Beijing have the power to veto any embargo move.

The Soviets played host to an Arab League delegation just after giving a relatively junior Iranian diplomat high-level access. Arab diplomats said today in Moscow that the Kremlin had been urging Tehran to go along with the cease-fire, which is also supported by the Arab League.

On Tuesday, the Soviet Union and Iran had condemned the "imperialist" U.S. presence in the gulf and called for the removal of foreign ships from the region. Iranian Deputy Foreign Minister Mohammed Larijani had been in Moscow for talks.

Another Iranian deputy foreign minister, Ali Mohammed Besharati, was in Beijing for talks today, as was an Iraqi parliamentary delegation.

In today's military action, an Iraqi military communique said warplanes had struck in western and central Iran, hitting two communications centers, a radio station, two power plants, a cement factory and a sugar factory.

Iranian artillery, meanwhile, hit Basra in southern Iran, and the northern town of Sulaymaniyah. A resident of Basra told Reuters in a telephone interview, "Dozens have fallen dead or wounded. Broken glass is everywhere. We are in chaos."

Even Europe got caught up in the gulf violence today as Iranian leftists, bitterly opposed to the government in Tehran, attacked Iranian targets in Oslo, Frankfurt and Paris.

The Iranian Embassy in the Norwegian capital was seized by members of the People's Fedayeen of Iran and held for about three hours before a group of 10 men and a woman surrendered to police. Iranian charge d'affairs Mohammed Hadi Ardelik reportedly was injured in the incident.

In Frankfurt, nine members of the same group were arrested after the Iran Air office in the West German city was ransacked. Iran Air offices in Paris also were damaged in apparently coordinated attacks. A bomb went off in Paris early this morning, damaging the Kuwait-French bank and shattering nearby windows. A bank with Saudi ties was damaged earlier this week.