# Gluing oriented manifold along boundaries

Let $M_1$ and $M_2$ be oriented manifolds with boundaries. Suppose they have homeomorphic boundaries. I want to glue $M_1$ and $M_2$ along the boundaries via some homeomorphism. To ensure that the resulting space is again an oriented manifold, I think I need to take an orientation reversing homeomorphism between boundaries.

So let $f:\partial M_1 \to \partial M_2$ be a homeomorphism.

My question is that:should $f$ be an orientation preserving with respect to the induced orientation on the boundaries? Or can we choose any orientations on the boundaries so that $f$ is orientation reversing with respect to the choice of the orientations of the boundaries?

Thank you.

The resulting object will be (assuming everything's compact, say...) an orientable manifold, but not an oriented one. If you want it to be oriented, with the orientation matching that of $M_1$, say, then the map $f$ should be orientation reversing (which may not be possible without reversing the orientation on $M_2$, and hence the induced orientation on $\partial M_2$).