Skip to main content
Added 04-eth.network file
Source Link
Agustin
  • 146
  • 12
dev tun
ifconfig 10.8.0.1 10.8.0.2
secret static.key
cipher AES-256-CBC
auth-nocache
route 192.168.50.1 255.255.255.0

This is the 04-eth.network file on the server:

[Match]
Name=e*
[Network]
Address=10.10.10.83/24
Gateway=10.10.10.1
DNS=84.200.69.80 1.1.1.1
IPForward=yes

                    
dev tun
ifconfig 10.8.0.1 10.8.0.2
secret static.key
cipher AES-256-CBC
auth-nocache
route 192.168.50.1 255.255.255.0


                    
dev tun
ifconfig 10.8.0.1 10.8.0.2
secret static.key
cipher AES-256-CBC
auth-nocache
route 192.168.50.1 255.255.255.0

This is the 04-eth.network file on the server:

[Match]
Name=e*
[Network]
Address=10.10.10.83/24
Gateway=10.10.10.1
DNS=84.200.69.80 1.1.1.1
IPForward=yes

                    
added 729 characters in body
Source Link
Agustin
  • 146
  • 12
  • Once connected to the OpenVPN-pi, all devices connected to the hotspot-pi loose internet access. -> no longer an issue
  • piHotspot can ping 10.8.0.1(PiVPNServer) ONLY, PiVPNServer can ping 10.8ANYONE in the PiHotspot network.0 ONLY VPNServer can ping attached devices to the client's network.2(piHotspot) only, no pinging any other device in their subnets I still can't ping from server's network's devices
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:fa:a5:b9 brd ff:ff:ff:ff:ff:ff
inet 10.10.10.83/24 brd 10.10.10.255 scope global eth0
   valid_lft forever preferred_lft forever
inet6 fe80::ba27:ebff:fefa:a5b9/64 scope link 
   valid_lft forever preferred_lft forever
34: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none 
inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0
   valid_lft forever preferred_lft forever
inet6 fe80::a40bc367:6a3682ee:2641948:c63d743b/64 scope link stable-privacy 
   valid_lft forever preferred_lft forever
default via 10.10.10.1 dev eth0 proto static 
10.8.0.2 dev tun0 proto kernel scope link src 10.8.0.1 
10.10.10.0/24 dev eth0 proto kernel scope link src 10.10.10.83 
192.168.50.0/24 via 10.8.0.2 dev tun0  
                                                        
[email protected] - OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since WedThu 2019-11-20 21 23:4113:3832 EST; 10min1min 48s ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Main PID: 3291750 (openvpn)
Status: "Initialization"Pre-connection Sequenceinitialization Completed"successful"
Tasks: 1 (limit: 2200)
Memory: 21.5M0M
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─329└─1750 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/seserver.status 10 --cd /etc/openvpn --config /etc/openvpn/server.conf --writepid /run/openvpn/server.pid

Nov 20 21 23:4113:3832 PiVPNServer ovpn-server[329]server[1750]: TUN/TAPdisabling deviceNCP tun0mode opened(--ncp-disable) because not in P2MP client or server mode
Nov 20 21 23:4113:3832 PiVPNServer ovpn-server[329]server[1750]: /sbin/ipOpenVPN link2.4.7 setarm-unknown-linux-gnueabihf dev[SSL tun0(OpenSSL)] up[LZO] mtu[LZ4] 
Nov[EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Feb 20 2019
Nov 21 23:4113:3832 PiVPNServer ovpn-server[329]systemd[1]: /sbin/ip addr addStarted devOpenVPN tun0connection localto 1server.
Nov 20 21 23:4113:3832 PiVPNServer openvpn[329]ovpn-server[1750]: Errorlibrary versions: InvalidOpenSSL prefix1.1.1d for given10 prefixSep 2019, LZO 2.10
Nov 20 21 23:4113:3832 PiVPNServer ovpn-server[329]: ERRORserver[1750]: Linux routeTUN/TAP adddevice commandtun0 faiopened
Nov 20 21 23:4113:3832 PiVPNServer ovpn-server[329]server[1750]: Could/sbin/ip notlink determineset IPv4/IPv6dev prottun0 up mtu 1500
Nov 20 21 23:4113:3832 PiVPNServer ovpn-server[329]server[1750]: UDPv4/sbin/ip linkaddr add dev tun0 local (bound):10.8.0.1 [AF_INETpeer 10.8.0.2
Nov 20 21 23:4113:3832 PiVPNServer ovpn-server[329]server[1750]: UDPv4Could linknot remote:determine [AF_UNSPEC]IPv4/IPv6 protocol. Using AF_INET
Nov 20 21 23:4313:5332 PiVPNServer ovpn-server[329]server[1750]: PeerUDPv4 Connectionlink Initiatedlocal with(bound): [AF[AF_INET][undef]:1194
Nov 20 21 23:4313:5432 PiVPNServer ovpn-server[329]server[1750]: InitializationUDPv4 Sequencelink Completedremote: [AF_UNSPEC]
[email protected] - OpenVPN connection to piHotspot
Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since WedThu 2019-11-20 21 23:4120:2513 EST; 16min7s ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Process: 290739 ExecStart=/usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /etc/openvpn --config /etc/openvpn/piHotspot.conf --writepid /run/openvpn/piHotspot.pid (code=exited, status=0/SUCCESS)
Main PID: 323740 (openvpn)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─323└─740 /usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /etc/openvpn --config /etc/openvpn/piHotspot.conf --writepid /run/openvpn/piHotspot.pidopen

Nov 20 21 23:4220:0513 RPiNet ovpn-piHotspot[323]systemd[1]: write UDP:Starting NetworkOpenVPN isconnection unreachableto (code=101)piHotspot...
Nov 20 21 23:4220:1513 RPiNet ovpn-piHotspot[323]systemd[1]: write UDP:Started NetworkOpenVPN isconnection unreachableto (code=101)piHotspot.
Nov 20 21 23:4220:2513 RPiNet ovpn-piHotspot[323]: write UDPpiHotspot[740]: NetworkTUN/TAP isdevice unreachabletun0 (code=101)opened
Nov 20 21 23:4220:3613 RPiNet ovpn-piHotspot[323]: write UDPpiHotspot[740]: Network is unreachabledo_ifconfig, (code=101)tt->did_ifconfig_ipv6_setup=0
Nov 20 21 23:4220:4613 RPiNet ovpn-piHotspot[323]piHotspot[740]: write/sbin/ip UDP:link Networkset isdev unreachabletun0 (code=101)up mtu 1500
Nov 20 21 23:4220:5613 RPiNet ovpn-piHotspot[323]piHotspot[740]: write/sbin/ip UDP:addr Networkadd isdev unreachabletun0 (code=101)local 10.8.0.2 peer 10.8.0.1
Nov 20 21 23:4320:0713 RPiNet ovpn-piHotspot[323]piHotspot[740]: write TCP/UDP: Network is unreachable (code=101)
Nov 20 21:43:17Preserving RPiNetrecently ovpn-piHotspot[323]:used writeremote UDPaddress: Network is[AF_INET][My unreachableIP (code=101)Address]
Nov 20 21 23:4320:4513 RPiNet ovpn-piHotspot[323]piHotspot[740]: Peer ConnectionUDP Initiatedlink withlocal [AF_INET](MY.IP.ADDR.ESSbound): [AF_INET][undef]:1194
Nov 20 21 23:4320:4513 RPiNet ovpn-piHotspot[323]piHotspot[740]: InitializationUDP Sequencelink Completedremote: [AF_INET][My IP Address]:1194

Update: Nov 2021, 2019

I am able to ping server and client from each other using the 10.8.0.0 subnets (10.8.0.1 10.8.0.2), But now.

I have lostgained the ability to ping other devices in each other's networksfrom the VPNServer to any device attached to the VPNClient (PiHotspot).

I have gained the ability to ssh to the VPNClient's attached devices and control them

I cannot ping from devices in the Client or the Client itself to the attached devices in the server's side, I can only ping the server.

This is my server.conf before the error. Once I changed the 192.168.50.1 to 192.168.50.0, I became a step closer to a finished result :)

dev tun
ifconfig 10.8.0.1 10.8.0.2
secret static.key
cipher AES-256-CBC
auth-nocache
route 192.168.50.1 255.255.255.0


                    
  • Once connected to the OpenVPN-pi, all devices connected to the hotspot-pi loose internet access. -> no longer an issue
  • piHotspot can ping 10.8.0.1(PiVPNServer), PiVPNServer can ping 10.8.0.2(piHotspot) only, no pinging any other device in their subnets
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:fa:a5:b9 brd ff:ff:ff:ff:ff:ff
inet 10.10.10.83/24 brd 10.10.10.255 scope global eth0
   valid_lft forever preferred_lft forever
inet6 fe80::ba27:ebff:fefa:a5b9/64 scope link 
   valid_lft forever preferred_lft forever
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none 
inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0
   valid_lft forever preferred_lft forever
inet6 fe80::a40b:6a36:264:c63d/64 scope link stable-privacy 
   valid_lft forever preferred_lft forever
default via 10.10.10.1 dev eth0 proto static 
10.8.0.2 dev tun0 proto kernel scope link src 10.8.0.1 
10.10.10.0/24 dev eth0 proto kernel scope link src 10.10.10.83 
                                                        
[email protected] - OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset:
Active: active (running) since Wed 2019-11-20 21:41:38 EST; 10min ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Main PID: 329 (openvpn)
Status: "Initialization Sequence Completed"
Tasks: 1 (limit: 2200)
Memory: 2.5M
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─329 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/se

Nov 20 21:41:38 PiVPNServer ovpn-server[329]: TUN/TAP device tun0 opened
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: /sbin/ip link set dev tun0 up mtu 
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: /sbin/ip addr add dev tun0 local 1
Nov 20 21:41:38 PiVPNServer openvpn[329]: Error: Invalid prefix for given prefix
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: ERROR: Linux route add command fai
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: Could not determine IPv4/IPv6 prot
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: UDPv4 link local (bound): [AF_INET
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: UDPv4 link remote: [AF_UNSPEC]
Nov 20 21:43:53 PiVPNServer ovpn-server[329]: Peer Connection Initiated with [AF
Nov 20 21:43:54 PiVPNServer ovpn-server[329]: Initialization Sequence Completed
[email protected] - OpenVPN connection to piHotspot
Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-11-20 21:41:25 EST; 16min ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Process: 290 ExecStart=/usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /etc/openvpn --config /etc/openvpn/piHotspot.conf --writepid /run/openvpn/piHotspot.pid (code=exited, status=0/SUCCESS)
Main PID: 323 (openvpn)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─323 /usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /etc/openvpn --config /etc/openvpn/piHotspot.conf --writepid /run/openvpn/piHotspot.pid

Nov 20 21:42:05 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:42:15 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:42:25 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:42:36 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:42:46 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:42:56 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:43:07 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:43:17 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:43:45 RPiNet ovpn-piHotspot[323]: Peer Connection Initiated with [AF_INET](MY.IP.ADDR.ESS):1194
Nov 20 21:43:45 RPiNet ovpn-piHotspot[323]: Initialization Sequence Completed

Update: Nov 20, 2019

I am able to ping server and client from each other using the 10.8.0.0 subnets (10.8.0.1 10.8.0.2), But now I have lost the ability to ping other devices in each other's networks.

  • Once connected to the OpenVPN-pi, all devices connected to the hotspot-pi loose internet access. -> no longer an issue
  • piHotspot can ping 10.8.0.1(PiVPNServer) ONLY, PiVPNServer can ping ANYONE in the PiHotspot network. ONLY VPNServer can ping attached devices to the client's network. I still can't ping from server's network's devices
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:fa:a5:b9 brd ff:ff:ff:ff:ff:ff
inet 10.10.10.83/24 brd 10.10.10.255 scope global eth0
   valid_lft forever preferred_lft forever
inet6 fe80::ba27:ebff:fefa:a5b9/64 scope link 
   valid_lft forever preferred_lft forever
4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none 
inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0
   valid_lft forever preferred_lft forever
inet6 fe80::c367:82ee:1948:743b/64 scope link stable-privacy 
   valid_lft forever preferred_lft forever
default via 10.10.10.1 dev eth0 proto static 
10.8.0.2 dev tun0 proto kernel scope link src 10.8.0.1 
10.10.10.0/24 dev eth0 proto kernel scope link src 10.10.10.83 
192.168.50.0/24 via 10.8.0.2 dev tun0  
                                                        
[email protected] - OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-11-21 23:13:32 EST; 1min 48s ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Main PID: 1750 (openvpn)
Status: "Pre-connection initialization successful"
Tasks: 1 (limit: 2200)
Memory: 1.0M
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─1750 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/server.status 10 --cd /etc/openvpn --config /etc/openvpn/server.conf --writepid /run/openvpn/server.pid

Nov 21 23:13:32 PiVPNServer ovpn-server[1750]: disabling NCP mode (--ncp-disable) because not in P2MP client or server mode
Nov 21 23:13:32 PiVPNServer ovpn-server[1750]: OpenVPN 2.4.7 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Feb 20 2019
Nov 21 23:13:32 PiVPNServer systemd[1]: Started OpenVPN connection to server.
Nov 21 23:13:32 PiVPNServer ovpn-server[1750]: library versions: OpenSSL 1.1.1d  10 Sep 2019, LZO 2.10
Nov 21 23:13:32 PiVPNServer ovpn-server[1750]: TUN/TAP device tun0 opened
Nov 21 23:13:32 PiVPNServer ovpn-server[1750]: /sbin/ip link set dev tun0 up mtu 1500
Nov 21 23:13:32 PiVPNServer ovpn-server[1750]: /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Nov 21 23:13:32 PiVPNServer ovpn-server[1750]: Could not determine IPv4/IPv6 protocol. Using AF_INET
Nov 21 23:13:32 PiVPNServer ovpn-server[1750]: UDPv4 link local (bound): [AF_INET][undef]:1194
Nov 21 23:13:32 PiVPNServer ovpn-server[1750]: UDPv4 link remote: [AF_UNSPEC]
[email protected] - OpenVPN connection to piHotspot
Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-11-21 23:20:13 EST; 7s ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Process: 739 ExecStart=/usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /
Main PID: 740 (openvpn)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─740 /usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /etc/open

Nov 21 23:20:13 RPiNet systemd[1]: Starting OpenVPN connection to piHotspot...
Nov 21 23:20:13 RPiNet systemd[1]: Started OpenVPN connection to piHotspot.
Nov 21 23:20:13 RPiNet ovpn-piHotspot[740]: TUN/TAP device tun0 opened
Nov 21 23:20:13 RPiNet ovpn-piHotspot[740]: do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Nov 21 23:20:13 RPiNet ovpn-piHotspot[740]: /sbin/ip link set dev tun0 up mtu 1500
Nov 21 23:20:13 RPiNet ovpn-piHotspot[740]: /sbin/ip addr add dev tun0 local 10.8.0.2 peer 10.8.0.1
Nov 21 23:20:13 RPiNet ovpn-piHotspot[740]: TCP/UDP: Preserving recently used remote address: [AF_INET][My IP Address]
Nov 21 23:20:13 RPiNet ovpn-piHotspot[740]: UDP link local (bound): [AF_INET][undef]:1194
Nov 21 23:20:13 RPiNet ovpn-piHotspot[740]: UDP link remote: [AF_INET][My IP Address]:1194

Update: Nov 21, 2019

I am able to ping server and client from each other using the 10.8.0.0 subnets (10.8.0.1 10.8.0.2).

I have gained the ability to ping from the VPNServer to any device attached to the VPNClient (PiHotspot).

I have gained the ability to ssh to the VPNClient's attached devices and control them

I cannot ping from devices in the Client or the Client itself to the attached devices in the server's side, I can only ping the server.

This is my server.conf before the error. Once I changed the 192.168.50.1 to 192.168.50.0, I became a step closer to a finished result :)

dev tun
ifconfig 10.8.0.1 10.8.0.2
secret static.key
cipher AES-256-CBC
auth-nocache
route 192.168.50.1 255.255.255.0


                    
updated the whole document with new information
Source Link
Agustin
  • 146
  • 12

I created a home VPN using OpenVPN and a second raspberry pi (different Pi, located at home and acting as a server), and have the hotspot-pi connect to the OpenVPN-pi (at home) using OpenVPN as a client. The server's IP address is 10.10.10.83, and the local network subnet is 10.10.10.0/24

Edit: I have Completed part 1, 2 and 3 of Ingo's Answer. I get OpenVPN to start and connect to the server successfully. However where myMy issues arise are:

  • Once connected to the OpenVPN-pi, all devices connected to the hotspot-pi loose internet access.
  • Only the hotspot-pi is able to ping the OpenVPN  -pi at 10.8.0.1 or any IP's in the server's local network> no longer an issue
  • Only the hotspot-pi retains the ability to connect to internetpiHotspot can ping 10.8.0.1(PiVPNServer), none of the attached devices to the hotspot retain internetPiVPNServer can ping 10. Only when disconnecting to the VPN does internet return for the devices8.0.2(piHotspot) only, no pinging any other device in their subnets
  • Re-allow internet access to devices connected to the Hotspot-pi while it is connected to VPN. -> done
  • Allow devices in the server side network (OpenVPN-pi at home) to see devices attached to hotspot-pi (client VPN side on the field)
  • The ability to ping or ssh from any device on the server side to any devices on the client side.

Result of ip addr on the PiVPN Server:Result of ip addr on the PiVPN Server:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:fa:a5:b9 brd ff:ff:ff:ff:ff:ff
inet 10.10.10.83/824 brd 10.25510.25510.255 scope global noprefixroute eth0
   valid_lft forever preferred_lft forever
inet6 fe80::d187ba27:36d0ebff:fc8efefa:f762a5b9/64 scope link 
   valid_lft forever preferred_lft forever
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none 
inet 10.8.0.1/24 brdpeer 10.8.0.2552/32 scope global tun0
   valid_lft forever preferred_lft forever
inet6 fe80::20fea40b:5e736a36:93cd264:15ebc63d/64 scope link stable-privacy 
   valid_lft forever preferred_lft forever

Result of ip route in the PiVPN server:Result of ip route in the PiVPN server:

default via 10.10.10.1 dev eth0 src 10.10.10.83 metricproto 202static 
10.08.0.0/82 dev eth0tun0 proto dhcpkernel scope link src 10.108.100.83 metric 2021 
10.810.010.0/24 dev tun0eth0 proto kernel scope link src 10.810.010.183 
                                                        

Result of systemctl status [email protected]Result of systemctl status [email protected]

[email protected] - OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/[email protected]; enabled-runtime;enabled; vendor preset: enabled)
Active: active (running) since MonWed 2019-11-18 20 21:4341:0738 EST; 10min ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Main PID: 421329 (openvpn)
Status: "Initialization Sequence Completed"
Tasks: 1 (limit: 2200)
Memory: 2.8M5M
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─421└─329 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/server.status 10 --cd /etc/openvpn --config /etc/openvpn/server.conf --writepid /run/openvpn/server.pidse

Nov 18 20 21:5141:0938 piVPNPiVPNServer ovpn-server[421]: 24.114.69.217:59077 Control Channelserver[329]: TLSv1.2, cipher TLSv1.2 ECDHE-ECDSA-AES256-GCM-SHA384, 256 bitTUN/TAP EC,device curve:tun0 prime256v1opened
Nov 18 20 21:5141:0938 piVPNPiVPNServer ovpn-server[421]server[329]: 24.114.69.217:59077/sbin/ip [piHotspot]link Peerset Connectiondev Initiatedtun0 withup [AF_INET]24.114.69.217:59077mtu 
Nov 18 20 21:5141:0938 piVPNPiVPNServer ovpn-server[421]server[329]: piHotspot/24.114.69.217:59077sbin/ip MULTI_sva:addr pooladd returneddev IPv4=10.8.0.2,tun0 IPv6=(Notlocal enabled)1
Nov 18 20 21:5141:0938 piVPNPiVPNServer ovpn-server[421]openvpn[329]: piHotspot/24.114.69.217Error:59077 MULTI:Invalid Learn:prefix 10.8.0.2for ->given piHotspot/24.114.69.217:59077prefix
Nov 18 20 21:5141:0938 piVPNPiVPNServer ovpn-server[421]server[329]: piHotspot/24.114.69.217:59077 MULTIERROR: primary virtualLinux IProute foradd piHotspot/24.114.69.217:59077:command 10.8.0.2fai
Nov 18 20 21:5141:1038 piVPNPiVPNServer ovpn-server[421]: piHotspot/24.114.69.217server[329]:59077 PUSH:Could Receivednot controldetermine message:IPv4/IPv6 'PUSH_REQUEST'prot
Nov 18 20 21:5141:1038 piVPNPiVPNServer ovpn-server[421]server[329]: piHotspot/24.114.69.217:59077UDPv4 SENTlink CONTROLlocal [piHotspot](bound): 'PUSH_REPLY,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,block-outside-dns,redirect-gateway def1,route-gateway 10.8.0.1,topology subnet,ping 1800,ping-restart 3600,ifconfig 10.8.0.2 255.255.255.0,peer-id 0,cipher AES-25[AF_INET
Nov 18 20 21:5141:1038 piVPNPiVPNServer ovpn-server[421]server[329]: piHotspot/24.114.69.217:59077UDPv4 Datalink Channelremote: using negotiated cipher 'AES-256-GCM'[AF_UNSPEC]
Nov 18 20 21:5143:1053 piVPNPiVPNServer ovpn-server[421]: piHotspot/24.114.69.217:59077 Outgoing Data Channelserver[329]: CipherPeer 'AES-256-GCM'Connection initializedInitiated with 256 bit key[AF
Nov 18 20 21:5143:1054 piVPNPiVPNServer ovpn-server[421]: piHotspot/24.114.69.217:59077 Incoming Data Channelserver[329]: Cipher 'AES-256-GCM' initialized with 256Initialization bitSequence keyCompleted

Result of ip addr in piHotspot (client):Result of ip addr in piHotspot (client):

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 1000
link/ether b8:27:eb:3f:0e:89 brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 8a:ea:17:87:3f:87 brd ff:ff:ff:ff:ff:ff
inet 192.168.50.1/24 brd 192.168.50.255 scope global br0
   valid_lft forever preferred_lft forever
inet6 fe80::88ea:17ff:fe87:3f87/64 scope link 
   valid_lft forever preferred_lft forever
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether b8:27:eb:6a:5b:dc brd ff:ff:ff:ff:ff:ff
inet6 fe80::ba27:ebff:fe6a:5bdc/64 scope link 
   valid_lft forever preferred_lft forever
5: ppp0tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 3100
link/pppnone 
inet 2510.1098.2360.1552 peer 10.8.0.1/32 scope global ppp0tun0
   valid_lft forever preferred_lft forever
inet6 fe80::31c0:593e:d389:b8b7/64 scope link flags 800 
   valid_lft forever preferred_lft forever
6: tun0ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1003
link/noneppp 
inet 1025.8108.0227.2234/24 brd 10.8.0.25532 scope global tun0
   valid_lft forever preferred_lft forever
inet6 fe80::c280:60ee:ad54:2cbb/64 scope link flags 800 ppp0
   valid_lft forever preferred_lft forever

Result of ip route on piHotspot (client):Result of ip route on piHotspot (client):

0.0.0.0/1 via 10.8.0.1 dev tun0 
default via 25.109108.236227.155234 dev ppp0 proto static 
10.8.0.0/241 dev tun0 proto kernel scope link src 10.8.0.2 
10.17610.010.0/1624 via 2510.1098.2360.1551 dev ppp0 proto statictun0 
10.254176.0.0/16 via 25.109108.236227.155234 dev ppp0 proto static 
(my IP address) via 25.109.236.155 dev ppp0 
12810.0254.0.0/116 via 1025.8108.0227.1234 dev tun0ppp0 proto static 
192.168.50.0/24 dev br0 proto kernel scope link src 192.168.50.1 

Result of systemctl status [email protected]I think here there should be a call to my server's ip address no?

Result of systemctl status [email protected]

[email protected] - OpenVPN connection to piHotspot
  Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since MonWed 2019-11-18 20 21:4941:3025 EST; 10min16min ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Process: 342290 ExecStart=/usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /etc/openvpn --config /etc/openvpn/piHotspot.conf --writepid /run/openvpn/piHotspot.pid (code=exited, status=0/SUCCESS)
Main PID: 380323 (openvpn)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─380└─323 /usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /etc/openvpn --config /etc/openvpn/piHotspot.conf --writepid /run/openvpn/piHotspot.pid

Nov 18 20 21:5142:1005 RPiHotspotRPiNet ovpn-piHotspot[380]piHotspot[323]: ROUTE_GATEWAYwrite 25.109.236.155/255.255.255.255UDP: IFACE=ppp0Network HWADDR=00:00:00:00:00:00is unreachable (code=101)
Nov 18 20 21:5142:1015 RPiHotspotRPiNet ovpn-piHotspot[380]piHotspot[323]: TUN/TAPwrite deviceUDP: tun0Network openedis unreachable (code=101)
Nov 18 20 21:5142:1025 RPiHotspotRPiNet ovpn-piHotspot[380]piHotspot[323]: TUN/TAP TXwrite queueUDP: lengthNetwork setis tounreachable 100(code=101)
Nov 18 20 21:5142:1036 RPiHotspotRPiNet ovpn-piHotspot[380]piHotspot[323]: do_ifconfig,write tt->did_ifconfig_ipv6_setup=0UDP: Network is unreachable (code=101)
Nov 18 20 21:5142:1046 RPiHotspotRPiNet ovpn-piHotspot[380]piHotspot[323]: /sbin/ip link setwrite devUDP: tun0Network upis mtuunreachable 1500(code=101)
Nov 18 20 21:5142:1056 RPiHotspotRPiNet ovpn-piHotspot[380]piHotspot[323]: /sbin/ip addr addwrite devUDP: tun0Network 10.8.0.2/24is broadcastunreachable 10.8.0.255(code=101)
Nov 18 20 21:5143:1007 RPiHotspotRPiNet ovpn-piHotspot[380]piHotspot[323]: /sbin/ipwrite routeUDP: addNetwork (myis IPunreachable address(code=101) via 25.109.236.155
Nov 18 20 21:5143:1017 RPiHotspotRPiNet ovpn-piHotspot[380]piHotspot[323]: /sbin/ipwrite routeUDP: addNetwork 0.0.0.0/1is viaunreachable 10.8.0.1(code=101)
Nov 18 20 21:5143:1045 RPiHotspotRPiNet ovpn-piHotspot[380]piHotspot[323]: /sbin/ip routePeer addConnection 128.0.0.0/1Initiated viawith 10[AF_INET](MY.8IP.0ADDR.1ESS):1194
Nov 18 20 21:5143:1045 RPiHotspotRPiNet ovpn-piHotspot[380]piHotspot[323]: Initialization Sequence Completed

Update: Nov 1420, 2019

I am able to ping server and client from each other, I can ping devices attached to the server's local network but I cannot ping devices attached to using the hotspot network10. I'd prefer it the other way for my specific use8. In fact I'd like to be able to ssh or control any devices in the client's network from the server0. Devices attached to the client loose internet connection when I establish the vpn tunnel0 subnets (10. The moment8.0.1 10.8.0.2), But now I stophave lost the service, internet is back upability to ping other devices in each other's networks.

Lastly,I have gained internet connection back from attached devices while the VPN is enabled in the client/server files, they both have a tun set not a tap, won't this explain why I can't get an IP Address the same as my server's local network?.

I created a home VPN using OpenVPN and a second raspberry pi (different Pi, located at home and acting as a server), and have the hotspot-pi connect to the OpenVPN-pi (at home) using OpenVPN as a client.

Edit: I have Completed part 1, 2 and 3 of Ingo's Answer. I get OpenVPN to start and connect to the server successfully. However where my issues arise are:

  • Once connected to the OpenVPN-pi, all devices connected to the hotspot-pi loose internet access.
  • Only the hotspot-pi is able to ping the OpenVPN-pi at 10.8.0.1 or any IP's in the server's local network
  • Only the hotspot-pi retains the ability to connect to internet, none of the attached devices to the hotspot retain internet. Only when disconnecting to the VPN does internet return for the devices
  • Re-allow internet access to devices connected to the Hotspot-pi while it is connected to VPN.
  • Allow devices in the server side network (OpenVPN-pi at home) to see devices attached to hotspot-pi (client VPN side on the field)
  • The ability to ping or ssh from any device on the server side to any devices on the client side.

Result of ip addr on the PiVPN Server:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:fa:a5:b9 brd ff:ff:ff:ff:ff:ff
inet 10.10.10.83/8 brd 10.255.255.255 scope global noprefixroute eth0
   valid_lft forever preferred_lft forever
inet6 fe80::d187:36d0:fc8e:f762/64 scope link 
   valid_lft forever preferred_lft forever
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none 
inet 10.8.0.1/24 brd 10.8.0.255 scope global tun0
   valid_lft forever preferred_lft forever
inet6 fe80::20fe:5e73:93cd:15eb/64 scope link stable-privacy 
   valid_lft forever preferred_lft forever

Result of ip route in the PiVPN server:

default via 10.10.10.1 dev eth0 src 10.10.10.83 metric 202 
10.0.0.0/8 dev eth0 proto dhcp scope link src 10.10.10.83 metric 202 
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.1 
                                                        

Result of systemctl status [email protected]

[email protected] - OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/[email protected]; enabled-runtime; vendor preset: enabled)
Active: active (running) since Mon 2019-11-18 20:43:07 EST; 10min ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Main PID: 421 (openvpn)
Status: "Initialization Sequence Completed"
Tasks: 1 (limit: 2200)
Memory: 2.8M
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─421 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/server.status 10 --cd /etc/openvpn --config /etc/openvpn/server.conf --writepid /run/openvpn/server.pid

Nov 18 20:51:09 piVPN ovpn-server[421]: 24.114.69.217:59077 Control Channel: TLSv1.2, cipher TLSv1.2 ECDHE-ECDSA-AES256-GCM-SHA384, 256 bit EC, curve: prime256v1
Nov 18 20:51:09 piVPN ovpn-server[421]: 24.114.69.217:59077 [piHotspot] Peer Connection Initiated with [AF_INET]24.114.69.217:59077
Nov 18 20:51:09 piVPN ovpn-server[421]: piHotspot/24.114.69.217:59077 MULTI_sva: pool returned IPv4=10.8.0.2, IPv6=(Not enabled)
Nov 18 20:51:09 piVPN ovpn-server[421]: piHotspot/24.114.69.217:59077 MULTI: Learn: 10.8.0.2 -> piHotspot/24.114.69.217:59077
Nov 18 20:51:09 piVPN ovpn-server[421]: piHotspot/24.114.69.217:59077 MULTI: primary virtual IP for piHotspot/24.114.69.217:59077: 10.8.0.2
Nov 18 20:51:10 piVPN ovpn-server[421]: piHotspot/24.114.69.217:59077 PUSH: Received control message: 'PUSH_REQUEST'
Nov 18 20:51:10 piVPN ovpn-server[421]: piHotspot/24.114.69.217:59077 SENT CONTROL [piHotspot]: 'PUSH_REPLY,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,block-outside-dns,redirect-gateway def1,route-gateway 10.8.0.1,topology subnet,ping 1800,ping-restart 3600,ifconfig 10.8.0.2 255.255.255.0,peer-id 0,cipher AES-25
Nov 18 20:51:10 piVPN ovpn-server[421]: piHotspot/24.114.69.217:59077 Data Channel: using negotiated cipher 'AES-256-GCM'
Nov 18 20:51:10 piVPN ovpn-server[421]: piHotspot/24.114.69.217:59077 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Nov 18 20:51:10 piVPN ovpn-server[421]: piHotspot/24.114.69.217:59077 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key

Result of ip addr in piHotspot (client):

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 1000
link/ether b8:27:eb:3f:0e:89 brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 8a:ea:17:87:3f:87 brd ff:ff:ff:ff:ff:ff
inet 192.168.50.1/24 brd 192.168.50.255 scope global br0
   valid_lft forever preferred_lft forever
inet6 fe80::88ea:17ff:fe87:3f87/64 scope link 
   valid_lft forever preferred_lft forever
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether b8:27:eb:6a:5b:dc brd ff:ff:ff:ff:ff:ff
inet6 fe80::ba27:ebff:fe6a:5bdc/64 scope link 
   valid_lft forever preferred_lft forever
5: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 3
link/ppp 
inet 25.109.236.155/32 scope global ppp0
   valid_lft forever preferred_lft forever
6: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none 
inet 10.8.0.2/24 brd 10.8.0.255 scope global tun0
   valid_lft forever preferred_lft forever
inet6 fe80::c280:60ee:ad54:2cbb/64 scope link flags 800 
   valid_lft forever preferred_lft forever

Result of ip route on piHotspot (client):

0.0.0.0/1 via 10.8.0.1 dev tun0 
default via 25.109.236.155 dev ppp0 proto static 
10.8.0.0/24 dev tun0 proto kernel scope link src 10.8.0.2 
10.176.0.0/16 via 25.109.236.155 dev ppp0 proto static 
10.254.0.0/16 via 25.109.236.155 dev ppp0 proto static 
(my IP address) via 25.109.236.155 dev ppp0 
128.0.0.0/1 via 10.8.0.1 dev tun0 
192.168.50.0/24 dev br0 proto kernel scope link src 192.168.50.1 

Result of systemctl status [email protected]

[email protected] - OpenVPN connection to piHotspot
  Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-11-18 20:49:30 EST; 10min ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Process: 342 ExecStart=/usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /etc/openvpn --config /etc/openvpn/piHotspot.conf --writepid /run/openvpn/piHotspot.pid (code=exited, status=0/SUCCESS)
Main PID: 380 (openvpn)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─380 /usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /etc/openvpn --config /etc/openvpn/piHotspot.conf --writepid /run/openvpn/piHotspot.pid

Nov 18 20:51:10 RPiHotspot ovpn-piHotspot[380]: ROUTE_GATEWAY 25.109.236.155/255.255.255.255 IFACE=ppp0 HWADDR=00:00:00:00:00:00
Nov 18 20:51:10 RPiHotspot ovpn-piHotspot[380]: TUN/TAP device tun0 opened
Nov 18 20:51:10 RPiHotspot ovpn-piHotspot[380]: TUN/TAP TX queue length set to 100
Nov 18 20:51:10 RPiHotspot ovpn-piHotspot[380]: do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Nov 18 20:51:10 RPiHotspot ovpn-piHotspot[380]: /sbin/ip link set dev tun0 up mtu 1500
Nov 18 20:51:10 RPiHotspot ovpn-piHotspot[380]: /sbin/ip addr add dev tun0 10.8.0.2/24 broadcast 10.8.0.255
Nov 18 20:51:10 RPiHotspot ovpn-piHotspot[380]: /sbin/ip route add (my IP address) via 25.109.236.155
Nov 18 20:51:10 RPiHotspot ovpn-piHotspot[380]: /sbin/ip route add 0.0.0.0/1 via 10.8.0.1
Nov 18 20:51:10 RPiHotspot ovpn-piHotspot[380]: /sbin/ip route add 128.0.0.0/1 via 10.8.0.1
Nov 18 20:51:10 RPiHotspot ovpn-piHotspot[380]: Initialization Sequence Completed

Update: Nov 14, 2019

I am able to ping server and client from each other, I can ping devices attached to the server's local network but I cannot ping devices attached to the hotspot network. I'd prefer it the other way for my specific use. In fact I'd like to be able to ssh or control any devices in the client's network from the server. Devices attached to the client loose internet connection when I establish the vpn tunnel. The moment I stop the service, internet is back up.

Lastly, in the client/server files, they both have a tun set not a tap, won't this explain why I can't get an IP Address the same as my server's local network?

I created a home VPN using OpenVPN and a second raspberry pi (different Pi, located at home and acting as a server), and have the hotspot-pi connect to the OpenVPN-pi (at home) using OpenVPN as a client. The server's IP address is 10.10.10.83, and the local network subnet is 10.10.10.0/24

My issues arise are:

  • Once connected to the OpenVPN-pi, all devices connected to the hotspot-pi loose internet access.  -> no longer an issue
  • piHotspot can ping 10.8.0.1(PiVPNServer), PiVPNServer can ping 10.8.0.2(piHotspot) only, no pinging any other device in their subnets
  • Re-allow internet access to devices connected to the Hotspot-pi while it is connected to VPN. -> done
  • Allow devices in the server side network (OpenVPN-pi at home) to see devices attached to hotspot-pi (client VPN side on the field)
  • The ability to ping or ssh from any device on the server side to any devices on the client side.

Result of ip addr on the PiVPN Server:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:fa:a5:b9 brd ff:ff:ff:ff:ff:ff
inet 10.10.10.83/24 brd 10.10.10.255 scope global eth0
   valid_lft forever preferred_lft forever
inet6 fe80::ba27:ebff:fefa:a5b9/64 scope link 
   valid_lft forever preferred_lft forever
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none 
inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0
   valid_lft forever preferred_lft forever
inet6 fe80::a40b:6a36:264:c63d/64 scope link stable-privacy 
   valid_lft forever preferred_lft forever

Result of ip route in the PiVPN server:

default via 10.10.10.1 dev eth0 proto static 
10.8.0.2 dev tun0 proto kernel scope link src 10.8.0.1 
10.10.10.0/24 dev eth0 proto kernel scope link src 10.10.10.83 
                                                        

Result of systemctl status [email protected]

[email protected] - OpenVPN connection to server
Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset:
Active: active (running) since Wed 2019-11-20 21:41:38 EST; 10min ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Main PID: 329 (openvpn)
Status: "Initialization Sequence Completed"
Tasks: 1 (limit: 2200)
Memory: 2.5M
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─329 /usr/sbin/openvpn --daemon ovpn-server --status /run/openvpn/se

Nov 20 21:41:38 PiVPNServer ovpn-server[329]: TUN/TAP device tun0 opened
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: /sbin/ip link set dev tun0 up mtu 
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: /sbin/ip addr add dev tun0 local 1
Nov 20 21:41:38 PiVPNServer openvpn[329]: Error: Invalid prefix for given prefix
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: ERROR: Linux route add command fai
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: Could not determine IPv4/IPv6 prot
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: UDPv4 link local (bound): [AF_INET
Nov 20 21:41:38 PiVPNServer ovpn-server[329]: UDPv4 link remote: [AF_UNSPEC]
Nov 20 21:43:53 PiVPNServer ovpn-server[329]: Peer Connection Initiated with [AF
Nov 20 21:43:54 PiVPNServer ovpn-server[329]: Initialization Sequence Completed

Result of ip addr in piHotspot (client):

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host 
   valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 state DOWN group default qlen 1000
link/ether b8:27:eb:3f:0e:89 brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 8a:ea:17:87:3f:87 brd ff:ff:ff:ff:ff:ff
inet 192.168.50.1/24 brd 192.168.50.255 scope global br0
   valid_lft forever preferred_lft forever
inet6 fe80::88ea:17ff:fe87:3f87/64 scope link 
   valid_lft forever preferred_lft forever
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
link/ether b8:27:eb:6a:5b:dc brd ff:ff:ff:ff:ff:ff
inet6 fe80::ba27:ebff:fe6a:5bdc/64 scope link 
   valid_lft forever preferred_lft forever
5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none 
inet 10.8.0.2 peer 10.8.0.1/32 scope global tun0
   valid_lft forever preferred_lft forever
inet6 fe80::31c0:593e:d389:b8b7/64 scope link flags 800 
   valid_lft forever preferred_lft forever
6: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 3
link/ppp 
inet 25.108.227.234/32 scope global ppp0
   valid_lft forever preferred_lft forever

Result of ip route on piHotspot (client):

default via 25.108.227.234 dev ppp0 proto static 
10.8.0.1 dev tun0 proto kernel scope link src 10.8.0.2 
10.10.10.0/24 via 10.8.0.1 dev tun0 
10.176.0.0/16 via 25.108.227.234 dev ppp0 proto static 
10.254.0.0/16 via 25.108.227.234 dev ppp0 proto static 
192.168.50.0/24 dev br0 proto kernel scope link src 192.168.50.1 

I think here there should be a call to my server's ip address no?

Result of systemctl status [email protected]

[email protected] - OpenVPN connection to piHotspot
Loaded: loaded (/lib/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-11-20 21:41:25 EST; 16min ago
 Docs: man:openvpn(8)
       https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
       https://community.openvpn.net/openvpn/wiki/HOWTO
Process: 290 ExecStart=/usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /etc/openvpn --config /etc/openvpn/piHotspot.conf --writepid /run/openvpn/piHotspot.pid (code=exited, status=0/SUCCESS)
Main PID: 323 (openvpn)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/system-openvpn.slice/[email protected]
       └─323 /usr/sbin/openvpn --daemon ovpn-piHotspot --status /run/openvpn/piHotspot.status 10 --cd /etc/openvpn --config /etc/openvpn/piHotspot.conf --writepid /run/openvpn/piHotspot.pid

Nov 20 21:42:05 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:42:15 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:42:25 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:42:36 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:42:46 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:42:56 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:43:07 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:43:17 RPiNet ovpn-piHotspot[323]: write UDP: Network is unreachable (code=101)
Nov 20 21:43:45 RPiNet ovpn-piHotspot[323]: Peer Connection Initiated with [AF_INET](MY.IP.ADDR.ESS):1194
Nov 20 21:43:45 RPiNet ovpn-piHotspot[323]: Initialization Sequence Completed

Update: Nov 20, 2019

I am able to ping server and client from each other using the 10.8.0.0 subnets (10.8.0.1 10.8.0.2), But now I have lost the ability to ping other devices in each other's networks.

I have gained internet connection back from attached devices while the VPN is enabled in the client.

added 134 characters in body
Source Link
Agustin
  • 146
  • 12
Loading
added 712 characters in body
Source Link
Agustin
  • 146
  • 12
Loading
added 712 characters in body
Source Link
Agustin
  • 146
  • 12
Loading
added 1702 characters in body
Source Link
Agustin
  • 146
  • 12
Loading
updated info
Source Link
Agustin
  • 146
  • 12
Loading
Notice removed Improve details by Agustin
Bounty Ended with Ingo's answer chosen by Agustin
deleted 388 characters in body
Source Link
Agustin
  • 146
  • 12
Loading
added 1048 characters in body
Source Link
Agustin
  • 146
  • 12
Loading
Tweeted twitter.com/StackRaspi/status/1193045689992962049
edited title
Link
Agustin
  • 146
  • 12
Loading
Notice added Improve details by Agustin
Bounty Started worth 50 reputation by Agustin
added 471 characters in body
Source Link
Agustin
  • 146
  • 12
Loading
added what I've modified and what is still missing to fully work
Source Link
Agustin
  • 146
  • 12
Loading
edited title
Link
Agustin
  • 146
  • 12
Loading
added 1753 characters in body
Source Link
Agustin
  • 146
  • 12
Loading
added 2056 characters in body; edited title
Source Link
Agustin
  • 146
  • 12
Loading
Updated results
Source Link
Agustin
  • 146
  • 12
Loading
deleted 1 character in body
Source Link
Agustin
  • 146
  • 12
Loading
deleted 187 characters in body
Source Link
Agustin
  • 146
  • 12
Loading
corrected values / results on code
Source Link
Agustin
  • 146
  • 12
Loading