Hi
I'm trying to set up an OpenVpn tunnel. The client connects just fine, but I can't reach anything in the remote Lan nor the internet through the tunnel.
Let's call the Lan where the server is located Lan1 and the one where my client is currently located Lan2.
Both Lan1 and Lan2 run on the 192.168.1.0/24 subnet. However I have no intention of accessing Lan2 from Lan1.
The subnet used by OpenVpn is 10.8.0.0/24.
Lan1 is behind a router sitting at 192.168.1.100 and the OpenVpn server's sitting at 192.168.1.105.
Lan2 has a router sitting at 192.168.1.1.
That's what my client config looks like:
client
dev tun
proto udp
remote ##.##.##.## 1294
resolv-retry infinite
nobind
persist-key
persist-tun
ca [inline]
cert [inline]
key [inline]
ns-cert-type server
tls-auth [inline]
key-direction 1
cipher AES-256-CBC
pull
comp-lzo
verb 3
# followed by all the inline keys and certificates
And my server config:
port 1294
proto udp
dev tun
ca /home/andi/openvpn/ca.crt
cert /home/andi/openvpn/server.crt
key /home/andi/openvpn/server.key
dh /home/andi/openvpn/dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 77.109.138.45"
push "dhcp-option DNS 77.109.139.29"
keepalive 10 120
tls-auth /home/andi/openvpn/ta.key 0
cipher AES-256-CBC
comp-lzo
max-clients 3
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
verb 3
I've added the following iptables rules on the server machine
-I FORWARD -i tun+ -o eth0 -s 10.8.0.0/24 -m conntrack --cstate NEW -j ACCEPT
-I FORWARD -m conntrack --cstate RELATED,ESTABLISHED -j ACCEPT
On the router of Lan1 I've forwarded the port (1294) and added a static route 10.8.0.0/24 to 192.168.1.105.
I've already tried it with and without the bypass-dhcp flag, pushing routes from 192.168.1.0/24 to 192.168.1.100 with and without a single route preserving 192.168.1.1.
I've also tried just forwarding everything between tun0 and eth0
The ufw log shows lots of packets originating from tun0 like
[ 8847.331492] [UFW ALLOW] IN=tun0 OUT=eth0 MAC= SRC=10.8.0.6 DST=87.118.85.241 LEN=63 TOS=0x00 PREC=0x00 TTL=127 ID=2959 PROTO=UDP SPT=56882 DPT=53 LEN=43
but none going there.
Can someone please help me get this working.
I'm new to this whole thing and don't really know how to pinpoint the problem here.
Thanks
Andy