Solution (source code)

= Solution

Outside the star, $p=\rho=0$. The first <Tolman–Oppenheimer–Volkoff equation> gives $m(r)=M$, and the second gives
$$
\Phi'(r)=\frac{M}{r(r-2M)}
=\frac12\frac d{dr}\log\left(1-\frac{2M}{r}\right).
$$
Asymptotic flatness fixes the integration constant, so $e^{2\Phi}=1-2M/r$. The exterior line element is therefore the <Schwarzschild metric> with mass $M=m(R)$.