summaryrefslogtreecommitdiff
path: root/interface-ip.h
Commit message (Collapse)AuthorAgeFilesLines
* interface-ip: add support for excluding interfaces in host route lookupFelix Fietkau2022-05-191-1/+2
| | | | | | | | When adding host routes needed for an interface to communicate, it may be necessary to skip the interface itself, in case it provides a default route. This helps with avoiding accidental loops Signed-off-by: Felix Fietkau <nbd@nbd.name>
* device_addr: record address index as in the blobYousong Zhou2020-10-221-0/+1
| | | | | Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
* add basic support for jail network namespacesDaniel Golle2020-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prepare netifd for handling procd service jails having their own network namespace. Intefaces having the jail attribute will only be brought inside the jail's network namespace by procd calling the newly introduced ubus method 'netns_updown'. Currently proto 'static' is supported and configuration changes are not yet being handled (ie. you'll have to restart the jailed service for changes to take effect). Example /etc/config/network snippet: config device 'veth0' option type 'veth' option name 'vhost0' option peer_name 'virt0' config interface 'virt' option type 'bridge' list ifname 'vhost0' option proto 'static' option ipaddr '10.0.0.1' option netmask '255.255.255.0' config interface 'virt0' option ifname 'virt0' option proto 'static' option ipaddr '10.0.0.2' option netmask '255.255.255.0' option gateway '10.0.0.1' option dns '10.0.0.1' option jail 'transmission' Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* interface: add neighbor config supportmeurisa2019-04-151-1/+19
| | | | | | | | | | | | | | | | | | The neighbor or neighbor6 network section makes neighbours configurable via UCI or proto shell handlers. It allows to install neighbor proxy entries or static neighbor entries The neighbor or neighbor6 section has the following types: interface : declares the logical OpenWrt interface ipaddr : the ip address of the neighbor mac : the mac address of the neighbor proxy : specifies whether the neighbor ia a proxy entry (can be 1 or 0) router : specifies whether the neighbor is a router (can be 1 or 0) Signed-off-by: Alexander Meuris <meurisalexander@gmail.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface-ip: fix delegate config update on reload (FS#2087)Hans Dedecker2019-03-131-0/+1
| | | | | | | | Update the no_delegation parameter on a config reload; in case prefixes are present update the prefix assignments as well according to the no_delegation status Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* treewide: switch to C-code style commentsHans Dedecker2018-11-191-1/+1
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* treewide: make some functions staticHans Dedecker2018-11-191-1/+0
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* interface: add prefix assignment priority supportHans Dedecker2017-02-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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)Hans Dedecker2017-01-251-2/+3
| | | | | | | | | | | 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 handlingFelix Fietkau2015-12-151-0/+2
| | | | | | | | | | | | 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_routeFelix Fietkau2015-12-151-20/+20
| | | | | | 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 reloadingHans Dedecker2015-09-291-0/+1
|
* netifd: Make interface identifier of delegated IPv6 address configurableHans Dedecker2015-01-191-0/+1
| | | | | | | | | | | | | 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 supportHans Dedecker2014-06-181-0/+4
| | | | | | | | 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 routesSteven Barth2014-06-101-0/+3
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* Don't always assume routes & addresses are appliedSteven Barth2014-02-261-0/+2
| | | | | | Actually check netlink return values and remember failure. Signed-off-by: Steven Barth <steven@midlink.org>
* IPv6: add class support to regular IPv6 addressesSteven Barth2013-11-271-0/+1
|
* Add source-restricted routesSteven Barth2013-10-181-0/+11
|
* config: use the new uci_blob library codeFelix Fietkau2013-06-101-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* move excluded prefix and length out of key for device_prefixSteven Barth2013-05-311-2/+2
|
* IPv6: reorganize prefix assignmentSteven Barth2013-05-301-1/+3
| | | | | * put parameters in a more suitable place * add support for prefix classes
* Add option to define target routing table for protocol routes.Steven Barth2013-05-171-1/+0
| | | | | | 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 & dependenciesSteven Barth2013-05-131-1/+1
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* IPv6: Use source-routing to allow multi-wanSteven Barth2013-05-111-0/+4
|
* Incorperate route table into avl keyJo-Philipp Wich2013-04-051-1/+1
|
* Implement support for route / route6 table attributeJo-Philipp Wich2013-04-041-0/+4
|
* Rewrite IPv6 prefix assignmentSteven Barth2013-04-031-13/+14
|
* Improved IPv6 featuresetSteven Barth2013-02-011-3/+7
| | | | | | | * Fix reloading of ula-prefixes * Added support for temporary addresses and routes * Added support for offlink addresses * Improved status-output for assigned prefixes
* Initial IPv6 prefix supportSteven Barth2013-01-151-0/+33
| | | | Signed-off-by: Steven Barth <steven@midlink.org>
* interface-ip.{c,h}: add new flag DEVROUTE_MTU and set it for per-route mtu ↵Jo-Philipp Wich2012-06-291-1/+4
| | | | overrides
* replace the kernel's implicit network routes if the metric is setFelix Fietkau2012-05-201-1/+4
|
* parse point to point ip addressesFelix Fietkau2012-05-141-0/+1
|
* add copyright headersFelix Fietkau2012-05-041-0/+13
|
* add a ubus interface to dynamically create host routes to a particular ip ↵Felix Fietkau2012-05-041-1/+3
| | | | address, returns the interface that the route goes through
* store a pointer to the active interface as part of the device routeFelix Fietkau2012-04-301-0/+1
|
* include route/address flags in vlist comparisonFelix Fietkau2012-04-291-3/+2
|
* add support for updating route metricsFelix Fietkau2012-03-191-1/+1
|
* add a flag to keep track of route metric overridesFelix Fietkau2012-03-191-0/+3
|
* always create device routesFelix Fietkau2012-03-151-3/+0
|
* move broadcast address handling to the coreFelix Fietkau2012-02-261-0/+3
|
* remove device_{route,addr}->deviceFelix Fietkau2012-02-261-3/+0
|
* use the simplified vlist type for dns servers/searchFelix Fietkau2012-01-151-2/+2
|
* add support for configuring static routesFelix Fietkau2011-10-191-0/+2
|
* rework route handling, move parser code to interface-ip.c, add extra options ↵Felix Fietkau2011-10-191-0/+9
| | | | and add further support for pulling routes from config
* add support for keeping multiple ip addr/route/dns listsFelix Fietkau2011-10-191-7/+9
|
* proto-shell: add dns search domainsFelix Fietkau2011-10-141-0/+1
|
* proto-shell: fix updating settings, only issue ifup event after ↵Felix Fietkau2011-10-131-0/+4
| | | | configuration has been applied
* add functions for adding dns servers to the proto list, hook them up in ↵Felix Fietkau2011-10-131-0/+2
| | | | proto-static.c
* add some code for keeping track of dns servers and search domains and for ↵Felix Fietkau2011-10-111-0/+13
| | | | writing resolv.conf
* make versioned lists more flexible by using an external comparatorFelix Fietkau2011-10-021-2/+5
|