pandahack
Hi to all.
i ll try ti explain my project.
i have many devices for diferetens sites, with a internet conenction per site.
devices are Raspberry pi. I'm using Pi how video player for my shops.
The problem is manage remotely these devices from my head office.
I thought to install a openvpn server for close tunnels, and openvpn clients in all my devices.
I have created a devices pi network. connection is possible from server to each PI. and them is use a script system, php, python, etc.. to manage devices...
the problem is to automate the process of registering in the system.
i have a image for PI, with a certificate by default, when i connect a new device, this connect to the system using certificate by default, and then, manually o with a script, generate new certificate for this shop a installing it.
But...
i'm having many problem with permissions to establish the connection..
When device start. i have:
Oct 14 11:30:28 *** ovpn-certificate[927]: /sbin/ifconfig tun0 0.0.0.0
Oct 14 11:30:28 *** ovpn-certificate[927]: Linux ip addr del failed: external program exited with error status: 255
Oct 14 11:30:28 *** avahi-daemon[1387]: Withdrawing workstation service for tun0.
Oct 14 11:30:28 *** NetworkManager[823]: SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/tun0, iface: tun0)
Oct 14 11:30:29 *** watchdog[1537]: Last boot caused by watchdog.
Oct 14 11:30:29 *** mc ovpn-certificate[927]: Note: Cannot ioctl TUNSETIFF tun: Operation not permitted (errno=1)
Oct 14 11:30:29 *** ovpn-certificate[927]: do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Oct 14 11:30:29 *** ovpn-certificate[927]: /sbin/ifconfig 192.168.199.34 pointopoint 192.168.199.33 mtu 1500
Oct 14 11:30:29 *** ovpn-certificate[927]: Linux ifconfig failed: external program exited with error status: 1
Oct 14 11:30:29 *** ovpn-certificate[927]: Exiting
and when is restart the openvpn service manally, all works fine..
$ sudo /etc/init.d/openvpn restart
[....] Stopping virtual private network daemon:/etc/init.d/openvpn: 98: kill: No such process
[ ok certificate.
[ ok ] Starting virtual private network daemon: certificate.
and iface tun0 is up and works..
i think that is a problem with permission of certificate file.
I generate certificates with webmin, download in my pc and upload, by ftp to devices..
Any idea with automatic start?