interface: add prefix assignment priority support In case of prefix delegation prefixes are assigned to one or more configured downstream interfaces. The delegated prefix length in combination with the assignment length of the downstream interfaces determines the number of subnets which can be allocated from the delegated prefix. The interface ip6weight parameter allows to prioritize the allocation of subnets to interfaces in case of multiple configured downstream interfaces. The order of interface prefix assignment from a delegated prefix is based on the following parameters: - Primary key is prefix assignment based on the configured interface ip6hint - Secondary key is the requested downstream interface prefix length, interfaces configured with the smallest ip6hint will be assigned first - Third key is the assigned interface ip6weight in case of equal prefix assignment length; interfaces having the highest ip6weight will be assigned first - Finally the alphabetical order of the interfaces in case of equal ip6weight Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup]
interface-ip: route proto config support (FS#170) Route proto support is usefull when using route distribution via a routing daemon. The route proto parameter can be specified via the route proto uci config parameter, it can hold a numerical value or the string values unspec, kernel, boot, static or a string present in /etc/iproute2/rt_protos. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
interface-ip: fix subnet route handling When the kernel subnet route has to be replaced, the cleanup call needs to match the properties of the replacement route exactly, mainly the metric and the routing table. Fix handling this by embedding the device_route for the subnet in the device_addr struct and using it in the cleanup path. This fixes issues on config reload with changes to the routing table Signed-off-by: Felix Fietkau <nbd@openwrt.org>
interface-ip: move struct device_addr below struct device_route This is needed to embed the subnet route in struct device_addr Signed-off-by: Felix Fietkau <nbd@openwrt.org>
interface-ip: Support source ip rule updates when reloading
netifd: Make interface identifier of delegated IPv6 address configurable The ip6ifaceid UCI interface parameter makes the interface identifier of the delegated IPv6 address configurable. The parameter can have the following values: eui64 : Interface identifier is generated from the interface's MAC address random : Interface identifier is generated randomly fixed value : Interface identifier is a fixed value (eg ::1:2) The latter is the default value with a fixed value of ::1 for backwards compatibility Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Signed-off-by: Joeri Barbarien <joeri.barbarien@gmail.com>
netifd: Route type support Patch adds route type support in netifd by means of the route parameter type. By default the route type was unicast; the parameter adss support for local/broadcast/multicast/unicast routes which will be put into the appropriate routing table. If route type parameter is unset the route type will be unicast as before. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Add support for onlink-flags for IPv4 routes Signed-off-by: Steven Barth <steven@midlink.org>
Don't always assume routes & addresses are applied Actually check netlink return values and remember failure. Signed-off-by: Steven Barth <steven@midlink.org>
IPv6: add class support to regular IPv6 addresses
Add source-restricted routes
config: use the new uci_blob library code Signed-off-by: Felix Fietkau <nbd@openwrt.org>
move excluded prefix and length out of key for device_prefix
IPv6: reorganize prefix assignment * put parameters in a more suitable place * add support for prefix classes
Add option to define target routing table for protocol routes. This unifies source-routing for both IPv6 and IPv4 (default off). Based on a patch by Kristian Evensen
Add support for IPv6 and interface target-routes & dependencies Signed-off-by: Steven Barth <steven@midlink.org>
IPv6: Use source-routing to allow multi-wan
Incorperate route table into avl key
Implement support for route / route6 table attribute
Rewrite IPv6 prefix assignment