DietPi w/ VPN as Gateway for all Devices within the home network

Hello,

wouldnt it be nice to have a possibility to share the Raspberry as an VPN-Gateway for all Devices within in an Homenetwork? You see, TV, Mobilephone, Printer ect…

I use VPN/Surfshark. For me its impossible to config such a thing.

Thank you for everything!! :smiley: :smiley:

Kind regards.

hi,

many thanks for your message. Did you set your DietPi as Gateway on your client systems?

You can either setup the settings static and configure the RPi as gateway for the devices you wish, or create an advanced configuration for dhcp with dnsmasq (included in pihole or standalone), where you’ll be able to set the gateway per device individually.

Reading your Posts gives me the impression, that other Devices can use the Raspberry as Gateway by simply changing their IP4/Gateway configuration to the IP of the Raspberry, correct? I did this, but it didnt work out. What do I miss?

I think dhcp with dnsmasq is a good idea and I will try it out. But I would prefer that all my devices have the same Range for their IP-Adresses so that the devices can reach each other regardless one is using the Rasp as Gateway or the main router.

What would you recommend?

Thank you very much.

before going to change DHCP settings on the entire network, you would need to get one device running. Best to start with a computer where you can change easily the getaway IP pointing to your DietPi device. On DietPi the VPN needs to be active as well as IP forwarding. Can you check following. It should return 1

sysctl net.ipv4.ip_forward

And the tunnel interface should masquerade the lan IPs of the hosts.

Hello,

this was the result of

sysctl net.ipv4.ip_forward



net.ipv4.ip_forward = 0

I have changed it and its showing now:

net.ipv4.ip_forward = 1

I have changed in addition my IP4-Configurationen of my Ipad for a testrund to :

IP-Adress: like before
Mask: like before
Gateway: IP of Raspberry

Is this correct? Is there more to change? What is about IP6?

Nonetheless I think it might be working now. I could load a Webpage with my Ipad althought very slow? Is it because my old Rasp 3 is to slow?

Thank you very much for your help!!

Kind regards and happy new year!!

I don’t think RPi is the problem. Probably a slow VPN connection?

Hi,
no, I dont think so, I have tested the VPN to a fast server. Nonetheless it was slow.

Are you sure that this has nothing to do with the Rasp 3b+? Could the Raspberry 4 faster?

Maybe some configuration is not right at my Ipad or now tested Notebook?

You can run the htop while you are speedtesting to verify that cpu is not the bottleneck.