i am new to computer networking so i thought i could get some practice on my home network.

i have 2 raspberry pi's in my lan network, and i am using the free tier EC2 instance from AWS.

RPi-1 is connected to the internet through my router. RPi-1 has PiVPN installed using the suggestion on the official website: curl -L https://install.pivpn.io | bash.

after generating the keys and uploading to the EC2 instance, i am able to successfully connect the EC2 instance to the vpn. when i run pivpn clients on RPi-1, the EC2 instance is listed as expected.

the problem:

i then tried the same procedure to connect RP-2, but it doesn't seem to connect. i have tried re generating the keys, but it still doesn't work.

i am able to ping RPi-1 from RPi-2 (and vice-versa), and the nodes are able to ping each other without any issue.

i'm very new to computer networks and i don't know how to debug this kind of problem. any help is appreciated.

update 1:

i am connecting to the vpn using the command: sudo openvpn --config <config_file.ovpn>. this works for the EC2 instance, but on RPi-2, i get the output:

➜ sudo openvpn --config pi-node00.ovpn 
Thu May 31 06:09:28 2018 OpenVPN 2.4.0 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 18 2017
Thu May 31 06:09:28 2018 library versions: OpenSSL 1.0.2l  25 May 2017, LZO 2.08
Enter Private Key Password: ***************************
Thu May 31 06:09:36 2018 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Thu May 31 06:09:36 2018 Outgoing Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Thu May 31 06:09:36 2018 Incoming Control Channel Authentication: Using 256 bit message hash 'SHA256' for HMAC authentication
Thu May 31 06:09:36 2018 TCP/UDP: Preserving recently used remote address: [AF_INET]<RPi-1 ip address>:1194
Thu May 31 06:09:36 2018 Socket Buffers: R=[163840->163840] S=[163840->163840]
Thu May 31 06:09:36 2018 UDP link local: (not bound)
Thu May 31 06:09:36 2018 UDP link remote: [AF_INET]<RPi-1 ip address>:1194

contents of rpi-2.ovpn file (modified for privacy):

dev tun
proto udp
remote <RPi-1 public ip address> 1194
resolv-retry infinite
key-direction 1
remote-cert-tls server
tls-version-min 1.2
verify-x509-name server_xxxxxxxx name
cipher AES-256-CBC
auth SHA256
verb 3
<some long hash>
<some long hash>
<some encryption metadata>
<some long hash>
# 2048 bit OpenVPN static key
-----BEGIN OpenVPN Static key V1-----
<some long hash>
-----END OpenVPN Static key V1-----
  • How do you think we may guess your configuration, network setup nor the error/symptom without logs, "It still doesn't work" doesn't bring anything, we can't help you with that. SE sites are not a good format for back and forth debugging session, head to a chat room, I think you'll have a better chance with superuser chat for this kind of talk, – Tensibai May 31 '18 at 7:37
  • sorry for the lack if debugging info. as i mentioned, i am new to the this entirely and i wouldn't know what piece of information to would be useful. i am a developer by profession, but i am new to networking in general. much of the terminology i have read online is new to me so it is hard for me to determine the correct search query to make in the search engine. i have updated the question with some information that may help. – X0r0N May 31 '18 at 21:20
  • Rpi1 and rpi2 are on the same Lan but you try to connect to the public up from rpi2, which mean rpi2 has to get to internet to get back on the public IP, modify your confg on rpi2 to use local address o Rpi1. I don't know how your network is setup, but most home router won't allow a loopback on themselves – Tensibai Jun 1 '18 at 4:50
  • This might be causing the issue. When I connect a device to the router, it is given a LAN address, but when I assign one for access through the internet, it’s LAN address is changed to the public IP address. This is displayed on the router admin panel and within the RPi-1. so it seems it is only available from the public ip address. – X0r0N Jun 1 '18 at 5:04
  • Yes, as your router can only direct traffic to one machine then, you need to find a proper tutorial about NAT and how to configure your router properly for that – Tensibai Jun 1 '18 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.