April 15, 2012 15:31
Posted by Jeremy Durham
Although my DNS-321 is last year’s model, having been superseded by the awesome DNS-320, I decided last night that I’d love to get OpenVPN running on it and set up a VPN that would give me access to my shared directories and home computer from the office.
OpenVPN requires liblzo, which is available for fun_plug, so I grabbed that and installed it:
funpkg -i lzo-2.03-1.tgz
There is also an OpenVPN package, but it’s built for the DNS-323, so I installed it:
funpkg -i openvpn_2_1_2-DNS323.tgz
After installing, attempting to start gave me “invalid module format”, with dmesg telling me that the tun module included in the package was compiled for a different kernel than the stock kernel on the DNS-321.
A bit of Googling told me that no one (I could find) had provided a tun module for the DNS-321, so I set out to create one. Having been a Mac convert from Linux for the last 4 or 5 years, I haven’t built a kernel in quite a while, but it proved to be like riding a bike. I won’t get into the dirty details but you need version 220.127.116.11 of the kernel, the .config from the DNS-321 kernel, and an hour or so to kill. “make config” still works and after answering the right questions I was able to “make modules”, install the tun module and configure my VPN.
Although the DNS-321 is not as popular as it once was, I hope this helps someone else (or future me). Here is a copy of the tun.ko built for DNS-321 firmware 1.03: tun.ko