* Khartoum accuses Juba of supporting rebels
* Sudan gave S.Sudan until Aug.7 to shut oil output due to row
* Juba denies charges
By Aaron Maasho
ADDIS ABABA, July 22 (Reuters) - African goverments stepped up their efforts to prevent a shutdown of oil production in South Sudan on Monday, agreeing to send three generals to investigate Sudanese allegations that Juba is supporting anti-Khartoum rebels.
Sudan, the sole conduit for South Sudan's oil exports, said last month it would close two cross-border oil pipelines within 60 days and insisted output be shut by August 7 unless Juba gave up its support for the rebels. Juba denies backing them.
The two sides fought one of Africa's longest civil wars before the south won independence in 2011.
Analysts say South Sudan might collapse without oil, the main source for the budget apart from foreign grants. They point to recent looting of aid agencies by soldiers as a sign that Juba is struggling to pay salaries.
Closing the wells is also bad news for Sudan, which has been struggling with turmoil since losing most oil reserves with South Sudan's secession. Oil fees from Juba are essential to bringing down soaring inflation.
A team of three generals from the African Union and East African bloc IGAD will travel on Tuesday to Khartoum before heading to Juba on a six-week mission, said Ramtane Lamamra, Commissioner of the AU's Peace and Security Council.
"The decision by Sudan to shut down oil exports until and unless this issue is properly handled...has brought President Mbeki to propose to the two countries the formation of this investigation team," Lamamra Told a news conference.
Former South African President Thabo Mbeki is the bloc's chief mediator for Sudan and South Sudan.
"We hope this mechanism will resolve that longstanding problem, the allegation by both parties of hosting rebels against the other," said Ethiopia's Foreign Minister Tedros Adhanom, current chair of the Horn of Africa grouping IGAD.
Khartoum accuses Juba of supporting the Sudanese Revolutionary Front (SRF) rebel alliance, which complains of neglect at the hands of the wealthy Khartoum elites. The SRF in April staged an attack on central Sudan.
South Sudan in turn accuses Sudan of backing rebels in its eastern Jonglei state, where fighting is making it impossible to realise government plans to search for oil with the help of France's Total and U.S. ExxonMobil.
South Sudan plans to sell 6.4 million barrels of oil worth $300 million before shutting down its entire production by the end of July due to the row.
It had only resumed oil production in April, after turning off wells pumping around 300,000 barrels per day in January 2012 when both sides failed to agree on pipeline fees.
Oil industry insiders say once the pipelines are closed it will take several months to restart production as they would have to be flushed of water and cleaned first.