You can have your bags checked through from Strasbourg to Madrid even if you are on separate tickets because AF and IB have an interline baggage handling agreement. All you have to do in that case is to get yourself from T2D to T1 for which 2 hours is not a problem at all.