How to install OpenVPN 2.1-rc20 on PPC8544

Questions that don't fit in any category below may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby rct » Thu Nov 12, 2009 12:55 pm

Hi Dino,

Installing module-init-tools changed things.

But openvpn fails to enter into daemon mode.

DS209II_1> /usr/local/etc/rc.d/openvpn.sh restart

Killing OpenVPN processes....success

Unloading OpenVPN kernel modules...
tun.ko: success

Loading OpenVPN kernel modules:
tun.ko: success

Starting OpenVPN in daemon mode....failed
DS209II_1>
DS209II_1> ifconfig
eth0 Link encap:Ethernet HWaddr 00:11:32:05:16:1C
inet addr:192.168.1.43 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING ALLMULTI MULTICAST MTU:9000 Metric:1
RX packets:74775 errors:0 dropped:0 overruns:0 frame:0
TX packets:68549 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17398467 (16.5 MiB) TX bytes:11390693 (10.8 MiB)
Interrupt:18 Memory:c0004000-0

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:69 errors:0 dropped:0 overruns:0 frame:0
TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5528 (5.3 KiB) TX bytes:5528 (5.3 KiB)

If we get things up and running I am willing to test the guide
again on a plain vanilla DS209II.

Many thanks
Ricky Thramkrongart
2 x DS207+ / 2x 1TB WD1002FBYS-01A6B / DSM 2.2-0942
1 x DS508+ / 5x 1TB WD1002FBYS-01A6B / DSM 2.2-0942
1 x DS209II+ / 2x 1T ST31000340NS / DSM 2.2-0942
rct
Trainee
Trainee
 
Posts: 14
Joined: Fri Apr 04, 2008 7:24 am

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby dino » Thu Nov 12, 2009 1:14 pm

This is the start part of the openvpn startup script:
Code: Select all
start() {
   local ret=0;

   echo ""
   echo "Loading OpenVPN kernel modules:"
   insmod_syno "$KERNEL_MODULES_OPENVPN"
   
   # Make sure IP forwarding is enabled
   echo 1 > /proc/sys/net/ipv4/ip_forward

   # Make device if not present (not devfs)
   if ( [ ! -c /dev/net/tun ] ) then
      # Make /dev/net directory if needed
      if ( [ ! -d /dev/net ] ) then
         mkdir -m 755 /dev/net
      fi
      mknod /dev/net/tun c 10 200
   fi

   echo ""
   echo -n "Starting OpenVPN in daemon mode...."
   /opt/sbin/openvpn --cd /opt/etc/openvpn --daemon --config /opt/etc/openvpn/server.conf --script-security 2 --log-append /opt/var/log/openvpn.log > /dev/null 2>&1
   ret=$?
   [ $ret -eq 0 ] && success || failure
   err=`expr $err + $ret`;
   
   return $err
}


Could you step by step execute the following commands to see where it is failing

1) /opt/bin/insmod /opt/lib/modules/2.6.24/kernel/drivers/net/tun.ko (might fail if the module is already loaded)
2) echo 1 > /proc/sys/net/ipv4/ip_forward
3) mkdir -m 755 /dev/net (might fail if directory exist)
4) mknod /dev/net/tun c 10 200 (might fail if device exist)
5) /opt/sbin/openvpn --cd /opt/etc/openvpn --daemon --config /opt/etc/openvpn/server.conf --script-security 2 --log-append /opt/var/log/openvpn.log

let me know on which command you have a failure with the output
Dino
dino
Knowledgeable
Knowledgeable
 
Posts: 308
Joined: Tue Nov 04, 2008 7:18 am
Location: Belgium

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby dino » Thu Nov 12, 2009 1:18 pm

also check if the module is correctly loaded: /opt/bin/lsmod | grep tun
Dino
dino
Knowledgeable
Knowledgeable
 
Posts: 308
Joined: Tue Nov 04, 2008 7:18 am
Location: Belgium

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby rct » Thu Nov 12, 2009 1:35 pm

Hi Dino,
I do not seem to have insmod installed.
I tried to figur out which ipkg package it might be in, but failed :lol:

Please advice.
Sorry to look like such a n00b.

Many thanks
Ricky Thramkrongart
Last edited by rct on Thu Nov 12, 2009 2:05 pm, edited 2 times in total.
2 x DS207+ / 2x 1TB WD1002FBYS-01A6B / DSM 2.2-0942
1 x DS508+ / 5x 1TB WD1002FBYS-01A6B / DSM 2.2-0942
1 x DS209II+ / 2x 1T ST31000340NS / DSM 2.2-0942
rct
Trainee
Trainee
 
Posts: 14
Joined: Fri Apr 04, 2008 7:24 am

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby dino » Thu Nov 12, 2009 1:43 pm

sorry, the path for insmod is /opt/sbin/insmod. it is in the module-init-tools package which you have installed
Dino
dino
Knowledgeable
Knowledgeable
 
Posts: 308
Joined: Tue Nov 04, 2008 7:18 am
Location: Belgium

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby rct » Thu Nov 12, 2009 2:00 pm

Hi Dino,

The tun.ko module seems to be loaded:

    DS209II_1> /opt/sbin/insmod /opt/lib/modules/2.6.24/kernel/drivers/net/tun.ko
    insmod: error inserting '/opt/lib/modules/2.6.24/kernel/drivers/net/tun.ko': -1 File exists
    DS209II_1> echo 1 > /proc/sys/net/ipv4/ip_forward
    DS209II_1> mkdir -m 755 /dev/net
    mkdir: cannot create directory `/dev/net': File exists
    DS209II_1> mknod /dev/net/tun c 10 200
    mknod: `/dev/net/tun': File exists
    DS209II_1> /opt/sbin/openvpn --cd /opt/etc/openvpn --daemon --config /opt/etc/openvpn/server.conf --script-security 2 --log-append /opt/var/log/openvpn.log
    DS209II_1> /opt/bin/lsmod
    Module Size Used by
    tun 10080 0
....

But openvpn does not seem to be running:

    DS209II_1> ifconfig

    eth0 Link encap:Ethernet HWaddr 00:11:32:05:16:1C
    inet addr:192.168.1.43 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST NOTRAILERS RUNNING ALLMULTI MULTICAST MTU:9000 Metric:1
    RX packets:78231 errors:0 dropped:0 overruns:0 frame:0
    TX packets:71785 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:17760840 (16.9 MiB) TX bytes:12257149 (11.6 MiB)
    Interrupt:18 Memory:c0004000-0

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:69 errors:0 dropped:0 overruns:0 frame:0
    TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:5528 (5.3 KiB) TX bytes:5528 (5.3 KiB)

Many Thanks
Ricky Thramkrongart
Last edited by rct on Thu Nov 12, 2009 2:09 pm, edited 3 times in total.
2 x DS207+ / 2x 1TB WD1002FBYS-01A6B / DSM 2.2-0942
1 x DS508+ / 5x 1TB WD1002FBYS-01A6B / DSM 2.2-0942
1 x DS209II+ / 2x 1T ST31000340NS / DSM 2.2-0942
rct
Trainee
Trainee
 
Posts: 14
Joined: Fri Apr 04, 2008 7:24 am

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby dino » Thu Nov 12, 2009 2:07 pm

can you send me the output of /opt/var/log/openvpn.log
Dino
dino
Knowledgeable
Knowledgeable
 
Posts: 308
Joined: Tue Nov 04, 2008 7:18 am
Location: Belgium

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby dino » Thu Nov 12, 2009 2:47 pm

in server.conf you have to change the line

local 192.168.111.1

with

local <ip address of your synology server>

I'll update the guide
Dino
dino
Knowledgeable
Knowledgeable
 
Posts: 308
Joined: Tue Nov 04, 2008 7:18 am
Location: Belgium

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby dino » Thu Nov 12, 2009 2:56 pm

I changed the doc to:

What you need to do:

delete /opt/etc/openvpn.conf

make the adjustments in server.conf

I also uploaded a new set of config files in openvpn-sample-config-server.zip. The only thing changed in the zip is the deletion of openvpn.conf which is not used (my test version of the config)

REMARK:
* the file /opt/etc/openvpn/server.conf is configured on subnet 192.168.111.0/24. change the subnet to the one you are using
* the file /opt/etc/openvpn/server.conf is configured to listen on IP address 192.168.111.1. you have to change the line: local 192.168.111.1 into local <ip address of your synology server>
Dino
dino
Knowledgeable
Knowledgeable
 
Posts: 308
Joined: Tue Nov 04, 2008 7:18 am
Location: Belgium

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby rct » Thu Nov 12, 2009 2:59 pm

Hi Dino,

Yes! Finally success.

After changing the ip adr of the DS209II in /opt/etc/openvpn/server.conf:


    local <ip address of dino's synology server=192.168.111.1>
    -->
    local <ip address of my synology server>



    # /usr/local/etc/rc.d/openvpn.sh restart

    Killing OpenVPN processes....success

    Unloading OpenVPN kernel modules...
    tun.ko: success

    Loading OpenVPN kernel modules:
    tun.ko: success

    Starting OpenVPN in daemon mode....success
    # ifconfig
    eth0 Link encap:Ethernet HWaddr 00:11:32:05:16:1C
    inet addr:192.168.1.43 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST NOTRAILERS RUNNING ALLMULTI MULTICAST MTU:9000 Metric:1
    RX packets:92780 errors:0 dropped:0 overruns:0 frame:0
    TX packets:82011 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:22617225 (21.5 MiB) TX bytes:14953846 (14.2 MiB)
    Interrupt:18 Memory:c0004000-0

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:69 errors:0 dropped:0 overruns:0 frame:0
    TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:5528 (5.3 KiB) TX bytes:5528 (5.3 KiB)

    tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
    inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255
    UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:100
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
2 x DS207+ / 2x 1TB WD1002FBYS-01A6B / DSM 2.2-0942
1 x DS508+ / 5x 1TB WD1002FBYS-01A6B / DSM 2.2-0942
1 x DS209II+ / 2x 1T ST31000340NS / DSM 2.2-0942
rct
Trainee
Trainee
 
Posts: 14
Joined: Fri Apr 04, 2008 7:24 am

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby rct » Thu Nov 12, 2009 3:10 pm

Many Thanks Dino,

Later I will:
1) Find out how to create my own private certificate that Openvpn can use.
2) Install an openvpn windows client on my XP laptop.
3) Read the OpenVpn doc.
4) When you are ready I can prepare my DS209II (Have it backuped and reformatted)
To have another go with your modified Guide!!

Many Thanks
Ricky Thramkrongart
2 x DS207+ / 2x 1TB WD1002FBYS-01A6B / DSM 2.2-0942
1 x DS508+ / 5x 1TB WD1002FBYS-01A6B / DSM 2.2-0942
1 x DS209II+ / 2x 1T ST31000340NS / DSM 2.2-0942
rct
Trainee
Trainee
 
Posts: 14
Joined: Fri Apr 04, 2008 7:24 am

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby dino » Thu Nov 12, 2009 3:22 pm

1) Find out how to create my own private certificate that Openvpn can use.
=> I'll have a script which does that for you, will upload it in a couple of days when I have some time
4) When you are ready I can prepare my DS209II (Have it backuped and reformatted)
To have another go with your modified Guide!!
=> all the install guides are modified, so you can try. Let me know if there's still something wrong in the guide

Glad to hear it worked for you
Dino
dino
Knowledgeable
Knowledgeable
 
Posts: 308
Joined: Tue Nov 04, 2008 7:18 am
Location: Belgium

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby joechong » Fri Nov 13, 2009 4:41 am

Hi Dino,

Found this great tutorial of yours. Question, I'm using a CS407e, which I believe is not on PPC. Would the same installation guide and tun.ko applied to CS407e? If not, any chance of getting your help to compile similarly for CS407e? Many thanks for the reply.
joechong
Novice
Novice
 
Posts: 47
Joined: Sun Jul 19, 2009 9:36 am

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby joechong » Fri Nov 13, 2009 6:40 am

Correction to CS407e. Its using PowerPC but based on 8241. Can you help compile the tun.ko for it? Thanks.
joechong
Novice
Novice
 
Posts: 47
Joined: Sun Jul 19, 2009 9:36 am

Re: How to install OpenVPN 2.1-rc20 on PPC8544

Postby dino » Fri Nov 13, 2009 7:33 am

I need the following info:

* DS model: ds..../cs....
* Exact processor type: cat /proc/cpuinfo
* Linux version of the kernel: uname -r
Dino
dino
Knowledgeable
Knowledgeable
 
Posts: 308
Joined: Tue Nov 04, 2008 7:18 am
Location: Belgium

PreviousNext

Return to General Mods

Who is online

Users browsing this forum: No registered users and 2 guests