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

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 :


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 than the IP assigned to Ubuntu. Configured in this way it's not useful. I want that Cloudfare takes 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 advices.
I can explain how I have configured my network,so you can explain what should I change to have the same IP.

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

Code:
-s 13,virtio-net,tap19 \

/etc/rc.conf :

Code:
ifconfig_em0="DHCP"

local_unbound_enable="YES"

cloned_interfaces="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="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 tap11 addm tap12 addm tap13 addm tap14 addm tap15 addm tap16 addm tap17 addm tap18 addm tap19 addm tap20"


/boot/loader.conf

Code:
if_tap_load="YES"
if_bridge_load="YES"
bridgestp_load="YES"


/etc/sysctl.conf

Code:
net.link.tap.up_on_open=1
net.inet.ip.forwarding=1
net.inet.ip.random_id=1


So,ok. I think you have understood what I want to do. Please help me. Thanks.
 
This is what I did :

on FreeBSD :

/etc/rc.conf :

ifconfig_em0="inet 192.168.1.5 netmask 255.255.255.0"
defaultrouter="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 ? that I'm able to connect to Ubuntu,but on FreeBSD I can't surf.
 
Using this script :

Code:
warp-cli disconnect
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A POSTROUTING -t nat -s 192.168.1.5 -j MASQUERADE
warp-cli connect

I can go in Internet in FreeBSD,but not in the Ubuntu vm.
 
Back
Top