PiVPN - possible to connect, but no internet Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
JohnDoeFR
Posts: 29
Joined: Tue Sep 22, 2020 6:04 pm

Re: PiVPN - possible to connect, but no internet

Post by JohnDoeFR »

Yes, I've removed the OpenVPN server with the Dietpi-software.

Run : dietpi-software reinstall 171, it's okay, NordVPN is there again after the installation and reboot. But same problem with the connectivity :?
User avatar
Joulinar
Posts: 2300
Joined: Sat Nov 16, 2019 12:49 am

Re: PiVPN - possible to connect, but no internet

Post by Joulinar »

pls can you check again 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
JohnDoeFR
Posts: 29
Joined: Tue Sep 22, 2020 6:04 pm

Re: PiVPN - possible to connect, but no internet

Post by JohnDoeFR »

I've just unplug and plug it back, PiHole went online, I tried with Dietpi-nordvpn, it connected and now is it WORKING for all my LAN ! :D Awesome, I don't know what happened between the second reboot but yeah, it works for now.

Thank you very much ! And if you want some log to help other, I'm glad to gave them.

And yes
sysctl net.ipv4.ip_forward
still give me
1
User avatar
Joulinar
Posts: 2300
Joined: Sat Nov 16, 2019 12:49 am

Re: PiVPN - possible to connect, but no internet

Post by Joulinar »

ok perfect that it is working now.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
JohnDoeFR
Posts: 29
Joined: Tue Sep 22, 2020 6:04 pm

Re: PiVPN - possible to connect, but no internet

Post by JohnDoeFR »

Hello,

In term of routing since we modified it, if I implement NextCloud via Dietpi will it work with the VPN on ?

Thanks
User avatar
Joulinar
Posts: 2300
Joined: Sat Nov 16, 2019 12:49 am

Re: PiVPN - possible to connect, but no internet

Post by Joulinar »

Hi,

well you could have it installed but it might have issues to access from Internet. Because traffic will arrive on normal network but will be send back to VPN. And this is not gonna work. That would be similar like this viewtopic.php?f=11&t=8056

I guess you would need to setup some iptables rules in addition to route the traffic correct way. But I'm not the expert on this. Usually @trendy has some ideas :)
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: 133
Joined: Tue Feb 25, 2020 2:54 pm

Re: PiVPN - possible to connect, but no internet

Post by trendy »

If you can identify the tcp/udp ports the application uses, you can mark the packets in iptables mangle chain, then create an ip rule to route the packets with those markings from a different routing table, and finally create a custom routing table which will route via the ISP.
JohnDoeFR
Posts: 29
Joined: Tue Sep 22, 2020 6:04 pm

Re: PiVPN - possible to connect, but no internet

Post by JohnDoeFR »

Thanks to you two, I'm going to learn about iptable because I don't have to skill to manage it at the moment :(
User avatar
Joulinar
Posts: 2300
Joined: Sat Nov 16, 2019 12:49 am

Re: PiVPN - possible to connect, but no internet

Post by Joulinar »

@trendy would be port 80/443 tcp as it's a webserver
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: 133
Joined: Tue Feb 25, 2020 2:54 pm

Re: PiVPN - possible to connect, but no internet

Post by trendy »

Something like this then:

Code: Select all

iptables -t mangle -I PREROUTING -s 192.168.123.123 -p tcp -m multiport --sports 80,443 -j MARK --set-mark 10
ip rule add fwmark 10 table 10
ip route add default via ISP_GATEWAY_IP_HERE table 10
The first and second lines could be combined into

Code: Select all

ip rule add from 192.168.123.123/32 sport 80 table 10
ip rule add from 192.168.123.123/32 sport 443 table 10
Post Reply