iPhone connects but IP address does not change

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
dsteele
OpenVpn Newbie
Posts: 3
Joined: Sat Apr 20, 2013 3:15 pm

iPhone connects but IP address does not change

Post by dsteele » Sat Apr 20, 2013 3:21 pm

My iPhone connectes to OpenVPN server on my Windows 7 desktop and the VPN icon shows on the iPhone when connected. However the iPhone doesn't get the external IP address of the server using whatismyip.com and keeps the Ip address it had before running the iPhone Open VPN client. In addition, the iPhone OpenVPN app has blank entries for "User" and "Client IP".

Very grateful for advice. Thanks.


client file:

dev tun
proto udp
remote 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt # local files
cert iPhone.crt
key iPhone.key
ns-cert-type server
comp-lzo
verb 3

server file:
port 1194
proto udp
dev tun
ca ca.crt # files in local folder
cert server.crt
key server.key
dh dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3


iPhone app connection details:

Duration [ correct duration]
Packet received [ 1 second ago ]

Bytes In [ 32.81 KB ]
Bytes out [ 10.14 KB ]

VPN IPv4 10.8.0.6
VPN IPv6 [blank]

User [blank]
Client IP [blank]

Server [ correct server address ]
Server IP [ correct server IP]

Port 1194
Protocol UDPv4

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: iPhone connects but IP address does not change

Post by janjust » Mon Apr 22, 2013 11:01 am

this happens because you're not redirecting all traffic via the OpenVPN server; in principle this can be done on the VPN server by adding a line

Code: Select all

push "redirect-gateway def1"
but you will need to take some additional steps to get it working on your Win7 desktop : what is needed is IP forwarding and some type of Network Address Translation; if you're lucky then you can add a route on your home router to accept (and foward) VPN traffic - if not, then you'll have to set up NATting on Win7, which is doable but not nice.

dsteele
OpenVpn Newbie
Posts: 3
Joined: Sat Apr 20, 2013 3:15 pm

Re: iPhone connects but IP address does not change

Post by dsteele » Mon Apr 22, 2013 10:32 pm

I am forwarding port 1194 on my router to Win7 which is on a static IP.
I have opened the Win7 firewall for UDP port 1194.
I have added to the server config:
push "redirect-gateway def1"

Unfortunately my iPhone is still not acquiring the server IP address.

Have you any pointers on how to set up NATting on Win7 ?

Many thanks.

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: iPhone connects but IP address does not change

Post by janjust » Tue Apr 23, 2013 9:07 pm

add an extra route to your home router:
source = 10.8.0.0
mask = 255.255.255.0
destination = Win7 static IP

as for a tutorial, try topic7806.html

dsteele
OpenVpn Newbie
Posts: 3
Joined: Sat Apr 20, 2013 3:15 pm

Re: iPhone connects but IP address does not change

Post by dsteele » Wed Apr 24, 2013 10:21 pm

Tried to add a static route but got a LAN conflict. There may be a known problem with static routes on my Netgear WNDR though.

I therefore followed the link you posted, used the server and client scripts and made the changes to the Win7 network plus registry edit.

Success! The iPhone now acquires the server IP address and can access my home network.

Many thanks for your help.

Post Reply