We present a set of long-range Bethe ansatz equations for open quantum strings on AdS5×S5 and demonstrate that they diagonalize bosonic su(2) and sl(2) sectors of the theory in the near-pp-wave limit. Results are compared with energy spectra obtained by direct quantization of the open string theory, and we find agreement in this limit to all orders in the 't Hooft coupling λ=gYM2Nc. We also propose long-range Bethe ansätze for su(2) and sl(2) sectors of the dual N=2 defect conformal field theory. In accordance with previous investigations, we find exact agreement between string theory and gauge theory at one- and two-loop order in λ, but a general disagreement at higher loops. It has been conjectured that the sudden mismatch at three-loop order may be due to long-range interaction terms that are lost in the weak coupling expansion of the gauge theory dilatation operator. These terms are thought to include interactions that wrap around gauge-traced operators, or around the closed-string worldsheet. We comment on the role these interactions play in both open and closed sectors of string states and operators near the pp-wave/BMN limit of the AdS/CFT correspondence.