IR flavors of light usually do not penetrate the water very well so the signal might not be very strong even at 2 meters. Green light penetrates better so a green LED and a matched receiver would probably be better than IR.
Either way should be easy to test with a 2.5 meter section of pipe.