Commit Graph

8 Commits

Author SHA1 Message Date
Hans Dedecker 74dbf6bcbe strongswan: add interface uci list
The interface config option allows users to configure logical OpenWRT
interface names in the ipsec section; it allows StrongSwan to listen
and send traffic on specified interface(s). It translates to interfaces_use
StrongSwan option which is a comma sepearted list of network devices
that should be used by charon.
Since StrongSwan can only be started when one of the specified logical
OpenWRT interface is up procd interface triggers are installed to
trigger the reload script.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-12-13 18:46:37 +01:00
Hans Dedecker 1d31d840d4 strongswan: fix reload service
Based on the ipsec running state reload_service is either reloading ipsec
or starting ipsec. However in the latter case it calls ipsec start which
bypasses the procd start_service function which means the running ipsec
instance is not managed by procd.
Fix this by calling start in case ipsec is not running; at the same time
add service_running function which is used by procd provided running
function.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-12-13 10:49:55 +01:00
Stijn Tintel ba1ead54f0 strongswan: use -eq when testing booleans
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-08-07 20:19:18 +02:00
Stijn Tintel 6f00048eca strongswan: convert init script to procd
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-08-07 20:19:18 +02:00
Stijn Tintel b93a53bd94 strongswan: check return value instead of output
When the strongswan service is running, `ipsec status` returns 0. Check
the return value instead of checking its output.

While at it, remove the [[ ]] bashism, use rereadall instead of
(reread)secrets, and move it inside the if statement.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-08-07 20:19:18 +02:00
Stijn Tintel 44ef6048e2 strongswan: remove checks for UCI config
In commit 36e073d820, some checks were
added to see if the UCI config file exists and if there are any peers
configured in it. Due to these checks, if /etc/config/ipsec exists, but
contains no enabled peers, strongswan will not be started. This is not
ideal, as a user might want to experiment with the UCI config while
keeping existing connections in /etc/ipsec.conf operational.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2017-08-07 20:19:18 +02:00
Hans Dedecker 36e073d820 strongswan: uci config support
Add support to configure strongswan via uci.

uci support is based on the following sections
-ipsec : Global config items belonging in the strongswan.conf file
-remote : Defines the remote peer(s)
-tunnel : Defines the IPSec connections in tunnel mode
-transport : Defines the IPSec connections in transport mode
-crypto_proposal : Defines the different crypto proposals

Signed-off-by: Pierre Lebleu <pme.lebleu@gmail.com>
Signed-off-by: Gino Peeters <peeters.gino@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
2017-01-06 13:32:13 +01:00
Steven Barth bd52d64fdb strongswan: import, update, adopt
Signed-off-by: Steven Barth <steven@midlink.org>
2014-08-17 10:11:02 +02:00