Not able to access local network while connected to subnet

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Locked
techjohnny1
OpenVpn Newbie
Posts: 2
Joined: Tue May 13, 2014 3:12 pm

Not able to access local network while connected to subnet

Post by techjohnny1 » Tue May 13, 2014 3:21 pm

Here's my server.conf file:

Code: Select all

dev tun
proto udp

  ca {removed .. presumably}
cert {removed .. presumably}
 key {removed .. presumably}
  dh {removed .. presumably}

server 192.168.3.0 255.255.255.0
tls-server                               # Note: Not required for mode server

route 192.168.2.0 255.255.255.0 eth0     # Note: RESOLVE: Cannot resolve host address: eth0: No such host is known. 
push "topology subnet"
push "route 192.168.3.0 255.255.255.0"   # Note: Not required for mode server
client is an HTC ONE Android 4.3
connects to through out Windows 2012 the port is forwarded to a local Linux machine at 192.168.2.211.

Android successfully authenticates and receives an IP address 192.168.3.6.

Here's the Server's ifconfig

tun0: 192.168.3.1

Routing table on server:

Code: Select all

192.168.2.0 server.domain.local 0.0.0.0  (default gw)
192.168.3.0 * 255.255.255.0 
192.168.3.2 * 255.255.255.0 
When the Android client pings the server (192.168.3.1), tcpdump on the server reports this:

192.168.3.6 > 192.168.3.1: ICMP echo request, id 7, seq 1, length 64

But, the Android client doesn't report the ICMP request are replying and never shows a response.

I've enabled IP forwarding through sysctl.conf and ip_foward

Also, have added iptables -t nat MASQUERADE rules for 192.168.3.0 subnet.

techjohnny1
OpenVpn Newbie
Posts: 2
Joined: Tue May 13, 2014 3:12 pm

Re: Not able to access local network while connected to subn

Post by techjohnny1 » Tue May 13, 2014 8:46 pm

Works great now!

Went back and read the howto again.

Simplest config on the server:

dev tun
topology subnet
server 10.8.0.0. 255.255.255.0
push "route 192.168.2.0 255.255.255.0
proto

ca
cert
key
dh

push "redirect-gateway def1"
tls-server
persist-key
persist-tun


client:
remote server 1194

server ip tables:
iptables -I POSTROUTING -t nat -i em1 -s 192.168.2.0 -j MASQUERADE
iptables -I POSTROUTING -t nat -i em1 -s 10.8.0.0 -j MASQUERADE

ip_forwarding all enabled.

A big part of my problem was when the tun was being interpreted as a device that was hardwired on the network. Once I realized that tun0 was just a virtual network driver, everything made more sense.

Locked