Age | Commit message (Collapse) | Author |
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
Introduce jail_ifname option to define the name of a Linux network
interface when moved into a jail's network namespace.
This is useful for containers which expect the network interface to
have a specific name (eg. 'host0' in case of systemd).
While at it, clean-up and fix bugs in jail interface up/down routines.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|
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>
|
|
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|
blobmsg_check_attr() takes as second argument a bool; fix it where needed
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
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>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Integrate dynamic interface creation code into interface_alloc and
__interface_add so we can get rid of interface_set_dynamic
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Make sure the displayed prefix size is identical to the kernel installed
prefix size for local IPv6 prefix addresses
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Display the point-to-point IPv4 address as well when dumping
the IP address list in ubus.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Return the more approriate error code UBUS_STATUS_NOT_FOUND in case
network reload fails
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Check for main device and main device having default config for a dynamic
interface was orginally added in commit 266d92dd83bd5bfe520f3e2838794bf9bb827c07
with as purpose to set the device config. The latter was later removed in
commit 4bf89afc22b43d5bd155d32d3998348a77179c1a which makes the device checks
superfluous.
Also not all interfaces have a main device (eg tunnel interfaces) resulting
into netifd_add_dynamic returning an error code when such interfaces are added.
As an example 6rd interfaces dynamically added by the DHCP script the log
messages are cluttered with the trace 'wan (7803): Command failed: Unknown error'
after each DHCP renew.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Not all topology or connectivity changes may be detected by netifd,
depending on the underlying technology (e.g. VPN software); this adds a way
to explicitly trigger a renew.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Acked-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
The context is that we generate some of the UCI config
for netifd via scripts/programs.
Every once in a while, there's a goof when doing that
UCI generation, and netifd prints out the error at
stderr, but returns 0 (success) err-code.
This change will fail the ubus call if UCI config
is invalid or missing for /etc/config/network.
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
Acked-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
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]
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
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>
|
|
Display the IPv6 address obtained from a prefix assignment
as local-address element in the ubus ipv6-prefix-assignment
list so it's explicitly clear which IPv6 address from the
delegated prefix is assigned to interface.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Replace device_get by device_find in netifd_dev_status as device_get
will fail to find the device if it's created via config as an aliased
vlan device in dotted notation (eg @iface.200).
In such case get_vlan_device_chain will figure out the layer3 device
but get_vlan_device will not find the vlan device in the dependency
list of the layer 3 device as it has been created as a dependency of
the aliased device.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Interface name servers when being written to resolv.conf.auto are sorted
based on the following parameters:
-Primary sorting key is interface dns_metric; name servers having lowest
interface dns_metric are listed first
-Secondary sorting key is interface metric; in case of equal interface
dns_metric name servers having lowest interface metric are listed first
-Finally alphabetical order of the interface names in case of equal
interface dns_metric and metric
In case the resolver queries the multiple servers in the order
listed; sorting is usefull in the following scenarios :
-Name resolving over a main and backup interface
-Assign priority to IPv6 name servers over IPv4 or vice versa
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
- remove const from device handler struct
- pass device handler type to create function
Signed-off-by: Arne Kappen <akappen@inet.tu-berlin.de>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup]
|
|
Replace device_get by device_find so it's clear a device needs to be found present
in the device list.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
ubus
Interface update event will trigger an interface hotplug event and an ubus notify event
which will inform subscribers about the updated interface data field
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Steven Barth <steven@midlink.org>
|
|
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
Also remove obsolete "del_dynamic" call (use "down" instead)
Signed-off-by: Steven Barth <steven@midlink.org>
|
|
Signed-off-by: Steven Barth <steven@midlink.org>
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
device_config is unneeded since add_dynamic is used to create aliases
checking of setup state is unneeded because of race condition fixes
Signed-off-by: Steven Barth <steven@midlink.org>
|
|
Signed-off-by: Steven Barth <steven@midlink.org>
|
|
Signed-off-by: Steven Barth <steven@midlink.org>
|
|
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>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Adding an interface in the interface list in case of a config update will override the node version of the old interface and thus overriding the dynamic interface marker.
In case of config update interface_set_dynamic is done on an invalid interface pointer as the new interface pointer has been freed.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Made obsolete by b114b86c70766f67f503077ad1de013c17fbf366
This reverts commit 4d1a597f65bbb49aa843112812d5ca929478c706.
|
|
Signed-off-by: Steven Barth <steven@midlink.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Fix printing of route src mask attribute when it contains 3 digits
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
|
|
|
|
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Export ip4table/ip6table parameters via UBUS to facilitate
route inspection and usage by other applications
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
|
|
|
|
This allows foreign prefix delegators to quickly distinguish between
managed and unmanaged prefixes.
Signed-off-by: Steven Barth <steven@midlink.org>
|