From owner-freebsd-virtualization@freebsd.org Tue Aug 11 20:15:06 2020 Return-Path: Delivered-To: freebsd-virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1A0E3B60F6 for ; Tue, 11 Aug 2020 20:15:06 +0000 (UTC) (envelope-from pete@nomadlogic.org) Received: from mail.nomadlogic.org (mail.nomadlogic.org [174.136.98.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.nomadlogic.org", Issuer "Let's Encrypt Authority X3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BR3wT5Ydpz40pD for ; Tue, 11 Aug 2020 20:15:05 +0000 (UTC) (envelope-from pete@nomadlogic.org) Received: from [192.168.1.160] (cpe-23-243-161-111.socal.res.rr.com [23.243.161.111]) by mail.nomadlogic.org (OpenSMTPD) with ESMTPSA id 2ee217f6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 11 Aug 2020 20:15:04 +0000 (UTC) Subject: Re: FreeBSD a server and bhyve To: Odhiambo Washington Cc: freebsd-virtualization@freebsd.org References: <1c1e71ea-9f4f-b4a6-c6bb-f7cd201c0182@gmx.at> From: Pete Wright Message-ID: <0acc82ba-4779-f006-7ece-a003d0d0759c@nomadlogic.org> Date: Tue, 11 Aug 2020 13:15:03 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Rspamd-Queue-Id: 4BR3wT5Ydpz40pD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of pete@nomadlogic.org designates 174.136.98.114 as permitted sender) smtp.mailfrom=pete@nomadlogic.org X-Spamd-Result: default: False [-2.47 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.001]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[nomadlogic.org]; NEURAL_HAM_MEDIUM(-0.88)[-0.879]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.29)[-0.293]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:25795, ipnet:174.136.96.0/20, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[23.243.161.111:received] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2020 20:15:06 -0000 On 8/11/20 12:38 PM, Odhiambo Washington wrote: > > > On Tue, 11 Aug 2020 at 20:23, Pete Wright > wrote: > > > > On 8/11/20 5:49 AM, Odhiambo Washington wrote: > > Hi infoomatic, > > > > Looks like I have to top-post so as to not mess the thread: > > > > The reason I need a VM is because I need to totally independent > host, > > with an independent name, with access to all ports of its own. > > It looks like I need another public IP for that. > > It depends on your use case.  I have a single IPv4 address > allocated to > one of my systems and have setup various CNAME entries in DNS that > all > resolve to the same IP.  I think that's a pretty common design > pattern > for people who colo their own servers and host multiple services > on them. > > the tricky part will be if you want to host multiple instances of the > same service though (multiple webservers for example).  in that case > you'll most likely need multiple IPv4 address assigned to your system. > > > That's exactly where I am. > Suppose I obtained another IP for the VM, how do I make the VM the > only host listening on that IP then? this should be pretty straight forward - the first step would be to setup the additional public IP's as virtual addresses on your NIC similar to this: https://www.freebsd.org/doc/handbook/configtuning-virtual-hosts.html then setting up your firewall (pf or ipfw) to forward requests coming in on one of those public IP's to the specific bhyve VM which is listening on a private IP.  this would be identical to hosting multiple services on a single IP. here's an example pf config that does the forwarding of SMTP on port 25 to a VM using a private IP to give you an idea of what the syntax would look like: rdr pass on $ext_if inet proto tcp from any to 1.2.3.4 port = 25 -> 10.1.0.10 port 25 hope this helps, -pete -- Pete Wright pete@nomadlogic.org @nomadlogicLA