Multiple VPN Tunnels, Gentoo Style

Let tunname be the specific VPN tunnel to be started, using /etc/openvpn/tunname.conf as the config file. Then the required initscripts are created and started as follows:
# creating 
ln -s /etc/init.d/openvpn /etc/init.d/tunname

# starting 
/etc/init.d/tunname start

However, since starting the default initscript (/etc/init.d/openvpn) will cause a failure if no file named openvpn.conf is present, I'd strongly recommend to delete it from the default runlevel ;)

This is caused by the init script itself, as it determines the config solely by its name. Therefore the default initscript (/etc/ini.d/openvpn) will look for the aforementioned config file (/etc/openvpn/openvpn.conf) and report an error if it couldn't be found.

To start the tunnel on boot, the usual rc-update call will do the trick.

Cheers!

0 Kommentare:

Kommentar veröffentlichen