OpenVPN and iOS App - TUN Setup Failed

If your problem doesn't fall into one of the other categories, report it here.

Moderator: Moderators

slyx620
Posts: 1
Joined: Mon Feb 04, 2013 2:49 am

OpenVPN and iOS App - TUN Setup Failed

Post by slyx620 »

I'm on version 1.5.9 of Gargoyle on a TP-LINK wdr3600 and are having issues connecting via OpenVPN to the router when using my iPhone to connect via the OpenVPN app that was just released.

The message I'm getting is

Code: Select all

 
[route-gateway] [10.8.0.1]
1 [redirect-gateway] [def1]
2 [ping] [25]
3 [ping-restart] [180]
4 [route] [192.168.8.0] [255.255.255.0] [10.8.0.1]
5 [ifconfig] [10.8.0.11] [255.255.255.0]

2013-02-03 22:46:30 LZO-ASYM init swap=0 asym=0
2013-02-03 22:46:30 EVENT: ASSIGN_IP]2013-02-03 22:46:30 TUN Error: tun_builder_error: ifconfig addresses are not in the same /30 subnet (topology net30)
2013-02-03 22:46:30 EVENT: TUN_SETUP_FAILED tun_builder_error: ifconfig addresses are not in the same /30 subnet (topology net30) [ERR]
Can anyone help figure out what might be cause of this?

pelowj
Posts: 25
Joined: Thu Feb 16, 2012 7:53 pm

Re: OpenVPN and iOS App - TUN Setup Failed

Post by pelowj »

Same problem here, did you ever find a solution?

-JP

pelowj
Posts: 25
Joined: Thu Feb 16, 2012 7:53 pm

Re: OpenVPN and iOS App - TUN Setup Failed

Post by pelowj »

Ok, have it working now. Seems the problem lay in the fact that certain settings weren't being pushed to the iOS client.

To get it working I added the following lines to the /etc/openvpn/server.conf file.

Code: Select all

push "topology subnet"
push "dhcp-option DNS 192.168.0.1"
(Note that 192.168.0.1 is the non-standard address of my gargoyle router, you should change this to your router's own IP.)

Hit restart in the web interface, wait until it has completed and enjoy.

-jp

yc3948
Posts: 164
Joined: Sat Sep 10, 2011 1:04 am

Re: OpenVPN and iOS App - TUN Setup Failed

Post by yc3948 »

Thanks!
Buffalo WZR-HP-G300NH2 DD-WRT v24SP2-MULTI (10/31/11) std
Buffalo WZR-HP-G300NH Gargoyle 1.5.9+1f082daf
Linksys WRT54GL Gargoyle 1.4.4
TP-Link TL-WR1043ND Gargoyle 1.5.9+1f082daf

Eric
Site Admin
Posts: 1443
Joined: Sat Jun 14, 2008 1:14 pm

Re: OpenVPN and iOS App - TUN Setup Failed

Post by Eric »

I think the key line above is the "push topology subnet" line, which is now included in any configuration generated by gargoyle 1.5.11. This was a fix included in the official release, no need for one of ispyisail's builds (though it will be there too). If you are on 1.5.11 but generated configuration files on an older version and preserved settings during upgrade it probably won't be there.

I was able to connect with an android client with adding just the "push topology subnet line", not the "dhcp-option DNS 192.168.0.1" line, which I do not think is necessary and is a command that is mostly for use with a TAP interface not a TUN interface like what gargoyle uses. I don't have any iOS devices (just android), so it would be helpful if someone with an iOS device could verify that the "dhcp-option DNS 192.168.0.1" is not necessary.

pelowj
Posts: 25
Joined: Thu Feb 16, 2012 7:53 pm

Re: OpenVPN and iOS App - TUN Setup Failed

Post by pelowj »

My internal host names won't resolve without the dhcp-option.

-jp

maihacke
Posts: 11
Joined: Sun Sep 23, 2012 7:51 am

Re: OpenVPN and iOS App - TUN Setup Failed

Post by maihacke »

Default setup is not working for me.
The openvpn app shows
2013-12-01 21:25:20 OPTIONS:
0 [topology] [subnet]
1 [route-gateway] [10.8.0.1]
2 [redirect-gateway] [def1]
3 [ping] [25]
4 [ping-restart] [180]
5 [route] [192.168.2.0] [255.255.255.0] [10.8.0.1]
6 [ifconfig] [10.8.0.2] [255.255.255.0]

2013-12-01 21:25:20 LZO-ASYM init swap=0 asym=0
2013-12-01 21:25:20 EVENT: ASSIGN_IP
2013-12-01 21:25:20 Error parsing IPv4 route: [route] [192.168.2.0] [255.255.255.0] [10.8.0.1] : tun_builder_route_error: route destinations other than vpn_gateway or net_gateway are not supported


The result is, that i can't access hosts in my internal lan.
After adding the following option to /etc/server.conf

push "route 192.168.2.0 255.255.255.0 vpn_gateway"

Internal lan access is working.

The log file now shows

2013-12-01 21:58:25 OPTIONS:
0 [topology] [subnet]
1 [route-gateway] [10.8.0.1]
2 [dhcp-option] [DNS] [192.168.2.1]
3 [route] [192.168.2.0] [255.255.255.0] [vpn_gateway]
4 [ping] [25]
5 [ping-restart] [180]
6 [route] [192.168.2.0] [255.255.255.0] [10.8.0.1]
7 [ifconfig] [10.8.0.2] [255.255.255.0]

2013-12-01 21:58:25 LZO-ASYM init swap=0 asym=0
2013-12-01 21:58:25 EVENT: ASSIGN_IP
2013-12-01 21:58:25 Error parsing IPv4 route: [route] [192.168.2.0] [255.255.255.0] [10.8.0.1] : tun_builder_route_error: route destinations other than vpn_gateway or net_gateway are not supported
2013-12-01 21:58:25 Connected via tun

So there is still an error in the sent options (I think the problem is number 6). So this is ignored. My custom routing seems to fix that...

pelowj
Posts: 25
Joined: Thu Feb 16, 2012 7:53 pm

Re: OpenVPN and iOS App - TUN Setup Failed

Post by pelowj »

I've just upgraded to 1.6.1 (clean install), and I'm now having the same issue as maihacke.

maihacke
Posts: 11
Joined: Sun Sep 23, 2012 7:51 am

Re: OpenVPN and iOS App - TUN Setup Failed

Post by maihacke »

Hello,

I just upgraded to new version 1.7.1
The problem still exists.
Could you change openvpn setup to automatically ad the following line to server.conf

push "route 192.168.2.0 255.255.255.0 vpn_gateway"

Obviously firts part had to be replaced by router subnet

maihacke
Posts: 11
Joined: Sun Sep 23, 2012 7:51 am

Re: OpenVPN and iOS App - TUN Setup Failed

Post by maihacke »

Sadly there is no developer reaction here in the forum, nor is this bug fixed. To just a short updated for everyone interested.
Since newer version there is a per client file with routing settings in /etc/openvpn/ccd

you have to change the push option there (replace gateway ip with "vpn_gateway" without ")

Post Reply