From nobody Sun May 5 07:20:54 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 4VXGDs6C1Cz5JG7C for ; Sun, 05 May 2024 07:21:33 +0000 (UTC) (envelope-from marietto2008@gmail.com) Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) (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 4VXGDr2NnRz43mV for ; Sun, 5 May 2024 07:21:32 +0000 (UTC) (envelope-from marietto2008@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=m0gByuy3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of marietto2008@gmail.com designates 2607:f8b0:4864:20::533 as permitted sender) smtp.mailfrom=marietto2008@gmail.com Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-61eba9f9c5dso754978a12.0 for ; Sun, 05 May 2024 00:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714893690; x=1715498490; 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=Ic+cqiiFqZ9gAk06V57xilVArxOWLRd9oTXdtwlAEbM=; b=m0gByuy3e8t8jJI21m9sSHnpgBvJ/tou9639t4Td2sQWG/NK8Ru0KbqO8mKSiUuR41 fCIm4I4YWQ1+SS4k7jPRcRjqt+yeIvTHcPOhK7rnqiouFv67TS498YJhy9aCNsvOKn4b HbkgoTzzlxS3JBSkkOMKcLjLvrdWnCZKRWRBK0VpeZRGeTMtX5RcCibl0JjT7b3xIgUm 5YEsFjXVInyqynAcReNGKVREQsOW8cPfo8qH5Uzk/GMO2VZJmzKJrc7CCh7R+LffDSpg wXJh+3lEkKHKPbDj3ksTgPUnSpFoQVae6o2ApXKM0NVgOx9R5npm44espGF1DTjuXeOQ DdSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714893690; x=1715498490; 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=Ic+cqiiFqZ9gAk06V57xilVArxOWLRd9oTXdtwlAEbM=; b=KFsQZvdoTPUKac/6lI/OU0yMjglm+KhrrBRP+/Es2sWlA+AkEBfCIBQY2V9I+2mXA1 Yij9DXJ9PY0+n7xd6/vKl3sBSV6BGe6rZJaFl/dmahTevfd8K8c6qXuFHSbcoz7Xsin8 EliX3rxH3ZLASZ3TEnxUi0ndWPkECGh4caRAjxg0m1Z4UT4myQDmkBawvbYIh/vVeVOP I0xV4jMUrRqp0+7cdHpkk4L9Nf2W6iBZoPjMCr1aEWde5CxiTarqwy/bcEm5ABOHF8Lc WNmYge0huUspJ5WlUb9qGH8I6WOL89at6DuI7lI+4toBWuWUiaADa08HMs4pt+mL7CmW v+Gw== X-Gm-Message-State: AOJu0YzMe2rMuyJhkhclvEOg6Pot6mwZ5u6wxzLpQWA+JOlvWqExSupl 7CvnLUmVoZfGZ0XIk+SUexpefse/ACXwJjFPdhavl++7uxFTTGTbc8qPOL2pj8QQL0MXenuctfR xflKHk/2yOCWIWPFJ0U1gEOkYaUPn5F218B0h8w== X-Google-Smtp-Source: AGHT+IFSXUKbMx9aiYN+NOOsNpEnAUs8ynYYKvkiCUT13HYAktQnHcdLKt+adPQgHDr81+UDzB5FaTLsVU/uK2salaw= X-Received: by 2002:a05:6a21:788b:b0:1af:3cb3:a744 with SMTP id bf11-20020a056a21788b00b001af3cb3a744mr8168689pzc.6.1714893690391; Sun, 05 May 2024 00:21:30 -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: Sun, 5 May 2024 09:20:54 +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="0000000000003e57d40617afcd5a" X-Spamd-Bar: --- X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; 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::533:from] X-Rspamd-Queue-Id: 4VXGDr2NnRz43mV --0000000000003e57d40617afcd5a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable This is what I did : on FreeBSD : /etc/rc.conf : ifconfig_em0=3D"inet 192.168.1.5 netmask 255.255.255.0" defaultrouter=3D"192.168.1.10" On Ubuntu : echo 1 > /proc/sys/net/ipv4/ip_forward iptables -A PREROUTING -t nat -p tcp -d 192.168.1.10 -j DNAT --to-destination 192.168.1.5 iptables -A POSTROUTING -t nat -o enp0s13 -j MASQUERADE warp-cli connect What's the problem ? I'm able to connect to Ubuntu,but on FreeBSD I can't surf. On Sat, May 4, 2024 at 9:29=E2=80=AFPM Mario Marietto wrote: > 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 t= o > 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 IP= s. >> >> 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 assign= ed >>> 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 ta= p8 tap9 tap10 tap11 tap12 tap13 tap14 tap15 tap16 tap17 tap18 tap19 tap20 e= m0" >>> ifconfig_bridge0=3D"addm em0 addm tap0 addm tap1 addm tap2 addm tap3 ad= dm tap4 addm tap5 addm tap6 addm tap7 addm tap8 addm tap9 addm tap10 addm t= ap11 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 >>> >> > > -- > Mario. > --=20 Mario. --0000000000003e57d40617afcd5a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
=09 =09 =09 =09 =09
=09
This is what I did :

on FreeBSD :

/etc/rc.conf :

ifconfig_em0=3D"inet 192.168.1.5 netmask 255.255.255.0"
defaultrouter=3D"192.168.1.10"

On Ubuntu :

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A PREROUTING -t nat -p tcp -d 192.168.1.10 -j DNAT --to-destinati= on 192.168.1.5
iptables -A POSTROUTING -t nat -o enp0s13 -j MASQUERADE
warp-cli connect

What's the problem ? I'm able to connect to Ubuntu,but on FreeBSD I= can't surf.

On Sat, May 4, 2024 at 9:29=E2=80=AFPM Ma= rio Marietto <marietto2008@gma= il.com> wrote:
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 hel= p me to understand how to do it.

On Sat, May 4, 2024 at 9:22=E2= =80=AFPM Apoorv Sachan <apoorv.99.sachan@gmail.com> wrote:
Hi Mario=C2=A0<= /div>

You can set the ip if th= e Ubuntu machine as the default route on the freeBSD host.=C2=A0
This will take all the traffic oroginating in freeBSD host thr= ough the warp-tunnel.

An= d configure a DNAT iptables rule in the Ubuntu machine to return the traffi= c back to freeBSD machine.=C2=A0

This way you could utilise the warp-cloud flare tunnel from the f= reeBSD host even though it runs on the Ubuntu guest. And both have differen= t IPs.

On Sun, 5 May 2024 at 12:23=E2=80=AFAM, Mario Marietto <marietto2008@gmail.c= om> 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.


--
Mario.
--0000000000003e57d40617afcd5a--