From nobody Sat May 4 19:29:52 2024 X-Original-To: freebsd-net@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 4VWySR6D68z5JRkN for ; Sat, 4 May 2024 19:30:31 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) (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 4VWySQ6kxpz49lB for ; Sat, 4 May 2024 19:30:30 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b="IYt/ZcJ0"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of marietto2008@gmail.com designates 2607:f8b0:4864:20::52c as permitted sender) smtp.mailfrom=marietto2008@gmail.com Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-53fa455cd94so551453a12.2 for ; Sat, 04 May 2024 12:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714851029; x=1715455829; 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=R6j/RWb/+sHcegdIVpdQXgx9Wa9+I/L46P8k7GrPMJs=; b=IYt/ZcJ0byW7H2F58ZU4gpb23QR+PJfQk+BRWmSDdaFlIqnnCsEPwUx5S5a5Y3wytM lx7i3MA8fBAtY5HiKpFTNx3kN5GcEBUmAb8TEb78UJVLidDdUTSLs/PWWeKJp9Rai1ap zy+61ONKO3qudAMlPT4BY0eNH0H9eG1PTeTsjKQe2yTdULNkOP05TFI2dka6loIZMxrG e3ysEdV782a7djVdr9koebZSlF+WJNM2108csvDVypvJa/R9DvEioIPOUtknGYE57str vO8z9726Ywi5a3NFu4sqAUQeIq7LRmgu8DtasezcSKoW/bD1zTSEPCKsvCkZ4nAoYx6C EYcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714851029; x=1715455829; 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=R6j/RWb/+sHcegdIVpdQXgx9Wa9+I/L46P8k7GrPMJs=; b=pGFOe4KDL7fNfJwMOXIqa9hmJWaBoGbFarUF/zWyBEO09ZuPMgnT0YLKIXB3AwaAK1 47xN6mF9RBK86fZLZP13u8ZZK3lQU8M3IgTMgjs8Mud4U4I1IXrmUPOLp2I8BXQeN2e/ 5NZIX3vI9OcS0ONkXdupG24zYAYxXvpPvc5+57uy7MHvBbJBdyVVC3IN5BTwb4hsvbON tsSjouORBj0Hy5EXeiqEu+flbAeE1FSnMwoXocUVbSFibMeLPIJ1492l8+cOFXIM0GeN xsqrH77WUVVwtzceJsne644pXElJ8dSxHC/uWc1RyF3mC1dXx3oPslI+EeyVjavN9cRR vyWg== X-Gm-Message-State: AOJu0YxEql6x8Mew0sQ44Q7F5rvCIoDD9z2aQpDAytsJmhxsd/Pv5/4J G/DIBQMKl36LAzZGT5UFMxFw2DENFsBFAC8D3KUy/mWLY3h6pUgxaQgB9KkVC9+1rAwG5/C88u8 yXR3YHt4KMwIOzNRIwCplv6yXvA/SqrSBdFAOnDTR X-Google-Smtp-Source: AGHT+IGuThfY/SqbV/GI4JLqVfDEO/8qHavC8573RUWehRr6ym7coYZZTXBALIYkZ7LzAmkopniyqcXSKoYWJFUwm1s= X-Received: by 2002:a05:6a21:33a6:b0:1ac:4272:5f88 with SMTP id yy38-20020a056a2133a600b001ac42725f88mr6890900pzb.17.1714851029127; Sat, 04 May 2024 12:30:29 -0700 (PDT) List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: Mario Marietto Date: Sat, 4 May 2024 21:29:52 +0200 Message-ID: Subject: Re: How to configure the networking on FreeBSD to assign the same IP between host and guest in order to make work CloudFlare Warp on FreeBSD To: Apoorv Sachan Cc: "freebsd-net@FreeBSD.org" Content-Type: multipart/alternative; boundary="0000000000006f1f600617a5de8c" X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.53 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.53)[-0.530]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCPT_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_TO(0.00)[gmail.com]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; TAGGED_RCPT(0.00)[]; MLMMJ_DEST(0.00)[freebsd-net@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::52c:from] X-Rspamd-Queue-Id: 4VWySQ6kxpz49lB --0000000000006f1f600617a5de8c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable So. Please help me further... Let's say that the IP number assigned to Ubuntu is 192.168.1.9,on FreeBSD I do : /etc/rc.conf : defaultrouter=3D"192.168.1.9" ? even if the VM starts after the booting of FreeBSD ? About configuring the DNAT iptables rule I have no idea. Please help me to understand how to do it. On Sat, May 4, 2024 at 9:22=E2=80=AFPM Apoorv Sachan wrote: > Hi Mario > > You can set the ip if the Ubuntu machine as the default route on the > freeBSD host. > This will take all the traffic oroginating in freeBSD host through the > warp-tunnel. > > And configure a DNAT iptables rule in the Ubuntu machine to return the > traffic back to freeBSD machine. > > This way you could utilise the warp-cloud flare tunnel from the freeBSD > host even though it runs on the Ubuntu guest. And both have different IPs= . > > On Sun, 5 May 2024 at 12:23=E2=80=AFAM, Mario Marietto > wrote: > >> Hello. >> >> I've just installed the CloudFlare client + GUI on Ubuntu,that I have >> virtualized with bhyve. Cloudflare does not work on FreeBSD. The >> instructions that I have followed are located here : >> >> https://youtu.be/4JuOUjCSj44 >> >> Installing it in this way,it will run only on the IP assigned to Ubuntu >> inside the VM. For me the IP of FreeBSD is different from the IP assigne= d >> to Ubuntu. Configured in this way it's not useful. >> >> I want Cloudflare to take the IP address of FreeBSD. >> >> To achieve this goal,I should change my network configuration,in a way >> that I use the same IP for FreeBSD and Ubuntu. >> >> That's what I want to do,but I don't know how to do it. But I'm sure tha= t >> I will be able to do it if someone can give me some advice. >> >> I can explain how I have configured my network,so you can explain what I >> should change to have the same IP. >> >> For example,to boot Ubuntu with bhyve,I use the following parameter : >> >> -s 13,virtio-net,tap19 \ >> >> >> /etc/rc.conf : >> >> ifconfig_em0=3D"DHCP" >> local_unbound_enable=3D"YES" >> cloned_interfaces=3D"bridge0 tap0 tap1 tap2 tap3 tap4 tap5 tap6 tap7 tap= 8 tap9 tap10 tap11 tap12 tap13 tap14 tap15 tap16 tap17 tap18 tap19 tap20 em= 0" >> ifconfig_bridge0=3D"addm em0 addm tap0 addm tap1 addm tap2 addm tap3 add= m tap4 addm tap5 addm tap6 addm tap7 addm tap8 addm tap9 addm tap10 addm ta= p11 addm tap12 addm tap13 addm tap14 addm tap15 addm tap16 addm tap17 addm = tap18 addm tap19 addm tap20" >> >> >> /boot/loader.conf >> >> if_tap_load=3D"YES" >> if_bridge_load=3D"YES" >> bridgestp_load=3D"YES" >> >> >> /etc/sysctl.conf >> >> net.link.tap.up_on_open=3D1 >> net.inet.ip.forwarding=3D1 >> net.inet.ip.random_id=3D1 >> >> >> So,ok. I think you have understood what I want to do. Please help me. >> Thanks. >> >> -- >> Mario >> > --=20 Mario. --0000000000006f1f600617a5de8c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
So. Please help me further...

Let's say that the IP number assigned to Ubuntu is 192.168.1.9,on Fre= eBSD I do :

/etc/rc.conf :

defaultrouter=3D"192.168.1.9"

? even i= f the VM starts after the booting of FreeBSD ?

About configuring the DNAT iptables rule I have no idea. Please help me t= o understand how to do it.

<= div dir=3D"ltr" class=3D"gmail_attr">On Sat, May 4, 2024 at 9:22=E2=80=AFPM= Apoorv Sachan <apoorv.99.= sachan@gmail.com> wrote:
Hi Mario=C2=A0
You can set the ip if the Ubuntu machine as the de= fault route on the freeBSD host.=C2=A0
This will tak= e all the traffic oroginating in freeBSD host through the warp-tunnel.

And configure a DNAT iptable= s rule in the Ubuntu machine to return the traffic back to freeBSD machine.= =C2=A0

This way you coul= d utilise the warp-cloud flare tunnel from the freeBSD host even though it = runs on the Ubuntu guest. And both have different IPs.

On Sun, 5 May 20= 24 at 12:23=E2=80=AFAM, Mario Marietto <marietto2008@gmail.com> wrote:
=
Hello.
I've just installed the CloudFlare client + GUI on Ubuntu,that I have= =20 virtualized with bhyve. Cloudflare does not work on FreeBSD. The=20 instructions that I have followed are located here :

https://youtu= .be/4JuOUjCSj44

Installing it in this way,it w= ill run only on the IP assigned to Ubuntu=20 inside the VM. For me the IP of FreeBSD is different from the IP=20 assigned to Ubuntu. Configured in this way it's not useful.=C2=A0
=

I want Cloudflare to take the IP address of FreeBSD.

To achieve this goal,I should change my network configuration,in a way that= I use the same IP for FreeBSD and Ubuntu.

That's what I want to do,but I don't know= how to do it. But I'm sure=20 that I will be able to do it if someone can give me some advice.
=

I can explain how I have configured my network,so you can explain what I sh= ould change to have the same IP.

For example,to boot Ubuntu with bhyve,I use the following parameter :

=09 =09
=09
-s 13,virtio-net,tap19 \

/etc/rc.conf :
=09 =09
=09
ifconfig_em0=3D"DHCP"
local_unbound_enable=3D"YES"
cloned_interfaces=3D"bridge0 tap0 tap1 tap2 tap3 tap4 tap5 tap6 tap7 t=
ap8 tap9 tap10 tap11 tap12 tap13 tap14 tap15 tap16 tap17 tap18 tap19 tap20 =
em0"
ifconfig_bridge0=3D"addm em0 addm tap0 addm tap1 addm tap2 addm tap3 a=
ddm tap4 addm tap5 addm tap6 addm tap7 addm tap8 addm tap9 addm tap10 addm =
tap11 addm tap12 addm tap13 addm tap14 addm tap15 addm tap16 addm tap17 add=
m tap18 addm tap19 addm tap20"

/boot/loader.conf
=09 =09
=09
if_tap_load=3D"YES"
if_bridge_load=3D"YES"
bridgestp_load=3D"YES"

/etc/sysctl.conf
=09 =09
=09
net.link.tap.up_on_open=3D1
net.inet.ip.forwarding=3D1
net.inet.ip.random_id=3D1

So,ok. I think you have understood what I want to do. Please help me. Thank= s.

-= -
Mario


--
Mario.
--0000000000006f1f600617a5de8c--