Connect iPhone to home LAN through 3G

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
yakireliyahu87
OpenVpn Newbie
Posts: 3
Joined: Wed Jul 31, 2013 8:48 am

Connect iPhone to home LAN through 3G

Post by yakireliyahu87 » Wed Jul 31, 2013 8:57 am

hi all,
I've installed an openvpn client on my iphone and managed to get a connection to my VPN server.
my VPN server is also my DLNA server.
what i want to achieve is when i connect with my iphone to my pc, it will get an IP address for my home LAN, so i could reach my DLNA server.
so far i only managed to connect but i cant reach my home net 10.0.0.x, and i only get a 10.8.0.x address.

here's my configuration:
Server Side:

Code: Select all

port 1194
proto udp
dev tap
dev-node Tap-main
ca "C:\\Program Files (x86)\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files (x86)\\OpenVPN\\config\\server.crt"
key "C:\\Program Files (x86)\\OpenVPN\\config\\server.key"  # This file should be kept secret
dh "C:\\Program Files (x86)\\OpenVPN\\config\\dh1024.pem"
server 10.8.0.0 255.255.255.0

push "route 10.0.0.0 255.255.255.0"

client-to-client

keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3

Client side:

Code: Select all

client
dev tun
proto udp

remote 10.0.0.6 1194
;remote my-server-2 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert yakir-iphone.crt
key yakir-iphone.key
ns-cert-type server
comp-lzo
verb 3
Thanks for the helpers!! :D

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: Connect iPhone to home LAN through 3G

Post by maikcat » Wed Jul 31, 2013 9:35 am

hi there,

first always post your configs WITHOUT comments... 8-)

are you sure your configs are correct? server uses tap , client uses tun.. :ugeek:

did you enable ip forwarding on openvpn server?
did you configured firewall (if any) on openvpn server itself to allow traffic from/to vpn?
did you configured routing correctly so other nodes can route traffic to vpn correctly?

Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

yakireliyahu87
OpenVpn Newbie
Posts: 3
Joined: Wed Jul 31, 2013 8:48 am

Re: Connect iPhone to home LAN through 3G

Post by yakireliyahu87 » Wed Jul 31, 2013 10:51 am

hi Michael,
I uploaded the old client config :shock:
here's the updated one

Code: Select all

client

dev tap

dev-node Tap-Main

proto udp

remote yakireliyahu87.no-ip.biz 1194

resolv-retry infinite


nobind

persist-key
persist-tun

ca ca.crt
cert yakir-iphone.crt
key yakir-iphone.key

ns-cert-type server

comp-lzo

verb 3
my server is Windows 7 station, and i enabled ip forwarding. should i have a similar config in the openvpn server config -file as well?

i shut down the firewall.

what do you mean by configured routing correctly?
i added in the server config to push route to my iphone

Code: Select all

push "route 10.0.0.0 255.255.255.0"
is that enough?

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: Connect iPhone to home LAN through 3G

Post by maikcat » Wed Jul 31, 2013 11:00 am

from your client can you:

ping openvpn server's tun ip?
ping openvpn server's lan ip?
ping any other node on your lan?


Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

yakireliyahu87
OpenVpn Newbie
Posts: 3
Joined: Wed Jul 31, 2013 8:48 am

Re: Connect iPhone to home LAN through 3G

Post by yakireliyahu87 » Wed Jul 31, 2013 2:43 pm

can reach all the above (tap, lan, and home router).
i want the client to "think" he's in my home net (10.0.0.x)
can i manage to allocate a virtual interface on my iphone that is in my lan?
the point is that i can use broadcasting and multicast to allow my iphone DLNA client to reach my server seamlessly
thanks for the help again! :)

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: Connect iPhone to home LAN through 3G

Post by maikcat » Thu Aug 01, 2013 6:17 am

wrong config then...

try using bridging mode instead of routing..


Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

Post Reply