Iran usually the world's second-largest oil exporter, or odered fuel rationing today as worsening strikes combined with another day of street demonstrations and army shooting to further undermine the faltering authority of Shah Mohammad Reza Pahlavi's government.

At a square in western Tehran, special forces commandos opened fire on a funeral procession for an anti-shah professor, killing at least six persons including a colonel escorting the marchers, witnesses said.

Elsewhere in the capital, mobs of protesters roamed the streets for the fifth straifgh day, setting up barricades an lighting bonfires. Beleaguered martial law troops were largely unable to control or discourage the mob, despite their shooting.

The chairman of the Nationa Iranian Oil Co. announced the imposition of rationing as production from the country's strike-bound oilfields fell to about 300,000 barrels, less than half the daily domestic demand.

Authorities said Iranians will be limited to the equivalent of 6.6 gallons of gasoline and 5.2 gallons of kerosene per purchase. In addition, Tehran bus service was suspended because of the fuel shortage.

Diplomatic sources and Iranian officials said the widespread strikes, particularly in the oil sector, posed a greater danger to the shah's government than the street protests, although these been gaining in intensity and increasing the strain on the Iranian armed forces.

A spokesman for the oppostion National Front said, "I think today marks the start of the final days. The people are determined to finish it, and the strikes have reached a much greater extent than we could have imagined."

A source close to the shah's imperial palace said the 59 year old monareh has been "hurt badly" by the latest events.

"The strikes are really serious," the official said. "They are really paralyzing the situation. I don't know how the government is going to handle this."

Besides the oil workers, officials of the national airline, Iran Air, the post and telecommunications offices, the Central Bank, the state electrictiy company, the customs administration and a number of other public sector bodies are on strike.

"Things can get worse, but not much," a diplomat said.

Oil industry sources said the murders of a top American oil man and an Iranian production supervisor have been instrumental in the sharp drop in crude output. The threats against the remaining employes, including notes ordering them to "resign or be killed," have been stepped up.

The Abadan refinery in southwestern Iran, the world's largest, is operating at 60 percent of capacity, but the Tehran refinery is completely closed, sources said. They said that if crude production ceases entirely, stocks would only last about five days.

The demonstrations in the capital, meanwhile, seem to be taking on an increasingly anti-American tone. Slogans scribbled on walls denounce the United States and President Carter almost as much as the shah.

"I don't understand why Carter keeps supporting the shah," said Manu Pessian, an architect. "He must be getting his advice from the Mafia and The CIA. What does he think he can do about all those people."

He gestured at a throng of several thousand marching up Queen Elizabeth Boulevard toward a hospital containing the body of a young professor fatally shot the day before at a government building where about 80 academicians had been holding a sitin. The rest of the group was reportedly arrested early today.

Most of those who assembled to protest the professor's death appeared to be professional people - middle-class men wearing coats and ties and women in Western dress, without the Traditional head-to-toe black veil.

"The educated section of society is more pro-Western, but the Americans themselves are pushing us into the mouth of communism by backing the corrupt people who are on top in this country," said a U.S-trained civil engineer at the demonstration. "I make 300,000 rials ($4,264) a month, but I say to hell with if I have no freedom and I canht say what I want."

The harassment of foreigners, including non-Americans, intensified. A West German diplomat was among a number of foreigners whose cars were surroundged by mobs and damaged while stopped in traffic.

On one street, an Iranian motorist swerved toward and narrowly missed me. Asked why he had done it, he replied in English. "Because you are American."

The main march on Queen Elizabeth Boulevard resulted in a standoff for several hours as troops backed by two British-made Chieftain tanks blocked the way to the hospital where the professor's body lay.

After initially disperising the crowd with tear gas, only to see it regroup, the troops seemed confused and indecisive. They held their fire as the demonstrators sat down about 100 yards from the tanks. Between the Chieftains and the protestors stood a dozen members of the elite Ranger force in camouflage fatigues and caps carrying automatic rifles.

Opposition leaders said a Ranger colonel in charge of the force around the sealed-off hospital reached agreement with two religious and political opposition leaders to allow the demonstrators to accompany an ambulance containing the professor's body as far as the nearby 24th of Esfand Square, where the marchers were to disperse. The accord was reached with National Front leader Karim Sanjabi and a Shiite Moslem figure, Ayatollah Mahmoud Taleghani, after the colonel had consulted the Tehran martial law administrator, they said.

But when the procession, with the colonel in the forefront, approached the square, witnesses said another Ranger unit stationed there started firing in the air. Then the commandos lowered their guns and opened up on the crowd, killing the colonel and a number of other people while regular army troops and riot police posted at the square also joined the shooting, the witness said.

"It was the most senseless shooting I ever saw," said Hagir Dariush, a filmmaker who had been walking alongside the colonel.