Commit graph

144 commits

Author SHA1 Message Date
Florian Eckert
8b28ab282b net/mwan3: update version to 2.7.5
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-23 15:18:45 +02:00
Florian Eckert
be91e71805 net/mwan3: add online_metric for local_source none
If we set the option "local_source" in the globals mwan3 section to "none",
traffic generated by the router it self will always use the default route from
the wan interface with the lowest metric. If this interface is down
the router traffic still uses the connection with the lowest metric but
this is disconnected. Load balancing and failover from the lan site is
still possible. Only router generated traffic is not load balanced and
could not use failover.

To solve this issue with router initiated traffic add the additional
option "online_metric" to the mwan3 interface section.

If the interface is connected then this lower "online metric" is set in the
default routing table.

With this change we have at least a failover with router initiated
traffic.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-23 15:00:11 +02:00
Florian Eckert
181174b64b net/mwan3: add dynamic ipsets to mwan3_connected ipsets
During runntime of mwan3 we could add dynamicly networks to this ipset
which would then treated as connected networks by mwan3.

This is also usefull for ipsec.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-23 14:57:33 +02:00
Florian Eckert
dcb7ad17ba net/mwan3: add custom address from ip tables to connected ipset
With the list param "rt_table_lookup" in the mwan3 section globals,
it is now possible to add a additional routing table numbers which would get
also parsed and will be added to the connected network.
So mwan3 will treat them as they are directly connected to this device.

This could be usefull if we use ipsec.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-23 14:49:34 +02:00
Florian Eckert
1335e4f3dd net/mwan3: cleanup egrep ipv6 regex
The IPv6 egrep regex is confusing and hard to maintain.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-23 14:47:50 +02:00
Florian Eckert
84007a2723 net/mwan3: enhance ipset status generation
This change should optimize and speed up the status output generation.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-23 14:47:10 +02:00
Florian Eckert
ac8c4512d1 net/mwan3: reduce duplicate code
The generation for reporting the policies uses the same code add a
common function to reduce duplication.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-23 14:44:29 +02:00
Florian Eckert
952f3e1361 net/mwan3: cleanup/prettify 80 characters code boundary
Prettify and cleanup source

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-23 14:43:37 +02:00
Florian Eckert
eeef66cec2 net/mwan3: update version to 2.7.4
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-12 08:15:38 +02:00
Florian Eckert
1ee9fb4aff net/mwan3: add downtime ubus information
Get downtime information for the tracked mwan3 wan interfaces.
The information shows how long this interface is in disconnected state.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-12 08:15:36 +02:00
Florian Eckert
1236003733 net/mwan3: add uptime ubus information
Get uptime information for the tracked mwan3 wan interfaces.
The information shows how long this interface is in connected state.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-12 08:15:33 +02:00
Florian Eckert
3a5c3e03e2 net/mwan3: also add the metric to the default interface routing table
This is now the same route as in the main table.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-10-12 08:13:46 +02:00
Kyson Lok
8c0ed00c39 net/mwan3: fixup parse json_load an null message
If a interface is down, call ubus will return an null message which is
used to json_load, it causes json_get_vars gets value from last load and
l3_device various is nonzero.

Signed-off-by: Kyson Lok <kysonlok@gmail.com>
2018-10-12 08:13:42 +02:00
Chen Minqiang
dbebe3d6f9 net/mwan3: update version to 2.7.3
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2018-10-10 15:54:42 +08:00
Chen Minqiang
8ae2889674 mwan3: rtmon: filter out linkdown routing table
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2018-10-10 07:30:47 +08:00
Florian Eckert
692ed62382 net/mwan3: update version to 2.7.2
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-09-24 10:21:43 +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
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