Hi
I have configured an openVPN server and client which connects successfully and I can ping all devices on the LAN.
Network overview:
Internet --> Vigor 2860n Router (10.0.0.1) --> Network Switch (10.0.0.2) --> openVPN Server (10.0.0.250 / 10.8.0.1)
--> Intranet Web Server (10.0.0.251)
+ Router has LAN DNS Resolution setting so that *.intranet.app requests are forwarded to 10.0.0.251
+ Router has static route 10.8.0.0/24 -> 10.0.0.250 added
If a connected client visits whatsmyip.org the public IP for the LAN is shown as expected.
tracert google.com shows that internet traffic is passing through the tunnel.
However DNS queries don't seem to be passed to the LAN router (10.0.0.1) which results in any *.intranet.app queries not resolving.
nslookup my.intranet.app
Server: myRouter.Home
Address: 192.168.0.1
Non-authoritative answer:
Name: my.intranet.app
Address: 127.0.53.53
But forcing nslookup with router IP resoles as I would like...
nslookup my.intranet.app 10.0.0.1
Server: lan.router
Address: 10.0.0.1
Non-authoritative answer:
Name: my.intranet.app
Address: 10.0.0.251
I am using default iptable rules for testing and added
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o em1 -j MASQUERADE
Chain PREROUTING (policy ACCEPT 22 packets, 3198 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 22 packets, 3198 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- any em1 10.8.0.0/24 anywhere
/etc/sysctl.conf
net.ipv4.ip_forward=1
server.conf
local 10.0.0.250
port 1194
proto udp
topology subnet
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
tls-server
tls-auth ta.key 0
server 10.8.0.0 255.255.255.0
push "redirect-gateway"
push "route 10.0.0.0 255.255.255.0"
push "dhcp-option DNS 10.0.0.1"
;client-to-client
;duplicate-cn
keepalive 10 120
cipher BF-CBC
comp-lzo
;max-clients 100
user nobody
group nogroup
persist-key
persist-tun
ifconfig-pool-persist ipp.txt
status openvpn-status.log
log openvpn.log
verb 6
;mute 20
Any ideas please??