Court officials said the two men were found guilty of plotting to carry out terror attacks and they were trying to establish a cell of the extremist group in Ethiopia.
The convicted were also accused of recruiting members in Ethiopia.
Accordingly, the first defendant Badris Yesuf was sentenced to six years and six months of imprisonment while the second defendant, Anis Usman received five years and six months of jail term.
The two men were arrested three years ago while they were trying to carry out terrorist attacks in the capital, Addis Ababa and elsewhere.
Ethiopia has repeatedly thwarted a number of al-Shabaab attack attempts.
The militant group seeks to carry out attacks in Ethiopia to retaliate to Addis Ababa’s military intervention in the war-torn Somalia.
Ethiopia accuses its arch-rival Eritrea of funding and arming the extremist group to destabilise the country and the region at large, an allegation that Asmara denies.
Ethiopia has thousands of troops deployed in Somalia taking part in the fight against the radical group who seeks to establish an Islamic rule in the country.
Ethiopia first sent its troops to Somalia in 2006 to help the weak Somali interim government battle al-Shabaab.