From nobody Tue Oct 17 15:02:53 2023 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S8y0D1TP2z4xcLK for ; Tue, 17 Oct 2023 15:03:08 +0000 (UTC) (envelope-from pprocacci@gmail.com) Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S8y0C6kSfz3d3b for ; Tue, 17 Oct 2023 15:03:07 +0000 (UTC) (envelope-from pprocacci@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-53e70b0a218so5300656a12.2 for ; Tue, 17 Oct 2023 08:03:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697554987; x=1698159787; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0f6RJZmOpSlgjhllGN0S1nM60m0GRBDEKkmCfQZO+B4=; b=AtF8J/hMW+Gf0/uX5BuLcAz8nE5FkYHs7JsnVYymCJyevYyzIJ+6T5EvGXwlNMqVJv fJyahbnuJ20AyCHC4FzDSjYSD86PCFT4GrS53P/etqMSdoyF2y41EIo1h2Kt2beaTgcH v+aTDll4NM3o3WVU0Cp9K9mNXQ1T7EzbqQe5XlFFa0Qk2DlME7vcRJwXGdF7xe4GbaAj CCAX5TE/6Qe3ffMxuFybzsegHwj862KKrz2C1M88SdAhTYSrXhCXQTJIBv0af1CeSTOu 0iYqMBDft3q7AWyXVn2SQ1mVokaTBnfemI2Rmgw22cpZs5UO2T0tBWkH/eSFk0Ez0BcO Trhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697554987; x=1698159787; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0f6RJZmOpSlgjhllGN0S1nM60m0GRBDEKkmCfQZO+B4=; b=YT8ZppEUEGERDgQZ216/ZV2q71HYVAeAiOKJoBAizBkTjqxmsCpf6njh7RtBZLb1UL T/KgrWuMbAthqkKJVm+iXUaYsbFgTTsFnA0cNzoxwzF5QjFQLkVvyXtY2OxjKON2ctxR s8/OwJsPrI6rjNvJdrWYzXxmQoP9GlCL31B7VX+MeBy/YuF02EL63ycfZiKS2q6GLuSQ W9RhQuM2oaU2RtRAQ5jkqwJyLWq8d1RbdQTw610X6fRcT4K1WEMnw1CIG+Y5/0GLIXuE 3cijwC8M04W+T2b3OK9ai4XQtfnwHNlSk5yHysNxAzXVf9QewfkvISb63TRUH1TDsxeU 4N8w== X-Gm-Message-State: AOJu0YwbvM8G8baOPn4ZdA72w4L6Ew0x0RcSLaCep616diiEbNJ3beKs Qlx/aNpPVAR3KT4kwvMunE1u9MBJmVA2X5Jdn4aKt7M/bg== X-Google-Smtp-Source: AGHT+IFjX6gF4pxO+eFAesvHbZ5l9A5A2tjJecJaTMUXqm/9qjIUWNO3CQl45LPW9jcGHcpIEhB779HywpwnmB7BPgA= X-Received: by 2002:a05:6402:50ca:b0:530:e090:1370 with SMTP id h10-20020a05640250ca00b00530e0901370mr2172050edb.35.1697554986335; Tue, 17 Oct 2023 08:03:06 -0700 (PDT) List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Paul Procacci Date: Tue, 17 Oct 2023 11:02:53 -0400 Message-ID: Subject: Re: Running a webserver inside a bhyve host and exposing it to the world via PF To: Odhiambo Washington Cc: freebsd-virtualization@freebsd.org Content-Type: multipart/alternative; boundary="000000000000f2834a0607ead1e5" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4S8y0C6kSfz3d3b --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 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 proto tcp from to port -> port ~Paul --=20 __________________ :(){ :|:& };: --000000000000f2834a0607ead1e5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Oct 17, 2023 at 10:01=E2= =80=AFAM Odhiambo Washington <odhi= ambo@gmail.com> wrote:
I am stuck on how I can achieve this.
I = have a Linux=C2=A0VM running under bhyve. I have installed a webserver runn= ing on port=C2=A080 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 h= ost machine.

1. I am able to access my VM using VN= C Viewer
2. My VM is able to access the Internet
3. I a= m NOT able to ping my VM from the host
4. I am unable to SSH into= the VM from the host.=C2=A0

My hunch tells me it&= #39;s about my PF.conf, but is there a guide somewhere on achieving the abo= ve?


--
Best regards,
Odhiambo WASHINGTON,
Na= irobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.",= =C2=A0egrep -v '^$|^.*#'=C2= =A0=C2=AF\_(=E3=83=84)_/=C2=AF=C2=A0:-)
[How to ask smart questions:=C2=A0http://www.catb.org/~esr/faqs/smart-questions.html]<= /div>

Care to share what you trie= d 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 <i= nternal port>

~Paul
--
___= _______________

:(){ :|:& };:
--000000000000f2834a0607ead1e5--