[IT] HOWTO: VPN Server in Linux for iPhone 4 / iPhone 4S and SiriProxy

Hi folks. As i promised here we have a small tutorial about setting up a VPN Server in your Linux Box for connecting with your iPhone 4 ( or iPhone 3GS) / iPhone 4S and for use with SiriProxy.

What you need / Prerequesites

- running linux ( examples here are for debian, opensuse, ubuntu)
- Internet access
- some time =)

Installing VPN Server (pptpd)

Installing the VPN Server ( pptpd daemon ) depends on your system. Choose your System:

Debian / Ubuntu

Debian: apt-get install pptpd
Ubuntu: sudo apt-get install pptpd

OpenSuse

zypper install pptpd

Configure your VPN Server

There are 3 important files for running a VPN Server on your Linux Box. The names are different between the Systems, but i show you here how to configure it no matter which linux you use.

pptpd.conf

The most important file is the /etc/pptpd.conf file. for installing my default file please use:

cd /etc
wget http://www.ketchup-mayo-senf.de/blog/pptpd.conf
( For Ubuntu Users use "sudo" in front of this command )

Edit this file and edit the option "remoteip" and set this to an ip-range matching your Network configuration ( in my case 192.168.178.234-238)

options.pptpd

This file includes some minor configurations like dns server etc.

cd /etc/ppp
wget http://www.ketchup-mayo-senf.de/blog/options.pptpd
( For Ubuntu Users use "sudo" in front of this command )

Edit the option "ms-dns" and set ip to your linux box ( or the box which is running fakedns or dnsmasq)

chap-secrets

cd /etc/ppp
wget http://www.ketchup-mayo-senf.de/blog/chap-secrets
( For Ubuntu Users use "sudo" in front of this command )

Here you can edit the user credentials. By default its:

User: KMS
Password: siri

i suggest to change that!

Configure your iPhone

In Settings you'll find a VPN Tab.

- Select "PPTP"
- Description: thats up to you
- Server: your linux box ip ( best use dyndns )
- Account: KMS ( if using default user. else put here your user name)
- Password: siri ( if using default password. else put here your own password)

Thats all. After that you can connect very easy: just enable the slider =)

Questions? Wishes?

If there are questions just lemme know =)

/Matthias







55 Antworten zu [IT] HOWTO: VPN Server in Linux for iPhone 4 / iPhone 4S and SiriProxy

  1. 707 Vegas 2011-12-22 11:57 pm

    Perfect tutorial for creating the VPN Connection, but nothing is shown in the dns.

    Changing the options file and restarting the server leads to:

    /etc/init.d/pptpd restart
    Shutting down MS VPN server pptpd done
    Starting MS VPN server pptpdFATAL: Module ppp_mppe not found.

  2. 710 admin 2011-12-23 9:39 am

    if you change the file wrong you sometimes get that.

    try to stop server and then start it.

    and change the right option file :) (there is a "options" file as well which is for the "ppp" ... it affects the connection as well.

  3. 721 admin 2011-12-23 4:09 pm

    =)

  4. 726 hatzl 2011-12-23 9:12 pm

    hab dein Tutorial durchgemacht,jedoch kommt bei miPhone immer :

    Der PPTP-VPN-Server antwortet nicht......

  5. 728 hatzl 2011-12-24 8:45 am

    ok, hat sich erledigt.
    Funktioniert nun einwandfrei. Danke!

  6. 736 admin 2011-12-24 11:43 am

    Prima! Was war es denn?

  7. 738 Nitro 2011-12-24 3:44 pm

    Hallo..

    Options.pptpd: ms-dns meine statische ip vom linux server
    chap-secrets bearbeiten erklärt sich von selbst..

    aber pptpd.conf: wo soll da die remote ip rein?? es steht zwar paar mal remote ip aber alles mit ner Raute davor???

  8. 754 Nitro 2011-12-26 10:44 pm

    Hat sich erledigt :D

  9. 755 sircockalot 2011-12-26 11:24 pm

    pptpd.conf: Der Router vergibt im Lan ips von 192.168.0.100 bis 199,
    welche ip Range stelle ich denn jetzt ein ? (habe zurzeit 100-120)stehen..

    options.pptpd: Habe schon dyndns und habe die addi bei msdns eingegeben und im Iphone unter Server natürlich auch .. richtig??

    chap-secrets: erklärt sich ja von selbst !!

    Muss im Router noch irgendein Port freigegeben werden??

    Habe nämlich alles genau so wie es in der Anleitung steht gemacht aber da steht immer pptp vpn server antwortet nicht !

  10. 831 Christian 2011-12-27 1:30 pm

    Wozu benötigt man denn ein eigenes iPhone 4s und muss das iPhone 4s dann gejailbreaked sein ?
    Könnte man nicht einfach die Daten die vom iPhone ausgelesen werden zum Download bereitstellen ? Wirst du auch deinen Proxy mal Public stellen oder nicht ?
    Das waren jetzt eine menge Fragen, würde mich aber über eine Antwort freuen .. ^^

  11. 849 jaminmc 2011-12-27 7:22 pm

    Hey, With the "leagle" release of Siri with Spire, I can't seem to get my iphone 4 to connect to my proxy server. It seems to require you to set a proxy server, and when I put my address into the proxy server, it dosent work, because it is trying to do a cert for siri.myproxy.com instead of the guzzoni.apple.com that is the Common Name for my cert. Is there a way to put two common names in the Cert, so I can use a 4S to get the keys and then use Spire on my iphone 4...

  12. 886 Pascal 2011-12-28 1:49 pm

    Hallo. wenn ich ein vpn server auf Ubuntu mach funktioniert die sache wunderbar. Nun wenn ich aber Ubuntu Neu starte geht der VPN server nicht mehr auch nicht wenn ich ihn neu Starte... was kann ich da machen das der immer geht?

    MfG Pascal

  13. 887 admin 2011-12-28 1:54 pm

    @jaminmc: no but you can setup 2 siriproxy with 2 different certs.

    @pascal: du schreibst es geht.. was meinst du denn mit es geht nicht nach neustart?

    @christian: ja du kannst auch die ausgelesenen daten eines iphone 4s nehmen. musst keins dran verbinden. einen public server wird es von mir nicht geben.

  14. 888 parad0x 2011-12-28 2:08 pm

    I've set up the VPN server but when i try to connect to the server with my iphone 4 it would get as far as authenticating and then just say display an error: "A connection could not be established to the PPP server. Try reconnecting. If the problem continues, verify your settings and contact your Administrator"

    What could have gone wrong? I've made sure my ports are forwarded and all. I'm trying to connect to it via 3G using my external IP as the server IP in the settings and the rest default.

    Thanks,

  15. 889 Pascal 2011-12-28 2:13 pm

    Ich meine damit das dann kommt das der VPN Server die verbindung getrennt hat. und das jedes mal nach dem neustart von ubuntu. wenn ich ubuntu neu aufsetze geht die vpn verbindung auf dem iphone zu ubuntu wunderbar.

    Was kann man da machen das man immer mit VPN Connecten kann nicht nur nach dem ersten aufsetzen von Ubuntu

  16. 913 Pascal 2011-12-28 8:00 pm

    Okay. Problem gelöst warum auch immer. Anderes problem habe ich.. im internen netzwerk kann ich problemlos den vpn benutzen. sollte ich nun aber via dyndns von extern connecten kommt das der pptp server nicht antwortet. Exposed host in der Fritzbox ist auf den Server gegeben. Woran kann das liegen?

  17. 914 Phu 2011-12-28 8:27 pm

    I'm confusing with the IP, there are many kinds and
    I don't know which one to use

  18. 933 brian 2011-12-29 1:20 am

    when editing the PPTPD.CONF, do i change the localip to the ip of the linux box or the ip of my internet? and do i change the remoteip?

    AND

    when editing the options.pptpd, do i change the ms-dns to the ip of linux box or the ip of my internet? do i change the #ms-dns too?

    im with Phu on this, VERY confusing

  19. 945 ben 2011-12-29 6:59 am

    is there another way except vpn server?

  20. 946 Pascal 2011-12-29 8:34 am

    So alle probleme gelöst bis auf eins. Wie bekomme ich dieses blöde adress already in use weg.

    MfG Pascal

  21. 947 admin 2011-12-29 9:28 am

    paradox: what is the log saying? (/var/logs)

    @ben: yup direct access.

    @pascal: wo denn? bei dns? entweder:
    /etc/init.d/dns stop
    oder
    /etc/init.d/dnsmaq stop

  22. 952 Pascal 2011-12-29 12:23 pm

    Danke ;) jetzt läuft VPN.. anderes problem ist wenn ich dein modifizierter siriServer mit sudo ruby start.rb starte kommt unten der Balken und blinkt. aber nichts passiert weder beim iPhone 4 connect noch beim iphone 4s. die Zertifikate sind alle beide auf guzzoni.apple.com ausgestellt.. woran könnte das liegen?

  23. 953 parad0x 2011-12-29 12:26 pm

    Log:
    PPTP connecting to server '***.**.**.**' *my external IP*
    PPTP connection established.
    Using interface ppp0
    Connect:ppp0 <--> socket [34:17]
    LCP terminated by peer (MPPE required but peer negotiation failed)
    PPTP error when reading socket : EOF
    PPTP error when reading header : read -1, expected 12 bytes
    Connection terminated.
    PPTP disconnecting...
    PPTP Disconnected

  24. 955 admin 2011-12-29 12:48 pm

    paradox: reboot ur box and try vpn in again and check if the error still exists

  25. 958 lachz 2011-12-29 1:11 pm

    ok habe alles nach der anleitung auf meinem rootserver (debian lenny) gemacht jedoch kann ich mit dem iphone nicht verbinden (Der PPTP-VPN-Server antwortet nicht......) in der pptpd.conf habe ich als localip die standard ip versucht und die server ip und den remotebereich hab ich auch einiges versucht. in der options datei als ms-dns auf die serverip ist ja klar. was mach ich falsch? kann mir wer helfen?

  26. 959 admin 2011-12-29 1:28 pm

    schau in den logs. /var/logs

  27. 966 lachz 2011-12-29 1:40 pm

    und welches file in den logs?

  28. 967 lachz 2011-12-29 1:44 pm

    vz275 pptpd[12106]: MGR: Bad IP address (10.5.1.241-246 #015) in config file!

    ok da ist der fehler. die frage ist nur wie vergebe ich auf nem vserver oder rootserver den bereich richtig und die locale ip?

  29. 969 lachz 2011-12-29 1:54 pm

    vz275 pptpd[12127]: MGR: PPP options file /etc/ppp/options-pptpd#015 not readable

    dazu hat er noch diesen fehler was aber quark ist

    vz275 pptpd[12127]: MGR: PPP options file /etc/ppp/options.pptpd#015 not readable

    vorher wars so beide dateien sind da
    beide dateien sind vom filesystem her lesbar auch 755 und 777 getestet immer das gleich

  30. 988 admin 2011-12-29 8:42 pm

    Lachz: das Problem ist, das bei dir beim runterladen es dir die Files verändert hat. Da ist ein ^m als zeilenumbruch drin. Editier die Dateien .. Dann gehts

  31. 991 calven 2011-12-29 8:57 pm

    I have set up the siri proxy,but the spire need a proxy server ,what should i type inside the spire ? i have an iphone 4s connect to proxy server and installed ca.crt on iphone 4 and 4s. can lead me to the next step?should i create an vpn??

  32. 992 ben 2011-12-29 9:47 pm

    how do you setup direct access?

  33. 1000 Deepsy 2011-12-29 11:48 pm

    GRE: read(fd=6,buffer=610d20,len=8196) from PTY failed: status = -1 error = Input/output error, usually caused by unexpected termination of pppd, check option syntax and pppd logs

    Does anybody else have this error in logs?

  34. 1006 brian 2011-12-30 2:33 am

    "Edit the option "ms-dns" and set ip to your linux box"
    do i change both ms-dns?
    there is:
    ms-dns:XXXXXXXXXXX
    # ms-dns:XXXXXXXXX

  35. 1046 ben 2011-12-30 10:42 pm

    it says on my iphone: "you were disconnected by the communication device.Try reconnecting. If the problems continues, verify your settings."
    i don't know what the problem is.. any help?

  36. 1079 Phil 2011-12-31 9:54 pm

    Habe den pptpd-Server am laufen und kann mich auch drauf verbinden, jedoch bekomme ich dann übers Phone keine INternet-Verbindung und kann somit auch kein Siri nutzen.
    Eine Idee woran das liegen könnte?

    Guten Rutsch!

  37. 1085 JonnyT 2012-01-01 3:08 pm

    Hi, I successfully set up most of a Siri proxy on my computer, I just haven't tried it with an iPhone 4s yet. In order to create a VPN so my iPod touch can connect to the Siri proxy via spire, does the Siri proxy have to be at the house where the 4s is or can I keep the Siri proxy running at my house and still connect via VPN to my Siri proxy here at home while I'm at work or something? Also how do I run the commands in ubuntu if my siri proxy server is still running in terminal? And one more, do you have to authenticate the 4s keys every 24 hours in order for the non 4s device can connect to the Siri proxy and have it work?
    Thanks

  38. 1093 calven 2012-01-02 4:32 am

    i had did what exactly you wrote, i had an siriproxy with auto key grabbing which from your tutorials,and when i try to set this pptpd , i slide on vpn on my 4s,it say"The pptpd-vpn server did not respond. try re connecting. if the problem continues, verify your settings and contact your administrator." what should i do?

  39. 1118 Marc 2012-01-03 3:26 pm

    Hi,

    I cant configure the files in etc.
    I guess I have no permission.
    Could you please note me how to do it?
    Thanks, many!

  40. 1132 Loukas 2012-01-04 8:19 pm

    Hello,

    I am very dissapointed, while I am trying 2 days now to configure this VPN server.
    When my iPhone 4 is connected to my home Wifi, then I can connect through VPN.
    When I am over 3G, I just cannot connect.
    How I have to edit the files: pptpd.conf and options.pptpd in order to connect?

    My server local ip is 192.168.1.116
    My external ip is 94.71.201.130

    Should I edit dnsmasq.conf file too?

    Please help me, I am desperate!!!!

    Thanks,
    Loukas

  41. 1149 Dan 2012-01-06 4:17 pm

    I am wondering the same thing as JonnyT

  42. 1157 Kevin 2012-01-07 10:45 am

    Hey, ich bekomm das nicht hin!

    könnt ihr mir vielleicht helfen?

    per putty? vil.

    danke im voraus. :-)

  43. 1173 Cameron 2012-01-08 3:25 pm

    How do you set up for direct access? That seems like it would be a lot simpler.

  44. 1219 Rehner 2012-01-13 5:45 pm

    Hi,

    first of all thanks for your great Tutorials and great work on the SiriProxy!
    Everything is running fine for me, except the VPN-Connection to my V-Server.
    The 4S can open a VPN Connection without Problems. (Both, the iPhone and the Server (checked via "lsof -i") confirm that they established a connection) But SiriProxy doesn't respond to any Input from the 4S.
    If i change the DNS to the IP of my Server on the 4S everything works fine, but not via VPN.
    I'm going to post logs next Time i get my Hands on the 4S. But it would be great if somebody already could guess where the matter is.

    Regards Rehner

  45. 1223 Alex 2012-01-15 5:37 pm

    I think it's better to do a Video-tutorial with more details.
    To explain what we need to insert in remote ip, remote ip of what ? i will connect from outside, i need an external ip. (for siri to work over 3g).
    More details about every ip and dns.
    Explain what ip adress we need to put in, exactly.
    and for dyndns and no-ip ? we need to pay ?
    I have an dyndns account (i pay it 30 dollars/year), i put my dyndns : siri.skandou1988.com, and my external ip adress.
    But the status of my dyndns is : pre-activated.
    I don't know what i have to do, to ACTIVATE it. can anyone help me pls.
    Ich bin deutscher, also auch eine Antwort in Deutsch, nehme ich sehr gerne.

  46. 1225 admin 2012-01-16 8:55 am

    @brian: no only one is enough.

    @ben: check logs (/var/logs)

    @phil: set up routing right!

    calven: check logs (/var/logs)

    @Mark: enter "su" then enter root password and work as root.

    @Loukas: firewall active maybe? disable it or allow vpn.

    @cameron: you need vpn for connecting an 4S iPhone (or wifi)

    @Rehner: if you use fakedns server be sure to setup the ip to the ip of the vpn server (not the lan ip!).

    alex: warum bezahlst du geld für dyndns? das ist im grundservice kostenlos und ausreichend. siri geht über 3g wenn deine kiste von aussen ereichbar ist und das zertifikat zur dyndns ausgestellt wurde.

  47. 1227 Rehner 2012-01-16 9:22 am

    Ok, so i have to set "ms-dns" in the options.pptpd to the Server-IP (my machine is a root-server with static IP), right?
    Another Question in this Tutorial is for me how to handle the "remote IP" part in pptpd.conf because the server is not part of a network. Can i just choose an IP range?

  48. 1228 admin 2012-01-16 10:45 am

    you can choose whatever range u like. it generates it own subnet anyway.

  49. 1233 Rene 2012-01-18 10:46 am

    Hi,
    also ich verzweifle an der VPN Verbindung. Ich habe an meinem Router PPTP-Passthrough aktiviert. Sollte also kein Thema sein.
    options.pptp
    ms-dns 192.168.*.* (meine lokale Server IP-Adresse)

    pptpd.conf
    remotip 192.168.*.* - 192.168.*.* (lokalen IP AdressBereich)

    Was übersehe ich an der Sache? Firewall habe ich testweise schon deaktiviert. Selbes Spiel. Welche Ports habt Ihr wohin weitergegeben auf Euren Routern? Wäre nett wenn mir jemand helfen könnte.

    Gruß René

  50. 1249 Jonas 2012-01-25 3:18 am

    Hey Admin,

    ich habe mal eine Frage.

    Ich suche bereits seit Tagen einen Weg den Proxy Server zum Laufen zu bringen.

    In der Datei "pptpd.conf", muss man ja eine Range bzw. eine IP angeben die das Iphone für die VPN Verbindung bekommen soll.

    Ich habe einen Root-Server 1 öffentlichen festen IP-Adresse.
    Kann das funktionieren oder muss ich erst noch einen DHCP Server darauf einrichten ? Sonst habe ich vom Provider keine IP-Adresse vom Router zugewiesen bekommen und somit auch keine Range.

    Wäre Lieb wenn du mir helfen könntest

    Gruß Jonas

  51. 1267 Ferhat 2012-01-31 12:56 pm

    Hi,
    mein Problem ist das wenn ich von zuHause aus lokal VPN nutze es funktioniert aber bei meinem Cousen sein 4S (wohnt weiter weg) bei dem geht das nicht ich wollte an seine keys kommen alles funktioniert bis auf das vpn was habe ich falsch gemacht kannst du mir helfen?

    Danke im Voraus
    Gruß Ferhat

  52. 1272 Matias 2012-02-03 4:04 pm

    Hey Admin,

    habe es mittlerweile hinbekommen, den Zeilenumbruch aus der pptpd.conf zu entfernen, aber jetzt zeigt mir das syslog an:

    pptpd[3951]: MGR: PPP options file /etc/ppp/pptpd-options#015 not readable

    Ich brauche dringend Hilfe! Ich habe Rechte verändert, habe die pptpd-options nochmal komplett neu runtergeladen und auch Zeilenumbrüche entfernt...Alles half nichts!

    Bitte versucht wenigstens zu helfen!

    Mit freundlichen Grüßen,
    Matias

  53. 1280 Ali 2012-02-10 2:11 pm

    i follow all setp but now working with me can u help me?

  54. 1296 Nihat 2012-03-03 10:30 am

    Help help help..:( vpn vpn vpn :(

  55. 1306 Eddy Gonzalez 2012-03-14 12:03 am

    Hi Matthias,

    Thank you for your tutorial. After all the googling, your VPN tutorial is the best on the net. So right now I have a laptop running Ubuntu in VirtualBox, which is running SiriProxy. This laptop is connected via Ethernet. This laptop is home and I want to access this proxy remotely from somewhere far away (international). Now let us say that I have a 3G capable iPad (I don't but I made it so that it can), would using VPN be very slow for Siri? Is it even worth it?

Antwort hinterlassen