The Soviet Union has moved hundreds of troops in Afghanistan toward the Iranian border to choke off rebel traffic between the two nations, government sources said yesterday.

These officials, apparently relying on information from friendly sources in Kabul as well as other intelligence, stressed that the new deployments are not aimed against Iran itself.

Instead, they said, the Soviet troops are spreading out from the main corridor between the Afghan-towns of Herat and Shindand to block rebels using passes running between Afghanistan and Iran.

The military significance of the Soviet activity on the Iranian front, Pentagon sources said, is the Kremlin's determination to crush the rebels despite rising losses in Afghanistan.

These officials said the Soviets already have moved against the rebel mountain passes from Afghanistan and Pakistan, including laying mines, and now are stepping up their campaign against Iranian sanctuaries.

The Soviet redeployments to the Iranian border area started only a few days ago, officials said, so it is too early to tell how big a force will be concentrated there.

If the Soviets end up with a big force on Iran's border, even though their mission is containment of the rebels rather than invasion, Iran's rulers are apt to get nervous.

The Iranian sanctuaries used by the Afghan rebels are a long way from Iran's oil fields, which are clustered far to the southwest at the head of the Persian Gulf.

Some top U.S. military leaders openly admire the stiff fight the Afghan rebels are putting up against the Soviets. They add with unconcealed delight that the cost of the Soviet operation in Afghanistan is climbing into big numbers, with fuel and broken equipment part of it.

The Soviets will eventually grind down the rebels, one military planner said, but the Kremlin is not getting off easy.