I have OpenVPN setup and connected, but I can't see machines on my server-side LAN. I'm using a tunnel / router setup for the server.
The OpenVPN server is on 192.168.83.2:1194 and is behind a router. The OpenVPN server creates a VLAN of 192.168.244.0/24.
In the router config, I've added a static route:
Destination:192.168.244.0 Gateway:192.168.83.2 \
SubnetMask: 255.255.255.0 Metric: 0 Interface: LAN
I can ping the server from the remote client.
When I try to ping a machine (192.168.83.20) on the server LAN from a remote client, the ping fails BUT I get the following from
tcpdump -i tun0 on the Server:
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun0, link-type RAW (Raw IP), capture size 262144 bytes
18:26:41.298639 IP 192.168.244.6 > piZero: ICMP echo request, id 5583, seq 1, length 64
18:26:42.304126 IP 192.168.244.6 > piZero: ICMP echo request, id 5583, seq 2, length 64
etc.....
The client is assigned 192.168.244.6 and "piZero" is a machine on the LAN at 192.168.83.20.
SO - the ping request is getting to the server, and either not going to the piZero, or going to the piZero and not making it back to the VPN Client.
If I try to ping the remote client from the piZero, I get:
pi@pizero:~ $ ping 192.168.244.6
PING 192.168.244.6 (192.168.244.6) 56(84) bytes of data.
From 192.168.83.1: icmp_seq=2 Redirect Host(New nexthop: 192.168.83.2)
And the ping fails.
Here is a snip from the client log after connecting:
Fri Aug 26 13:02:21 2016 us=591385 ROUTE_GATEWAY 10.0.0.1/255.255.255.0 IFACE=wlp2s0 HWADDR=e4:a4:71:59:78:d8
Fri Aug 26 13:02:21 2016 us=600899 /sbin/ip addr add dev tun1 local 192.168.244.6 peer 192.168.244.5
Fri Aug 26 13:02:21 2016 us=607131 /sbin/ip route add 192.168.83.0/24 via 192.168.244.5
RTNETLINK answers: File exists
Fri Aug 26 13:02:21 2016 us=611141 ERROR: Linux route add command failed: external program exited with error status: 2
Fri Aug 26 13:02:21 2016 us=611341 /sbin/ip route add 192.168.244.1/32 via 192.168.244.5
RTNETLINK answers: File exists
Fri Aug 26 13:02:21 2016 us=614264 ERROR: Linux route add command failed: external program exited with error status: 2
Fri Aug 26 13:02:21 2016 us=614362 Initialization Sequence Completed
And the corresponding server log (6 hour time diff b/c I haven't set the time on the server):
Fri Aug 26 19:02:39 2016 us=721522 MULTI: Learn: 192.168.244.6 -> luigi/63.238.146.150:53077
Fri Aug 26 19:02:39 2016 us=721562 MULTI: primary virtual IP for luigi/63.238.146.150:53077: 192.168.244.6
RFri Aug 26 19:02:41 2016 us=928379 luigi/63.238.146.150:53077 PUSH: Received control message: 'PUSH_REQUEST'
Fri Aug 26 19:02:41 2016 us=928492 luigi/63.238.146.150:53077 send_push_reply(): safe_cap=940
Fri Aug 26 19:02:41 2016 us=928692 luigi/63.238.146.150:53077 SENT CONTROL [luigi]: 'PUSH_REPLY,route 192.168.83.0 255.255.255.0,route 192.168.244.1,topology net30,ping 10,ping-restart 120,ifconfig 192.168.244.6 192.168.244.5' (status=1)
Server Config:
port 1194
proto udp
dev tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/zelda.crt
key /etc/openvpn/easy-rsa/keys/zelda.key # This file should be kept secret
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
server 192.168.244.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.83.0 255.255.255.0"
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
log-append openvpn.log
verb 5
Client Config:
client
dev tun
proto udp
remote xxx.org 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/ca.crt
cert /etc/openvpn/client.crt
key /etc/openvpn/client.key
remote-cert-tls server
comp-lzo
verb 5
What would cause
ERROR: Linux route add command failed: external program exited with error status: 2,
And, is it related to the problem with sharing LAN machines over VPN?
Thanks for any help!