{"id":234,"date":"2010-04-18T09:17:15","date_gmt":"2010-04-18T08:17:15","guid":{"rendered":"http:\/\/www.evertdekker.com\/wp\/?p=234"},"modified":"2015-08-10T19:21:41","modified_gmt":"2015-08-10T18:21:41","slug":"vpn-with-nokia-n900-and-fritzbox","status":"publish","type":"post","link":"https:\/\/evertdekker.com\/wp\/?p=234","title":{"rendered":"Vpn with Nokia N900 and Fritzbox"},"content":{"rendered":"<p>This is an small tutorial to connect your Nokia N900 phone with you network at home or work with an <u>secure <\/u>VPN connection. Very handy for printing at home, accessing you nas or where i\u00b4m using it alot for, Remote desktop from your N900. As VPN server i wanted to use my Fritzbox because it\u00b4s already there to communicate with the rest of the world.<br \/>\nThe build in VPN functionality of the Fritzbox was not compatible with the OpenVpn that was used on the N900, so OpenVpn was also needed on the Fritzbox.<\/p>\n<p>To begin with i have used <a href=\"http:\/\/www.cswpro.de\/Howto\/FritzBox_OpenVPN.aspx\" target=\"_self\">this<\/a> article. The author used it to connect 2 Fritzbox together.<br \/>\nUsing this tutorial requires some basic knowledge of Linux, but if you have the N900 then you\u00b4re have else you have an iphone.<img decoding=\"async\" title=\"Smile\" src=\"http:\/\/www.evertdekker.com\/Joomla\/mambots\/editors\/jce\/jscripts\/tiny_mce\/plugins\/emotions\/images\/smiley-smile.gif\" alt=\"Smile\" border=\"0\" \/> and Steve Jobs determine what you&#8217;re doing with it.<br \/>\nFirst of all some warnings, you can really mess up your N900 or Fritzbox or even delete the whole Internet. Don\u00b4t blame me, i\u00b4m just some nerd that\u00b4s typing this tutorial for you.<\/p>\n<p>Tested it with Fritzbox 7170 with firmware version 58.04.74, Nokia N900 version 3.2010.02.<\/p>\n<ol>\n<li>First we need to download and install <b>OpenVpn<\/b> and <b>OpenVpn Applet<\/b> on the N900. The both can be found in the extra-devel repository.<\/li>\n<li>On the Fritzbox we must enable Telnet, this can be done by dialing on the land-line phone connected to the Fritzbox <b>#96*7*<br \/>\n<\/b>You can now make an telnet connection with your favourite program to the Frtizbox. The password is the same as for the web interface of the Fritzbox.<\/li>\n<li>The Fritzbox has not enough internal storage to store the Openvpn program. To overcome this problem we use an usb-stick(or external hdd). Make on your usb-stick the subdirectoy <b>vpn<\/b>. You van do this in your (windows) pc. Keep in mind that we are working with Linux so everything is case sensitive.<\/li>\n<li>Lets make the necessary script and configuration files, or if you really lazy <a href=\"http:\/\/evertdekker.com\/Joomla\/images\/stories\/Downloads\/Ovpn\/VpnFiles.zip\" target=\"_self\">download<\/a> them. And place the in the correct maps.<br \/>\n<span style=\"font-family: courier new,courier; font-size: xx-small;\"><b>Debug.cfg<\/b> (Place in the root of the Usb-stick)<\/span><span style=\"font-family: courier new,courier; font-size: xx-small;\"><span style=\"font-family: courier new,courier; font-size: xx-small;\"><br \/>\nmkdir \/var\/usb<br \/>\nmount \/dev\/sda1 \/var\/usb<br \/>\n\/var\/usb\/startup.sh<\/span><\/span><b>startup.sh<\/b> (Place in the root of the Usb-stick)<span style=\"font-family: courier new,courier; font-size: xx-small;\"><span style=\"font-family: courier new,courier; font-size: xx-small;\"><br \/>\necho Starting telnetd<br \/>\n\/usr\/sbin\/telnetd -l \/sbin\/ar7login<br \/>\n# wait until the DSL connection is establist<br \/>\necho Waiting for internet connection<br \/>\nwhile !(ping -c 1 www.google.com); do<br \/>\nsleep 5<br \/>\ndone<br \/>\n# tun-Device creating if not available yet<br \/>\necho Creating TUN device<br \/>\nmknod \/var\/tmp\/tun c 10 200<br \/>\n# start OpenVPN<br \/>\necho Starting OpenVPN<br \/>\ncd \/var\/usb\/vpn<br \/>\n.\/openvpn &#8211;config Server.ovpn &#8211;daemon<\/span><\/span><\/p>\n<p><span style=\"font-family: courier new,courier; font-size: xx-small;\"><span style=\"font-family: courier new,courier; font-size: xx-small;\"><b>Server.ovpn<\/b> (Place in the vpn map on the Usb-stick)<br \/>\ndev tun0<br \/>\ndev-node \/var\/tmp\/tun<br \/>\nifconfig 10.8.0.1 10.8.0.2<br \/>\nsecret \/var\/usb\/vpn\/static.key<br \/>\nkeepalive 10 60<\/span><\/span><b>Client.ovpn<\/b> (Place in the Mydoc directory or sd-card of your N900)<br \/>\nremote Your.Domain.name<br \/>\ndev tun<br \/>\nifconfig 10.8.0.2 10.8.0.1<br \/>\nsecret static.key<br \/>\nkeepalive 10 60<br \/>\nping-timer-rem<br \/>\npersist-tun<br \/>\npersist-key<br \/>\n#route must be in the same subnet as your network<br \/>\nroute 192.168.1.0 255.255.255.0<\/li>\n<li><a href=\"http:\/\/evertdekker.com\/Joomla\/images\/stories\/Downloads\/Ovpn\/openvpn_kernel_2_6.zip\" target=\"_self\">Download openvpn<\/a> for your Fritzbox,\u00a0 unzip it and place the contens on your usb stick in the vpn directory. Place now the usb-stick in your FritzBox.<\/li>\n<li>Now lets mount the usb-stick ;<br \/>\n<code>mkdir \/var\/usb<br \/>\nmount \/dev\/sda1 \/var\/usb<br \/>\n<\/code>And copy the debug.cfg to the flash directory so that the debug.cfg will executed during the next reboot;<br \/>\n<code>cat \/var\/usb\/debug.cfg &gt; \/var\/flash\/debug.cfg<\/code><\/li>\n<li>Lets make now the key file needed for the vpn connection;<br \/>\n<code>cd \/var\/usb\/vpn<br \/>\n.\/openvpn --genkey --secret static.key<\/code><br \/>\nCopy this key also to you N900\u00a0 in the same directory as you used in step 4.<br \/>\nYou need the key to make an secure connection, but it&#8217;s a key so don&#8217;t lose it.<\/li>\n<li>We need also forward the vpn udp port 1194 to the Fritzbox himself. Fritz doesn&#8217;t allow this using the webinterface, so we must do it by hand using nvi (works the same as vi).<br \/>\nNow where are gone editing the config file of the Fritzbox becarefull you can mess it really up now!<br \/>\n<code>cd \/var\/flash<br \/>\n<\/code><code>nvi ar7.cfg<\/code><br \/>\nFind now the section that&#8217;s named\u00a0 <i>forwardrules =<\/i> if you have already some ports forwarded you see them here also.<br \/>\nThere are multiply forwardrules, but there&#8217;s only one that is named only forwardrules. If you doubt, make an dummy port forwarding in the webinterface and search for that one.<br \/>\nNow add the following line to the section<br \/>\n<code>\"udp 0.0.0.0:1194 0.0.0.0:1194 0 # OpenVPN\",<\/code><br \/>\nDon&#8217;t forget the comma at the end and save the file. If it&#8217;s the last entry the comma should be an ;<\/li>\n<li>Settings should be finished now, lets reboot the Fritzbox by typing <code>reboot.<br \/>\n<\/code>After reboot login again with telnet and check if Openvpn is running by typing ps.<br \/>\nYou should see a process running that called openvpn, for example;<br \/>\n<i>654 root\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1600 S\u00a0\u00a0 .\/openvpn &#8211;config Server.ovpn &#8211;daemon<\/i><br \/>\nIf not try rebooting again or you (or me) has made an mistake in the previous 8 steps.<\/li>\n<li>Final we need configure the settings on the Nokia N900. That&#8217;s very easy to do, tap in the status bar on the Openvpn button and choose manage connections.<br \/>\nChoose new and then select for the configuration file Client.ovpn that we made in step 4. For key file you take the static.key file that we created in step 7.<br \/>\nPress import to finish. You can use the test button to test the connection. There&#8217;s a lot info on the test screen, but when the connection is successfully the last 2 lines are <i>Peer connection initiated withYourIp<\/i> and <i>Initialization Completed<\/i>.<\/li>\n<li>It&#8217;s ready to be used now!<br \/>\nBear in mind that 90% of all connection problems encountered by OpenVPN users are firewall\/port forwarding related.For more info about <a href=\"http:\/\/openvpn.net\/\" target=\"_self\">OpenVpn just click<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>This is an small tutorial to connect your Nokia N900 phone with you network at home or work with an secure VPN connection. Very handy for printing at home, accessing you nas or where i\u00b4m using it alot for, Remote desktop from your N900. As VPN server i wanted to use my Fritzbox because it\u00b4s [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-234","post","type-post","status-publish","format-standard","hentry","category-nokian900"],"_links":{"self":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/234","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=234"}],"version-history":[{"count":3,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/234\/revisions"}],"predecessor-version":[{"id":488,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/234\/revisions\/488"}],"wp:attachment":[{"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/evertdekker.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}