How can configure the Debian networking to allow Cloudflare to work on a static IP

Hello.

I want to be protected by Cloudflare using FreeBSD. What I did has been the creation of a qemu virtual machine with Debian inside,where I have installed Clouflare warp and I’ve configured it in a way that I can forward the connection to FreeBSD. In short terms,this is how I configured Debian :

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

and on FreeBSD :

ifconfig_em0="inet 192.168.1.5 
netmask 255.255.255.0" 
defaultrouter="192.168.1.8"

Now,there is a problem with this setup. Basically in Debian the /etc/network/interfaces is configured like this :

allow-hotplug enp0s2 
iface enp0s2 inet dhcp

the problem is that is is using dhcp and sometimes the assigned ip changes. If it changes,I can’t surf from FreeBSD anymore. I tried to use a static IP like this :

iface enp0s2 
inet static address 192.168.1.8

but doing like that,Cloudflare does not work anymore.

So,the question is : how can configure Cloudflare on a static IP instead of using dhcp.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.