NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
kraney
Sep 11, 2009Aspirant
HOWTO: PPtP VPN
This howto will list the steps necessary to set up a pptp server on a ReadyNAS Duo. PPtP makes a nice choice, because OSX natively supports connecting to PPtP VPNs. I think windows does also, but don't have personal experience with it.
This howto guide was developed against RAIDiator 4.1.6. It may work with older versions, possibly with minor modifications.
First, set up a dev environment using the instructions at http://www.readynas.com/?p=145
Next, you'll need to install and set up the necessary software
This howto guide was developed against RAIDiator 4.1.6. It may work with older versions, possibly with minor modifications.
First, set up a dev environment using the instructions at http://www.readynas.com/?p=145
Next, you'll need to install and set up the necessary software
- In FrontView, create a new group named "dip" (this is needed by the ppp package that pptpd relies on.)
- execute
apt-get install pptpd
- edit /etc/pptpd.conf, and set up definitions for localip and remoteip. These will need to have appropriate values for your network. There are examples in the default config file. You basically want to pick IP addresses that are within your subnet, but not used by DHCP or by computers in your network. If your local net is 192.168.0.0, you might choose something like
localip 192.168.0.2
remoteip 192.168.0.3-50 - optionally, turn on bcrelay in pptpd.conf
- edit /etc/ppp/chap-secrets, and add a username and password for a VPN user
- edit /etc/sysctl.conf and add
net.ipv4.ip_forward 1
This will tell the ReadyNAS to route your VPN client's traffic out to the rest of your network. This change will take effect on your next boot. You can go ahead and turn on routing without needing to reboot by runningecho 1 >> /proc/sys/net/ipv4/ip_forward
- Download the Linux kernel posted at http://www.readynas.com/gpl
- run
apt-get install libncurses5-dev
(needed to run menuconfig when setting up the kernel) - cd to the linux kernel directory, and run
cp arch/padre/defconfig .config
- There is a hardcoded cross-compile setup in the kernel build, which needs to be fixed. Edit arch/padre/Makefile, and replace the line that starts with "CROSS_COMPILE" with one like this
CROSS_COMPILE ?=
- run
make menuconfig
- Navigate to the "Network Device Support -> PPP (point-to-point protocol support)" page
- enable "PPP" by pressing "M" to mark it as a module
- also enable MPPE compression and async serial support.
- enable ppp filtering by pressing the space bar (it isn't a module, so 'M' doesn't work.)
- save the configuration and run
make modules
cp drivers/net/{ppp_async,ppp_mppe,ppp_generic,slhc}.ko /lib/modules/2.6.17.8ReadyNAS/kernel/drivers/net/
mkdir /lib/modules/2.6.17.8ReadyNAS/kernel/crypto
cp crypto/{sha1,arc4}.ko /lib/modules/2.6.17.8ReadyNAS/kernel/crypto/
depmod -a
Finally, you'll need to build the PPP kernel modules. This howto assumes you'll be building the kernel modules directly on the NAS device. You can also cross-compile on a different box, but I'll leave that explanation to other guides.
At this point, you should be able to connect from your VPN client, using the username and password you added to /etc/ppp/chap-secrets. The kernel will automatically load the new modules when they're needed.
If you run into trouble, check /var/log/syslog on the ReadyNAS for error messages.
60 Replies
Replies have been turned off for this discussion
- WhoCares_MentorIf you look into arch/x86/configs you'll find defconfig.smp (64bit) and defconfig.up (32bit). Copy to the appropriate place (kernel-dir/.config) and then run "make oldconfig".
However, it seems that the GPL archive doesn't contain the latest kernel sources. Should work for building kernel modules, though.
-Stefan - indomitiAspirantThanks Stefan! Now i can do "make oldconfig" without lots of questions about kernel.
I did something like this
wget http://www.readynas.com/download/GPL/RNDP6xxx_4.2.16_WW_src.zip
unzip RNDP6xxx_4.2.16_WW_src.zip -d devel
cd devel/linux-2.6.37.5
cp arch/x86/configs/defconfig.smp .config
make oldconfig
make menuconfig
make modules
mkdir /lib/modules/2.6.37.5.RNx86_64.2.1/kernel/drivers/net
cp drivers/net/*.ko /lib/modules/2.6.37.5.RNx86_64.2.1/kernel/drivers/net
depmod -a
modprobe ppp_generic
But i get this error after the modprobe command
WARNING: Error inserting slhc (/lib/modules/2.6.37.5.RNx86_64.2.1/kernel/drivers/net/slhc.ko): Invalid module format
FATAL: Error inserting ppp_generic (/lib/modules/2.6.37.5.RNx86_64.2.1/kernel/drivers/net/ppp_generic.ko): Invalid module format - WhoCares_MentorAre you sure you have a multi-core system? What's the output of "uname -a" on your ReadyNAS?
-Stefan - indomitiAspirantI do not have multicore. i dont have the ultra plus version.
Should i use a different defconfig file if i have x86_64 and single core?
uname -a
Linux Netgear-NAS 2.6.37.5.RNx86_64.2.1 #1 SMP Tue Mar 29 16:38:58 PDT 2011 x86_64 GNU/Linux - WhoCares_MentorNo, that's fine. As you can see from the uname output, you have an SMP kernel, so defconfig.smp should be the right one for you. So something else must have gone wrong while building the kernel and the modules. I suggest you do a "make mrproper" and start from scratch.
-Stefan - efalskenAspirantDon't forget 'make clean'. And don't extract/compile in your home dir. Do everything in a folder under /c/!!!
- indomitiAspirantThank you guys! I did it all over again and this time it worked, the only thing i changed was that i did a "make all" before make menuconfig.
Everything seems to be working :) - mfe_Tutor
indomiti wrote: Thank you guys! I did it all over again and this time it worked, the only thing i changed was that i did a "make all" before make menuconfig.
Everything seems to be working :)
Why you didnt take the compiled modules? Didnt work the compiled moduls?
edit:
ah okay i see you use a readynas ultra 4. - efalskenAspirantAn update: WhoCares? helped me modify my init.d script. For some reason, on my readynas, the ppp device isn't created automatically. You'll know you have this problem if this appears in your /var/log/syslog when you try to connect:
May 26 14:15:24 bigboy pppd[3387]: pppd is unable to open the /dev/ppp device. You need to create the /dev/ppp device node by executing the following command as root: ^Imknod /dev/ppp c 108 0
So, you can either typemknod /dev/ppp c 108 0
every time you reboot, or you can edit /etc/init.d/pptpd to look like this:case "$1" in
start)
echo -n "Starting PPTP Daemon: "
if [ ! -c /dev/ppp ]; then mknod /dev/ppp c 108 0; fi
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
-- < /dev/null > /dev/null
echo "pptpd."
;;
And don't forget to also build "PPP support for async serial ports" module when you're selecting the others. - mfe_TutorIs it possible that the vpn clients can use DLNA services from nas? I think the pptpd have to forward the upnp ports? Hase anyone a idea how to solves this problem?
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!