From nobody Sat May 04 19:22:00 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 4VWyGs1N42z5JRCx for ; Sat, 4 May 2024 19:22:13 +0000 (UTC) (envelope-from apoorv.99.sachan@gmail.com) Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) (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 4VWyGr4PPWz47jd for ; Sat, 4 May 2024 19:22:12 +0000 (UTC) (envelope-from apoorv.99.sachan@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qk1-x72a.google.com with SMTP id af79cd13be357-79291262dc2so39284885a.2 for ; Sat, 04 May 2024 12:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714850531; x=1715455331; 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=FIGWjL9vwp5eb1nOF+Z43EbKhGCERevbJsaFaXhEo9s=; b=k80cvzq9uJGwQonvtkzigHBGPRUYo9wJEFxtotLki75RSsqA006WEWOwfRhr+zvs7X lDwqT6MZ34zttxRroHiFOPGWZV97mScZofnfaMShsLHlLA1YvefzEV0+kCqc5OHvXXMM bU44+og9QA16mrOVAlN2j0n9gXo85l7gQ+DvT7gXqlVqH5eZlHzfKNb0ENUAe3rEjd7N pMw9qB7u44aez7UHayWQ2LRgh2OCRLA+WjuzQq5EZFiUE4n9xQ++tHsclkzERDbdDbV/ AGFJWfcbhqxgyR8iLiOMDL5NMnJTahiLBK1eQ1Dadv7P/ZbAs76JdL88rsTHZcgDSFvG XQLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714850531; x=1715455331; 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=FIGWjL9vwp5eb1nOF+Z43EbKhGCERevbJsaFaXhEo9s=; b=m5Ra939MDZU9QC5nMVOQw0cqoGVHPgM/taGHJCDrz8ck/TnTbeblpIKaUSb806usZj fbyzGpOgxPzf4SoBp166QajjNIUNJbnXZOM17n7yoq0MlcQ6cVXg+CjPrlVdQVyaAM+3 oas8lz7Vin442n42wsj1T0FYXesTIiDIBT4iXnvXCYkR1jtb04qjHzJR5lv3QKYo2F8b gmoTILstW4FABieny1OoOMHZbcp1K6/nzpa1ngldYFkl+ha5Z/Sn7wD+kCrcS2/Ovw95 uoRlT0yPsO75ay9TU8P1dWi0wQRJ9CV5ZD1JJpEwwSKuYaIERYnK6X/9QCb1HghCBH1f eiag== X-Gm-Message-State: AOJu0YwZd8MdLV1g8XgHtKxlyMfkjnzUe5ZjP2f5K3CNvdXTnacNEb+c Iqwl7xrNPgyBu9ycLFT2dGqUC+fCL8sgBtkpQiU65n0D+PIcgle0/ZdwYen5c1pA13K1DRi7U7p IwJ3qRFu4oQrV6qLThbIUgwdIfCw= X-Google-Smtp-Source: AGHT+IEOi5cfkWgNKyqubIARM48kXXeEQyvi9J/e37ltVCgqCOTU3ll2ikWa4vgL0vQz6+qYrk2t6d0/ujdBq3GZl5c= X-Received: by 2002:a05:6214:c84:b0:6a0:6167:9eab with SMTP id r4-20020a0562140c8400b006a061679eabmr8850964qvr.16.1714850531468; Sat, 04 May 2024 12:22:11 -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: Apoorv Sachan Date: Sun, 5 May 2024 00:52:00 +0530 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: Mario Marietto Cc: "freebsd-net@FreeBSD.org" Content-Type: multipart/alternative; boundary="000000000000c56cba0617a5c01a" 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)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4VWyGr4PPWz47jd --000000000000c56cba0617a5c01a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 assigned > 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 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 > 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 tap8= 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 addm= tap4 addm tap5 addm tap6 addm tap7 addm tap8 addm tap9 addm tap10 addm tap= 11 addm tap12 addm tap13 addm tap14 addm tap15 addm tap16 addm tap17 addm t= ap18 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 > --000000000000c56cba0617a5c01a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Mario=C2=A0

You can set the ip if the Ubuntu machine as the default route on = the freeBSD host.=C2=A0
This will take all the traff= ic oroginating in freeBSD host through the warp-tunnel.

And configure a DNAT iptables rule in the U= buntu machine to return the traffic back to freeBSD machine.=C2=A0

This way you could utilise the w= arp-cloud flare tunnel from the freeBSD host even though it runs on the Ubu= ntu guest. And both have different IPs.

On Sun, 5 May 2024 at 12:23=E2= =80=AFAM, Mario Marietto <mari= etto2008@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
--000000000000c56cba0617a5c01a--