1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-16 20:33:58 +02:00
Commit Graph

78 Commits

Author SHA1 Message Date
Florian Eckert
2cf984c69e net/mwan3: fix track_ips order
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-09-12 16:14:32 +02:00
Florian Eckert
803f69546e net/mwan3: fix mwan3track STATUS if initial_state is offline
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-09-12 15:55:27 +02:00
Marcin Jurkowski
66406f98db mwan3: fix interface-bound traffic when interface is offline
This commit fixed what 6d99b602 was supposed to fix without affecting
interface-bound traffic.

Before 6d99b602 interface-bound traffic was working normally as long
as at least one interface was online. However when the last interface
went offline, it was impossible to ping and such state was
unrecoverable.

Commit 6d99b602 fixed unrecoverable offline state problem (it was
possible to ping -I iface) but messed inteface-bound traffic. Traffic
with interface source address was not working if the interface was in
"offline" state, even if another interface was online.
The problem was caused by an inconsistent "offline" interface state:
iptables-related rules were kept while routing table and policy were
deleted.

The idea behind this commit is to:
 1. Keep all the rules for each interface (iptables, routing table,
    policy) regardless of its state. This ensures consistency,
 2. Make interface state hotplug events affect only iptables'
    mwan3_policy_* rules. Interface-related iptables, routing table
    and policy is removed only when mwan3 is manually stopped.

To make such changes possible, it's necessary to change the way
mwan3_policy_* rule generator keeps track of interface state hotplug
events.
Until now, it checked for the existence of custom interface-related
routing table (table id 1, 2, 3, ...). Clearly we can no longer rely
on that so each interface state is stored explicitly in file.

Signed-off-by: Marcin Jurkowski <marcin1j@gmail.com>
2017-09-12 11:18:52 +02:00
Florian Eckert
faa86fe0f4 net/mwan3: update version
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-09-01 11:13:57 +02:00
Florian Eckert
a8ccaa1f0f net/mwan3: fix /var/state issue in 14-mwan3 hotplug
Use common function to toggle ip address in /var/state/mwan3.
Change also to use toggle function and not set function. If ip address
is often changed every change is saved to /var/state/mwan3.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-09-01 11:02:55 +02:00
Florian Eckert
0c678d39cc net/mwan3: if initial_state is offline set status to unknown
To show that the status of the interface is neither offline nor online
set the status to unknown.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-09-01 10:59:54 +02:00
Florian Eckert
ec5542ab2b net/mwan3: mwan3track skip track ips if realibility is accomplished
If enough tracking ip are pinged skip the reset. They are not needed
anymore to mark the interface as up.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-09-01 10:59:49 +02:00
Marcin Jurkowski
284284ef2e mwan3: fix bugs introduced in 815e83d4
Fixes the following bugs introduced in commit 815e83d4:
 - hotplug: invalid parameter order when initial interface state is "online",
   mwan3track expects initial state to be the third argument
 - hotplug: missing source ip address when initial interface state is "offline"
 - mwan3track: source ip address should be the fourth argument

Signed-off-by: Marcin Jurkowski <marcin1j@gmail.com>
2017-08-17 13:20:10 +02:00
Florian Eckert
8319100914 net/mwan3: update version
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-16 14:37:06 +02:00
Florian Eckert
3607bac3af net/mwan3: make mwan3 mask configurable over uci
Add new global config option mmx_mask.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-16 14:35:06 +02:00
Florian Eckert
a0e8010e7a net/mwan3: update version
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 12:36:21 +02:00
Florian Eckert
c872189d66 net/mwan3: add hotplug script for hidden self interface generation
Add new globals config section with option local_source.

With this config option the self interface generation will be done now
automatically on hotplug event. You can specify which interface (ip)
sould be used for router traffic. To replace the self intereface in the
config set local_source to "lan".

The default option is none, so it will not change default behavior if a
"self" interface is configured in the network section.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 12:32:56 +02:00
Florian Eckert
44eb0a7c9d net/mwan3: add Makefile postinst and postrm for rpcd
Restart rpcd on package install/remove

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 11:30:47 +02:00
Florian Eckert
a4fbc7eba6 net/mwan3: fix ipset generation in hotplug script with an lock
Fix critical section during hotplug events.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 11:30:47 +02:00
Florian Eckert
a934a25f21 net/mwan3: fix ubus json datatyp
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 11:30:47 +02:00
Florian Eckert
929bec6402 net/mwan3: expand ubus to show when last mwan3track check was done
To know how old the ubus output is, add an age parameter which indicats
how old the check informations on the interface are.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 11:30:47 +02:00
Florian Eckert
815e83d461 net/mwan3: on startup mark interface online only if track_ip are reachable
Add new interface config option "inital_state".

If interface comeing up the first time(mwan3 start, boot),
there are now two option for interface behaviour:

- online (default as is now)
  Set up interface regardless wether tracking ip are reachable or not.

- offline
  Set up interface first to ping tracking ip and if they are reachable set up
  the interface completely.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 11:30:47 +02:00
Florian Eckert
6d99b602fd net/mwan3: fix ping issue if last interface recovers from failure
Even though error was fixed the interface checks still fails, if last_resort
was set to blackhole or unreachable.

To fix this issue do not remove failure interface from iptables change on
down event.

Reported-by: Colby Whitney <colby.whitney@luxul.com>
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 10:48:40 +02:00
Florian Eckert
5e123852bc net/mwan3: move mwan3track clean up to mwan3 cmd
This is usefull to see the last state of the interface with ubus.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 10:48:27 +02:00
Florian Eckert
96760e66dd net/mwan3: remove unused global definition
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 10:48:22 +02:00
Florian Eckert
0b44ca505b net/mwan3: fix mwan3track kill execution
If two interface have the same prefix "wan" for example "wan" and "wan1"
pgrep returns the PID for wan1 also "pgrep -f mwan3track wan".

Before this fix "wan1" was also killed! This is not what we want.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 10:48:18 +02:00
Florian Eckert
487278dcd1 net/mwan3: fix ubus output for mwan3track running state
Fix ubus output for mwan3track running state

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 10:48:14 +02:00
Florian Eckert
9df6e9dd98 net/mwan3: change logging output on hotplug interface event
Change logging output on hotplug interface event

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 10:48:09 +02:00
Florian Eckert
a7a2464d9e net/mwan3: add option keep_failure_interval on failure
Add new boolean interface config param to keep ping failure interval during
interface failure state.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 10:45:28 +02:00
Florian Eckert
f942701b1a net/mwan3: add process PID to LOG output
Update log output macro to show PID during logging

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-08-10 09:06:48 +02:00
Lars Schumann
78b6789475 mwan3: allow to change mwan3's MARKing mask
Signed-off-by: Lars Schumann <larsi.org@gmail.com>
2017-08-04 14:21:50 -04:00
Marcin Jurkowski
de4fc2b5de mwan3: support various interface tracking methods
Adds support for interface tracking using either ping, arping or
httping. This allows to track interface status on networks with filtered
ICMP traffic or simply to monitor data link layer etc.

To facilitate binding to a specified interface its IP address is passed
as a new mwan3track parameter. It's currently required by httping
and possibly by other tools that may be added in the future.

Signed-off-by: Marcin Jurkowski <marcin1j@gmail.com>
2017-08-02 17:44:07 +02:00
Florian Eckert
085a76bebf net/mwan3: update version
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-06-22 13:42:14 +02:00
Florian Eckert
99229475b7 net/mwan3: simplify tracking status statement command
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-06-22 13:42:14 +02:00
Florian Eckert
b6e9debc1b net/mwan3: add lock for mwan3 hotplug script
If more then one interface get up/down at once mwan3 could be in a
undefined state, because more then one mwan3 hotplug script are running
and editing the iptables.

Lock the critical section should solve this issue.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-06-22 13:42:12 +02:00
Florian Eckert
f35475c025 net/mwan3: update Makefile version
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-05-12 15:30:34 +02:00
Florian Eckert
db5ea39c9b net/mwan3: generate mwan3track run path folder on every run
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-05-12 15:30:34 +02:00
Florian Eckert
ef3261d0b4 net/mwan3: remove absolute path for bin files
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-05-12 15:28:12 +02:00
Florian Eckert
1fd3f85d4f net/mwan3: remove pid file use pgrep to get pid
If mwan3track will not stop immediately after sending the kill signal,
the clean_up handler will delete the pid file later while the new mwan3track is
already running.

This could result in a situation that mwan3track is running
more then once because the old mwan3track service could not be killed,
because the pid file is missing.

Using pgrep to kill all mwan3track for the tracked interface and not using
pid file should fix this issue.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-05-12 15:28:12 +02:00
Florian Eckert
c8f8f77ed1 net/mwan3: update Makefile version
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-04-27 11:48:15 +02:00
Florian Eckert
f94975b71f net/mwan3: add connected network regardless of mwan3 interface enable state
If netifd set an interface up/down which is not tracked by mwan3 the
connected network of that interface should regardless be added/removed to the
mwan3_connected ipset.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-04-27 11:44:49 +02:00
Florian Eckert
45437dc7c9 net/mwan3: update Makefile version
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-04-11 09:46:20 +02:00
Florian Eckert
7e80e83dfd net/mwan3: mwan3track interrupt sleep on signal (trap) event
Sleep will be aborted if a signal is send to this process.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-04-11 09:46:20 +02:00
Florian Eckert
b216fd3642 net/mwan3: registrate SIGUSR1 trap on interface down event
If interface is getting down by netifd (unplug ethernet cable)
mwan3track will not recognize this change. It will also generate an
additional down event when he notice does his tracking interface is offline.

Mwan3track will now be informed by a signal (trap) USR1 during down event
that the interface is already down. An additional down event will not be
generated.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-04-11 09:46:20 +02:00
Florian Eckert
84df06e0dc net/mwan3: add status track ubus interface
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-04-11 09:46:20 +02:00
Florian Eckert
4d8d889ced net/mwan3: update Makefile version
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-04-05 07:29:45 +02:00
Florian Eckert
6bb84f69e7 net/mwan3: decrease parameter invocation of mwan3track
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-04-05 07:29:45 +02:00
Florian Eckert
5b55223d80 net/mwan3: add clean_up trap function for SIGINT SIGTERM
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-04-04 16:00:06 +02:00
Florian Eckert
51367883fc net/mwan3: unify logging in mwan3track
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-04-04 15:33:37 +02:00
Florian Eckert
23339d7ae1 net/mwan3: move global mwan3track into main function
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-04-04 15:01:34 +02:00
Florian Eckert
ae335e7384 net/mwan3: add failure and recovery interval
If mwan3track detects a failure the interval check will change to
"failure_interval" value until this interface is declared "offline".
After interface gets "offline" normal "interval" value is used again.
If interface ping is successful again "recovery_interval" value is used until
interface is declared "online" again.

Using the different intervals will accelerate the wan line detections on
failure and recovery.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-03-27 08:45:13 +02:00
champtar
499ec98653 Merge pull request #4174 from TDT-GmbH/mwan3-add-ubus-check
net/mwan3: add ubus interface check
2017-03-24 11:54:19 -07:00
Florian Eckert
5cacfd34a6 net/mwan3: add ubus interface check
On interfaces with interface proto "qmi|ncm" and option dhcp
enabled the interface will be changed to $iface_4 | $iface_6. The
interface mapping in mwan3 will not recognize this interface. To fix
this issue an ubus call will check if an upper interface exists.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-03-21 08:59:31 +01:00
Florian Eckert
3f79fcb756 net/mwan3: pass environment variables to mwan3-user
User scripts conversion from luci-app-wan3 will be simplified if the variables
are passed by env instead of arguments.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-03-21 08:31:06 +01:00
Hannu Nyman
46a2a6bf05 Merge pull request #4171 from TDT-GmbH/mwan3-change-maintainer
net/mwan3: change maintainer
2017-03-20 11:00:20 +02:00