I installed pivpn on my Pi3 with no issues. Works great and I’m able to configure and connect from my Linux Kubuntu PC with no issues.
I’m a complete newbie regarding VPNs and networking. All I did was generate the config file from pivpn and copy the data to the KDE Network MAnager with some help from the internet.
As I said everything seems to work at a basic level. I am connected and if I visit whatismyip.com I get the same IP as my RPi.
The next step would be to be able to see and mount the files residing on my NAS at home, but I can’t even ping it, which I think makes sense since my NAS and RP1 have 192.168.1.* addresses, while my VPN PC has a 10...* address and so is in a separate network.
Is there a way I can be in the same network as my NAS and RPi? Should I edit something on my PC side or do I also have to change something on the RPi/server side?
This is my conf file for reference. I created it basicallly giving all default answers.
[Interface]
PrivateKey = myPrivateKey
Address = 10.my.client.address/24
DNS = x.x.x.x
dietpi@DietPi:~$ ip -4 addr; ip -4 ro list table all; ip -4 ru; iptables-save
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
inet 192.168.1.7/24 brd 192.168.1.255 scope global dynamic eth0
valid_lft 3239sec preferred_lft 3239sec
3: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
inet 10.205.139.1/24 scope global wg0
valid_lft forever preferred_lft forever
4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
default via 192.168.1.1 dev eth0
10.205.139.0/24 dev wg0 proto kernel scope link src 10.205.139.1
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.7
local 10.205.139.1 dev wg0 table local proto kernel scope host src 10.205.139.1
broadcast 10.205.139.255 dev wg0 table local proto kernel scope link src 10.205.139.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
local 172.17.0.1 dev docker0 table local proto kernel scope host src 172.17.0.1
broadcast 172.17.255.255 dev docker0 table local proto kernel scope link src 172.17.0.1
local 192.168.1.7 dev eth0 table local proto kernel scope host src 192.168.1.7
broadcast 192.168.1.255 dev eth0 table local proto kernel scope link src 192.168.1.7
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
-bash: iptables-save: command not found
The NAS address is 192.168.1.9.
BTW, I did some more experimenting and I found out that I had to add a Google DNS in order to be able to surf the internet while connected to the VPN. Could it be a DNS issue?
I paste here the VPN. configuration of my Client PC. All data is from the dietvpn generated conf file.
When I wrote the last message I was doing the test from office, and I didn’t know that in the meantime there had been a power outage in my home so the Pi got back up, while the NAS stayed down. That’s why even after the command I could not ping it.
I tried now and now everything is working perfectly.
dietpi@DietPi:~$ sudo apt-get install iptables-persistent
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
iptables-persistent is already the newest version (1.0.15).