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

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
AnBad
Posts: 30
Joined: Sat Jan 12, 2019 4:40 pm

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

Post by AnBad »

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!! :D :D

Kind regards.
User avatar
Joulinar
Posts: 5666
Joined: Sat Nov 16, 2019 12:49 am

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

Post by Joulinar »

hi,

many thanks for your message. Did you set your DietPi as Gateway on your client systems?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
trendy
Posts: 362
Joined: Tue Feb 25, 2020 2:54 pm

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

Post by trendy »

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.
AnBad
Posts: 30
Joined: Sat Jan 12, 2019 4:40 pm

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

Post by AnBad »

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.
User avatar
Joulinar
Posts: 5666
Joined: Sat Nov 16, 2019 12:49 am

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

Post by Joulinar »

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

Code: Select all

sysctl net.ipv4.ip_forward
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
trendy
Posts: 362
Joined: Tue Feb 25, 2020 2:54 pm

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

Post by trendy »

And the tunnel interface should masquerade the lan IPs of the hosts.
AnBad
Posts: 30
Joined: Sat Jan 12, 2019 4:40 pm

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

Post by AnBad »

Hello,

this was the result of

Code: Select all

sysctl net.ipv4.ip_forward

Code: Select all

net.ipv4.ip_forward = 0
I have changed it and its showing now:

Code: Select all

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!!
User avatar
Joulinar
Posts: 5666
Joined: Sat Nov 16, 2019 12:49 am

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

Post by Joulinar »

I don't think RPi is the problem. Probably a slow VPN connection?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
AnBad
Posts: 30
Joined: Sat Jan 12, 2019 4:40 pm

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

Post by AnBad »

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?
User avatar
trendy
Posts: 362
Joined: Tue Feb 25, 2020 2:54 pm

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

Post by trendy »

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