Commit Graph

24 Commits

Author SHA1 Message Date
Florian Eckert 75878e8f3c mwan3: add online_metric for ipsec failover
The mwan3 with IPsec does not work in a failover scenario as expected.
Because the default table is used for an lookup which traffic should be
encrypt.
The traffic for encryption is sent out on the interface with the lowest
metric. No matter which interface is currently seen as connected by the
mwan3.

In order for this that mwan3 could work with IPsec, an additional metric
is set that indicates which interface is currently connected. And the
interface with the lowest 'online_metric' is used as the IPsec interface.
If the interface is not considered connected by the mwan3, then the
online_metric for this interface is not set and the next route with an
higher metric is used.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-07-20 11:23:13 +02:00
Florian Eckert ed2e0b33ed mwan3: add sleep to release ipset reference
It turns out that under high system load, ipsets cannot be deleted. This
is because there is still a reference in iptables. A short sleep should
give the system time to clean this up.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-03-14 09:34:49 +01:00
Florian Eckert 13c2604eb1 mwan3: remove not needed ipset del cmd
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-03-14 09:34:49 +01:00
Florian Eckert 408458a72f mwan3: Split ipsets into separate ipv4 and ipv6 sets
Nft does not directly support ipsets, nft sets must be used instead.
The mwan3 uses ipsets for certain tasks. They can be combinded. So called
an ipset of ipsets. This list type is not available in nft. So that
mwan3 could be ported to nft in the feature, the ipset handling should be
split. So we have for each ipset an iptables rule.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-03-14 09:34:49 +01:00
Florian Eckert a49d0953dc mwan3: move command definitions to common.sh
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2022-03-14 09:34:49 +01:00
Aaron Goodman b7ea19bc96 mwan3: allow interfaces with no tracking IPs
In the procd refactor, support for interfaces with no tracking IPs was
inadvertentiy removed. This commit restores the previous behavior

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2021-05-02 19:13:44 -04:00
Aaron Goodman 267b65ad9f mwan3: fix regression in ipv6 routing tables
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2021-01-02 21:37:37 -05:00
Florian Eckert 8d41e5477f mwan3: fix logger tag in mwan3 init
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-12-22 08:38:25 +01:00
Aaron Goodman 24e1504b0b mwan3: improve route flushing on mwan3 stop
only attempt to flush routes for the relevant family

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-12-16 09:32:33 +01:00
Aaron Goodman b849fc73fb mwan3: add IPKG_INSTROOT to scripts
IPKG_INSTROOT needed for including mwan3 when building images

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-11-10 08:46:55 -05:00
Aaron Goodman a870bd70a9 mwan3: restore +x flag to mwan3 executables
Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-11-10 08:45:46 -05:00
Florian Eckert 1f1d21ed28 mwan3: make it clearer who initiated the start
It was somewhat opaque how the variable a is questioned. To show this
better the variable is now a string and not a boolean. So you can see
directly what should happen. With a boolean you always have to think
about what it means when 0 or 1 is used.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-11-06 10:41:28 +01:00
Aaron Goodman 59d12598b5 mwan3: use procd for locking everywhere
Replace locks on /var/run/mwan3.lock with locks via procd.

This fixes a deadlock issue where mwan3 stop would have a procd
lock, but a hotplug script would have the /var/run/mwan3.lock

Locking can be removed from mwan3rtmon since:
1) procd will have sent the KILL signal to the process during
shutdown, so it will not add routes to already removed interfaces on
mwan3 shutdown and
2) mwan3rtmon checks if an interface is active based on the
mwan3_iface_in_<IFACE> entry in iptables, and the hotplug script
always adds this before creating the route table and removes it
before deleting the route table

Fixes github issue #13704
(https://github.com/openwrt/packages/issues/13704)
2020-11-06 10:40:57 +01:00
Florian Eckert 6834f8e3a6 mwan3: use common makefile install wrappers
With this change you can see at a glance which files will be installed on
the system.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-11-06 10:35:55 +01:00
Florian Eckert c374711e60 mwan3: fix reload handling
When the interface section was changed, the changed configuration
options were not applied.
This commit adds the service reload handling again.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-10-23 08:15:57 +02:00
Aaron Goodman 566293d228 mwan3: use procd for mwan3rtmon and mwan3track
start all mwan3mon and mwan3track instances on mwan3 start
if an interface is down when mwan3track starts, it waits
for a signal from the hotplug script to start

procd can then handle stopping all of the scripts when mwan3
is halted

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-10-16 09:54:48 -04:00
Aaron Goodman c07f5230be mwan3: improve startup performance; version 2.9.0
improve startup and runtime performance by

1) moving common startup procedures out of hotplug script when called
from mwan3 start
2) reducing calls to iptables to check status of rules
3) consolidating iptables updates and updating with iptables-restore
4) do not wait for kill if nothing was killed
5) running interface hotplug scripts in parallel
6) eliminate operations in hotplug script that check status on every
single interface unnecessarily
7) consolidate how mwan3track makes hotplug calls
8) do not restart mwan3track on connected events

This is a significant refactor, but should not result in any breaking
changes or require users to update their configurations.

version bump to 2.9.0

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
2020-08-17 22:02:36 -04:00
Florian Eckert 058a2b6f30 mwan3: add workaround for procd change
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-07-20 08:12:48 +02:00
Florian Eckert a6dc75428c mwan3: switch to procd init script
This enables the procd handling for mwan3 on config change.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-06-17 13:00:48 +02:00
Florian Eckert 2cd5442a11 net/mwan3: fix start/stop/restart execution
Move setting global enabled flag from /etc/init.d/mwan3 to mwan3
command. So we could start mwan3 from the cmd mwan3 as well.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-09-24 10:20:35 +02:00
Florian Eckert f9a787e8df net/mwan3: add init script to enable/disable mwan3 globally
Adding a init script to "/etc/init.d/" introduce the possibility to
enable/disable mwan3 globally.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-02-05 10:29:23 +01:00
Adze1502 e1c07f13cc mwan3: update to version 1.5-7
Fixed issue where an manual ifup-ed interface would immediatly go down again
Remove from init as mwan3 is not a service

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2014-10-02 09:57:50 +02:00
Adze1502 869e4539f6 mwan3: Update to version 1.5-1
Add iptables -w option, which increases stability, requires iptables v1.4.20.
Code cleanup

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2014-08-10 13:18:54 +02:00
Adze1502 7afdbd28cf Add mwan3 to packages feed
Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2014-08-08 21:09:54 +02:00