Commit Graph

328 Commits

Author SHA1 Message Date
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 d338131f40 net/mwan3: mwan3track should also send disconnected action on signal USR1
Also send disconnected action on system signal USR1.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-09-24 10:20:35 +02:00
Florian Eckert c9d8fceb63 net/mwan3: add ttl check
Add the additional optional ttl check to test the connection.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-09-24 10:20:35 +02:00
Chen Minqiang 6a5836db32 mwan3: optimize the process of copying routing tables
- The original copy process is to delete all routing tables first,
   then add new routing table. This process is too slow and very dirty.
 - We use grep to identify the changes and apply them.
 - ignore ipv6 unreachable routes
 - update version number

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2018-09-21 15:35:39 +08:00
Chen Minqiang 9e75edcf2c mwan3: fix missing device in mwan3_set_policy()
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2018-08-29 22:54:42 +08:00
Chen Minqiang 7817aced2b mwan3: mwan3rtmon sleep time configurable
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2018-08-09 05:06:17 +08:00
Chen Minqiang 46ed09408e mwan3: refine link selection
- globals src_ip to none
 - ip route back to source
 - add mwan3rtmon
 - update version to 2.7

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2018-08-09 05:06:17 +08:00
Florian Eckert b6249f1781 net/mwan3: fix NDP on ipv6 for ra services
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-06-06 10:41:38 +02:00
Florian Eckert acf7278fb8 net/mwan3: update version to 2.6.17
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-30 12:57:49 +02:00
Florian Eckert 7ea690ea3c net/mwan3: fix update on connected ip networks
If an interface is not tracked by mwan3 or enabled and this interface is
setup by netifd, then the connected ipset is not update by mwan3.
To fix this also call connected ipset update code even if the interface
is not tracked or enabled by mwan3.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-30 12:56:50 +02:00
Florian Eckert 18022993d9 net/mwan3: update version to 2.6.16
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-16 11:24:37 +02:00
Florian Eckert ab4e62b885 net/mwan3: execute only ifup event if l3_device is found
Only execute an ifup event with the command "mwan3 ifup <iface>" if the
l3_device is found in the ubus "network.interface.<iface>".

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-16 11:21:25 +02:00
Florian Eckert 215708a415 net/mwan3: remove logging mwan3track pid is not found
Remove unnecessary logging if mwan3track pid is not found

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-16 11:20:32 +02:00
Florian Eckert 2d9dfa3b1b net/mwan3: add/remove src_ip from routing table
Add or remove local_source ip also if mwan3 is stopped or started

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-16 11:19:24 +02:00
Florian Eckert 0d5dd6da4f net/mwan3: add missing local variables
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-11 09:00:57 +02:00
Florian Eckert bdff2e990b net/mwan3: remove check_quality option from default config
The normal situation should be to use ping without quality_check.
If quality_check option is not set in the default option then ping
quality_check is not performed during tracking. This is and should
be the default situation.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-11 08:46:57 +02:00
Florian Eckert 21c42901e1 net/mwan3: update logging output
Unify logging output for tracking methode ping.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-11 08:46:40 +02:00
Florian Eckert 3b33e01791 net/mwan3: fix indentation
Fix indentation.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-11 08:43:34 +02:00
Florian Eckert 7962bfd3df net/mwan3: replace legancy backticks
Replace legancy backticks syntax shell execution with braces.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-11 08:42:53 +02:00
Florian Eckert 5f068b7fb3 net/mwan3: remove needless log output on mwan3track
Remove needless log output this will pollute the logging.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-11 08:42:17 +02:00
Nishant Sharma 1a33492ff8 mwan3: Packet Loss & Latency Check
1. Test link quality based on packet loss & latency w.r.t. pre-defined high and low watermark values.
2. Extended ubus support to provide packet loss & latency information per wan per track_ip

Signed-off-by: Nishant Sharma <codemarauder@gmail.com>
2018-05-11 08:21:28 +02:00
Florian Eckert 6b0a65b183 net/mwan3: update version to 2.6.14
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-04-12 11:22:26 +02:00
Florian Eckert 6f96e30829 mwan3: in ubus rpcd script fix shell local issue
To fix the shell local issue in the ubus mwan3 rpcd shell script, move
the switch case statment into a function.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-04-12 10:27:02 +02:00
Florian Eckert 1c520db1f7 net/mwan3: update version to 2.6.13
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-04-08 16:20:24 +08:00
Florian Eckert f8cf485212 net/mwan3: also send connected action on initial_state offline
Move action into startup section will fix this.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-04-08 16:20:24 +08:00
Florian Eckert 1eae1ae3e7 net/mwan3: add logging on ping success and fail
Add logging information during state change on ping success or fail

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-04-08 16:20:24 +08:00
Luiz Angelo Daros de Luca e6e65f3e54 mwan3: ipv6-compatible default conf
Considering that ipv6 NPT/NAT/NETMAP is done manually by user,
mwan3 can balance ipv6 interfaces as it does with ipv4.

Interface wan2 was renamed to wanb as wan2, wan3, ... will eventually
colide with OpenWrt with default wan6 interface when more than 6
interfaces are in use.

New interfaces, members for wan6 and wanb6 where created, both disabled
by default. Policies where adapted as well.

The option "family" is set respectively in each interface. When missing,
mwan3 assumes ipv4, that will fail when interface is IPv6 only.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2018-04-03 13:35:28 -03:00
Rob White dc746a55a1
mwan3: Add missing globals config section
Add missing globals config section with default values.
Without the correctly named section, mwan3 startup will fail with the error - Warning: mwan3 is global disabled. Usage: /etc/init.d/mwan3 start.
Compile: not required
Run tested: LEDE 17.01.04
Author-name: Rob White
Maintainer: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Rob White <rob@blue-wave.net>
2018-04-01 10:04:46 +01:00
Florian Eckert 7c641a3d03 net/mwan3: update version to 2.6.12
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-03-29 14:58:02 +02:00
Florian Eckert 704ec2b064 net/mwan3: set default mask to 0x3F00
The IPsec ip route table has the default number 220.
If mwan3 has more then 7 bits set (124 interfaces) then if mwan3 down is
executed the table is also cleared. To solve this set default max 7
bits in the mmx_mask for mwan3.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-03-29 14:51:36 +02:00
Hannu Nyman 759ee14f41 mwan3: adjust dependency from ip-full to ip
Adjust the dependency from ip-full back to ip.

Returning back to "ip" is now possible as busybox does not provide
"ip" any more, making "ip" again reference to ip-tiny or ip-full.

Reference to discussion in #5747

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-03-23 16:52:27 +02:00
Florian Eckert 3c2e05d440 net/mwan3: update version to 2.6.11
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-03-16 14:45:29 +01:00
Florian Eckert ae70008ed7 net/mwan3: update hint in mwan3.user for connected/disconnected
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-03-16 14:45:29 +01:00
Florian Eckert 270245e6d4 net/mwan3: deviate max interface value from mmx_mask value
We need always three of the firewall mask value for
* default routing table
* blackhole
* unreachable
the other will be used for the interfaces.

* If we have set the mmx_mask to max 0xFF00 (8 bit set) we could use max 252
  interfaces.
* If we have set the mmx_mask to min 0x0E00 (3 bit set) we could use max 4
  interfaces.

Only the ones are counting from the firewall mask value.
Minimal three firewall mask bit vaules must be set.
Maximal eight firewall mask bit vaules could be set.

Table overview mmx_mask value bits vs. max interfaces

mmx_mask value bits set 1 -> not usefull
mmx_mask value bits set 2 -> not usefull
mmx_mask value bits set 3 ->   4 Interfaces (mask example 0x0E)
mmx_mask value bits set 4 ->  12 Interfaces
mmx_mask value bits set 5 ->  28 Interfaces
mmx_mask value bits set 6 ->  60 Interfaces
mmx_mask value bits set 7 -> 124 Interfaces
mmx_mask value bits set 8 -> 252 Interfaces (mask example 0xFF)

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-03-16 14:45:29 +01:00
Florian Eckert 7c178353f0 net/mwan3: remove unused local variables
Remove unused local variables

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-03-16 14:45:29 +01:00
Florian Eckert 4f1e85bd8c net/mwan3: add connected/disconnected ACTION to mwan3track
Add a new ACTIONs:

* connected ACTION is called once if mwan3track reach all configured track_ips
* disconnected ACTION is called once if mwan3track is unable to reach the track_ips

The connected/disconnected will called only by mwan3track in opposite
the ACTIONs ifup/ifdown will also be called by netifd.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-03-16 14:44:04 +01:00
Florian Eckert e12f3c8c14 net/mwan3: add jshn and ip-full to package dependency
* The mwan3 scripts sources ". /usr/share/libubox/jshn.sh"
* Mwan3 only works if ip-full is installed
  Error -> "ip: invalid argument '0xfd00/0xff00' to 'fwmark'"

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-03-12 10:14:36 +01:00
Florian Eckert 40f66cf432 net/mwan3: update to version 2.6.10
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-02-05 10:29:30 +01:00
Florian Eckert 8fa2101ea3 net/mwan3: add mwan3_init function
Move all shell commands which are executed during /lib/mwan3/mwan3.sh
sourceing into a seperate init function which must be called at first.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-02-05 10:29:28 +01:00
Florian Eckert 7cf9d9ec20 net/mwan3: send SIGKILL to mwan3track
In some situation it is not enough to send a SIGTERM to mwan3track to
ask service to stop accurate. If this does not work send him a SIGKILL
to prevent mwan3track running more then once per interface.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-02-05 10:29:25 +01: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
Jakub Janco 349b90cc24 mwan3: Improve logs when member metric is too big
If metric of member interface is bigger then 256, it is not
appended to policy, now at least warn message is printed into
syslog

Signed-off-by: Jakub Janco <kubco2@gmail.com>
2017-12-07 15:41:59 +01:00
Florian Eckert c33853dd6d net/mwan3: update to version 2.6.8
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-11-22 13:04:14 +01:00
Florian Eckert 3ee70a7001 net/mwan3: change usleep to sleep command
fix bug use sleep instead of usleep

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-11-16 09:15:28 +01:00
Florian Eckert 267c0eeaed net/mwan3: use uptime for ubus age info
If the date is changed by ntp the age value of mwan3 on ubus could jitter.
Use instead the uptime value from /proc/uptime which will not change during
system run.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-11-16 09:15:04 +01:00
David Yang 6f0a88f1ed mwan3: update to version 2.6.7
Signed-off-by: David Yang <mmyangfl@gmail.com>
2017-11-08 23:22:04 +08:00
David Yang 474e6bbdd7 mwan3: add check for ping
Signed-off-by: David Yang <mmyangfl@gmail.com>
2017-11-08 16:14:53 +08:00
David Yang e094212b17 mwan3: reduce dependency on src_ip
Interfaces may be managed by 3rd-party scripts, thus src_ip may not be
always available in uci.

Signed-off-by: David Yang <mmyangfl@gmail.com>
2017-11-08 16:14:52 +08:00
David Yang 6f38affd0c mwan3: fix empty gateway when creating routing table
Interfaces of some PtP protocols do not have a real gateway. In that
case ubus may fill them with '0.0.0.0' or even leave it blank. This
will cause error when adding new routing rule.

Signed-off-by: David Yang <mmyangfl@gmail.com>
2017-11-08 16:14:50 +08:00
David Yang 5688f3e65a mwan3: reduce unnecessary comparisons
Signed-off-by: David Yang <mmyangfl@gmail.com>
2017-11-08 16:14:46 +08:00
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
Florian Eckert 415c405061 net/mwan3: change maintainer
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-03-20 08:48:16 +01:00
Florian Eckert 75a5237029 net/mwan3: fix track_ips count
fix track_ips generation introduced with commit
6d44a7679a

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-03-20 08:39:18 +01:00
Hannu Nyman 037e469bde Merge pull request #4158 from TDT-GmbH/mwan-fix-hotplug
net/mwan3: fix hotplug on ACTION ifdown
2017-03-18 16:28:16 +02:00
Florian Eckert 43ca6ec481 net/mwan3: add mwan3.user hotplug script
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-03-17 12:33:45 +01:00
Florian Eckert 28c8b664e4 net/mwan3: fix hotplug on ACTION ifdown
On dynamic interface proto (dhcp/pppoe) the hotplug will not execude (exit 9)
because the gateway is already released. The check will now only be made
on a ifup ACTION event.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-03-17 11:06:29 +01:00
Florian Eckert 6d44a7679a net/mwan3: add ping size option to mwan3track
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-03-16 10:01:07 +01:00
Florian Eckert 3231736cab net/mwan3: reset conntrack table on iface up/down event
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-03-16 10:01:06 +01:00
Florian Eckert ec3349a8a4 net/mwan3: add me as co maintainer
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2017-03-08 10:42:36 +01:00
Jo-Philipp Wich a67e66c280 mwan3: remove bad local shell variable declarations
Local variable declarations outside of functions are illegal since the Busybox
update to v1.25.0, therfore remove them from the appropriate places.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-09-24 14:47:38 +02:00
Florian Eckert bd43ab0fce mwan3: fix mwan3track whitespace typo
Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com>
2016-07-21 13:25:04 +02:00
Florian Eckert bcad673643 mwan3: fix mwan3 help whitespace typo
Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com>
2016-07-21 13:24:59 +02:00
Jeroen Louwes 05eaec986b mwan3: update to version 2.0-2
Fix iptables issue where a needed ipset was not created if first wan that came online was not a member of policy.

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2015-12-21 16:50:59 +01:00
Jeroen Louwes 725cfe6b8e mwan3: update to version 2.0-1
Fix issue with sticky sessions not working correctly
Fix issue where user created ipsets were not applied

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2015-12-17 12:11:50 +01:00
Jeroen Louwes 8ff00a6273 mwan3: update to version 2.0-0
IPv6 support! :D
Big code overhaul; expect bugs..

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2015-11-19 09:37:30 +01:00
Jeroen Louwes 5ca8b0227d mwan3: update to version 1.6-3
Fix for changed location ip binary

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2015-10-20 10:04:20 +02:00
Jeroen Louwes c7ef810f5f mwan3: update to version 1.6-2
Fix malformed uci commands. (issue #1502)

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2015-07-21 15:04:01 +02:00
Adze1502 74c9585abc mwan3: update to version 1.6-1
Add ipset support (ipset version >6.22 with ipmark required)
Add stickiness feature

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2015-03-17 19:57:49 +01:00
Adze1502 4ce8b48d65 mwan3: update to version 1.5-10
Fixed issue in mwan3 status output with mwan3 interfaces not yet configuerd in network config
Removed nexthop argument as it is no longer used

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2015-01-15 14:15:53 +01:00
Adze1502 1ff50d94dc mwan3: update to version 1.5-9
Fix issue where config file would be overwritten in some cases
Fix issue where local address of wan point-to-point links were unreachable from lan

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2014-12-22 08:44:41 +01:00
Adze1502 964a4ebe1f mwan3: update to version 1.5-8
Fix bug introduced in version 1.5-7; args were not parsed to script.

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2014-10-07 11:23:02 +02: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 61c60026f4 mwan3: update to version 1.5-6
Fixed issue where mwan3 would not immediately set interface down on link-loss event
Added feature to define last-resort action on policies with no members

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2014-09-25 11:27:54 +02:00
Adze1502 04c2fb4098 mwan3: update to version 1.5-4
Fix issue with more than one link route on a wan interface

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2014-09-09 11:20:02 +02:00
Adze1502 a018080060 mwan3: update to version 1.5-4
Fix issue #219: Policy status output returns arithmetic syntax error

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2014-08-21 09:10:21 +02:00
Adze1502 69a0b5814a mwan3: update to version 1.5-3
Better way of fixing the "icmp unreachable exits wrong interface" problem

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2014-08-14 13:58:41 +02:00
Adze1502 35d05cfebe mwan3: Update to version 1.5-2
Fix issue icmp unreachables go out wrong interface
Remove unnecessary line

Signed-off-by: Jeroen Louwes <jeroen.louwes@gmail.com>
2014-08-12 21:17:54 +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