Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Oct 2023 11:02:53 -0400
From:      Paul Procacci <pprocacci@gmail.com>
To:        Odhiambo Washington <odhiambo@gmail.com>
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: Running a webserver inside a bhyve host and exposing it to the world via PF
Message-ID:  <CAFbbPuiRLC0F93JMybdk2sFzJ2X_o5JqkQo3trd91LoZeusXqA@mail.gmail.com>
In-Reply-To: <CAAdA2WNzTb6Fvk=Z%2BtAx376mBRztgxY_M75aXBzDFN1bb9yOuQ@mail.gmail.com>
References:  <CAAdA2WNzTb6Fvk=Z%2BtAx376mBRztgxY_M75aXBzDFN1bb9yOuQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000f2834a0607ead1e5
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Oct 17, 2023 at 10:01=E2=80=AFAM Odhiambo Washington <odhiambo@gmai=
l.com>
wrote:

> I am stuck on how I can achieve this.
> I have a Linux VM running under bhyve. I have installed a webserver
> running on port 80 that I'd like to expose to the outside world.
> I am unable to figure out how to achieve this with PF running on the host
> machine.
>
> 1. I am able to access my VM using VNC Viewer
> 2. My VM is able to access the Internet
> 3. I am NOT able to ping my VM from the host
> 4. I am unable to SSH into the VM from the host.
>
> My hunch tells me it's about my PF.conf, but is there a guide somewhere o=
n
> achieving the above?
>
>
> --
> Best regards,
> Odhiambo WASHINGTON,
> Nairobi,KE
> +254 7 3200 0004/+254 7 2274 3223
> "Oh, the cruft.", egrep -v '^$|^.*#' =C2=AF\_(=E3=83=84)_/=C2=AF :-)
> [How to ask smart questions:
> http://www.catb.org/~esr/faqs/smart-questions.html]
>

Care to share what you tried with your PF.conf?

It should be something as simple as:
rdr on <interface> proto tcp from <source host> to <physical host> port
<physical port> -> <internal host> port <internal port>

~Paul
--=20
__________________

:(){ :|:& };:

--000000000000f2834a0607ead1e5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div dir=3D"ltr"><br></div><br><div class=3D"gmail_qu=
ote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Oct 17, 2023 at 10:01=E2=
=80=AFAM Odhiambo Washington &lt;<a href=3D"mailto:odhiambo@gmail.com">odhi=
ambo@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex"><div dir=3D"ltr">I am stuck on how I can achieve this.<div>I =
have a Linux=C2=A0VM running under bhyve. I have installed a webserver runn=
ing on port=C2=A080 that I&#39;d like to expose to the outside world.</div>=
<div>I am unable to figure out how to achieve this with PF running on the h=
ost machine.</div><div><br></div><div>1. I am able to access my VM using VN=
C Viewer</div><div>2. My VM is able to access the Internet</div><div>3. I a=
m NOT able to ping my VM from the host</div><div>4. I am unable to SSH into=
 the VM from the host.=C2=A0</div><div><br></div><div>My hunch tells me it&=
#39;s about my PF.conf, but is there a guide somewhere on achieving the abo=
ve?</div><div><br clear=3D"all"><div><br></div><span class=3D"gmail_signatu=
re_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div di=
r=3D"ltr"><div dir=3D"ltr"><div>Best regards,<br>Odhiambo WASHINGTON,<br>Na=
irobi,KE<br>+254 7 3200 0004/+254 7 2274 3223<br>&quot;<span style=3D"font-=
size:12.8px">Oh, the cruft.</span><span style=3D"font-size:12.8px">&quot;,=
=C2=A0</span><span style=3D"font-size:12.8px">egrep -v &#39;^$|^.*#&#39;=C2=
=A0</span><span style=3D"background-color:rgb(34,34,34);color:rgb(238,238,2=
38);font-family:&quot;Lucida Console&quot;,Consolas,&quot;Courier New&quot;=
,monospace;font-size:13.6px">=C2=AF\_(=E3=83=84)_/=C2=AF</span><span style=
=3D"font-size:12.8px">=C2=A0:-)</span></div><div><span style=3D"font-size:1=
2.8px">[How to ask smart questions:=C2=A0</span><span style=3D"font-size:12=
.8px"><a href=3D"http://www.catb.org/~esr/faqs/smart-questions.html" target=
=3D"_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a>]</span><=
/div></div></div></div></div></div>
</blockquote></div><br clear=3D"all"></div><div>Care to share what you trie=
d with your PF.conf?</div><div><br>It should be something as simple as:<br>=
rdr on &lt;interface&gt; proto tcp from &lt;source host&gt; to &lt;physical=
 host&gt; port &lt;physical port&gt; -&gt; &lt;internal host&gt; port &lt;i=
nternal port&gt;<br><br></div><div>~Paul</div><div><span class=3D"gmail_sig=
nature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature">___=
_______________<br><br>:(){ :|:&amp; };:</div></div></div>

--000000000000f2834a0607ead1e5--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFbbPuiRLC0F93JMybdk2sFzJ2X_o5JqkQo3trd91LoZeusXqA>