Add a new attribute for B.A.T.M.A.N. advanced interfaces to control the
B.A.T.M.A.N. advanced routing algorithm to be used when setting up new
interfaces. As the routing algorithm must be set before an interface is
created, it needs special handling and can't be implemented as a common
attribute. D'oh.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Tested-by: Annika Wickert <aw@awlnx.space>
In case of an IPv4 pointopoint setup like the following
auto eth0
iface eth0
address 10.0.0.1/32
pointopoint 10.1.2.3
gateway 10.1.2.3
the configuration would only be correct on the first configuration attemp
by ifupdown2 (read: after systemctl [re]start networking). After any ifup
or ifreload -a the default route would be gone rendering the host offline.
The problem is within an internal comparison between the configured IP on
the interface - read by iproute2 - and the one configured as iproute will
show a pointopoint address without a netmask, but the configuration holds
a /32 mask. This patch will ensure that every address read is represented
in CIDR notation to avoid this issue.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Create all tunnels - except gretap - with 'ip tunnel', as this supports
most tunnel modes; create gretap tunnels with 'ip link'.
Rework the whole concept of tunnel updates and make sure a tunnel only is
changed - recreated - IFF the configuration has changed. In previos code
'tunnel change' was called on every _up() call. The 'tunnel change' part
was removed completely as it doesn't work on many occations. So IFF the
tunnel related interface configuration has changed, the tunnel is removed
and recreated.
fixes#78
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Latest additions added a bunch of new tunnel modes but didn't add support
to read in these modes which breaks 'ifquery' as it falsely marks the mode
as 'fail'.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This patch also fixes a problem where dhcp6 used to create lease file with
a trailing whitespace. dhcp6 operation were also sometimes using the wrong
pid file. I added some code in the debian.postinst script to correctly
rename these files if they exists when we install/update ifupdown2.
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
$ cat /etc/network/interfaces
auto v0
iface v0
link-type veth
vrf blue
auto blue
iface blue
vrf-table auto
$ ifreload -a
$ echo $?
0
$ ifquery -a -c
auto v0
iface v0 [pass]
link-type veth [pass]
vrf blue [pass]
auto blue
iface blue [pass]
vrf-table 1001 [pass]
$ echo $?
0
Reported-by: Maximilian Wilhelm <max@rfc2324.org>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
backported from master branch.
Pass the same environment variables to addon scripts from /etc/network/
as are passed to user defined commands in interfaces stanzas. This is
needed for compatibility with ifupdown.
Fixes: #14
Reviewed-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Gaudenz Steinlin <gaudenz@users.noreply.github.com>
This simple patch allows the creation of bridges which should be set up
without any ports, like a bridge for virtual machines on a hosting box.
With this patch ifupdown2 get's a step closer to feature parity and
compatiblity with ifupdown1.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
This commit adds support to configure and check gretap tunnels. An example
configuration could look like this:
iface tap0 inet tunnel
mode gretap
local 10.132.255.3
endpoint 10.132.255.1
ttl 64
mtu 1400
tunnel-physdev eth0
#
address 10.10.0.1/2
ifup will happily configure the interface (which it does even without this
patch) and ifquery now can successfully validate the configure interface:
cr03.in.ffho.net:~# ifquery -c tap0
iface tap0 inet tunnel [[ OK ]]
tunnel-physdev eth0 [[ OK ]]
endpoint 10.132.255.1 [[ OK ]]
local 10.132.255.3 [[ OK ]]
mode gretap [[ OK ]]
ttl 64 [[ OK ]]
mtu 1400 [[ OK ]]
address 10.10.0.1/24 [[ OK ]]
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
* addons: batman_adv: Rework B.A.T.M.A.N. adv. attribute handling.
This commit reworks the internal handling of B.A.T.M.A.N. adv. attributes
within the plugin. The new approach on setting and checking attributes is
more generic and allows adding more B.A.T.M.A.N. adv. which should be set
as attributes of an B.A.T.M.A.N. adv. interface in a simple way.
This commit does not introduce any changes visibile to the user.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
* addons: batman_adv: Add support for more B.A.T.M.A.N. adv. attributes.
This commit adds supports for setting the following optional attributes:
* gw-mode (one of { off, client, server })
* multicast-mode (can be 'enabled' or 'disabled')
* distributed-arp-table (cat be 'enabled' or 'disabled')
Example config:
pandora:~# ifquery -c bat-foo
iface bat-foo [pass]
batman-ifaces dummy-bat [pass]
batman-ifaces-ignore-regex [pass]
batman-hop-penalty 7 [pass]
batman-multicast-mode enabled [pass]
batman-distributed-arp-table enabled [pass]
batman-gw-mode client [pass]
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Due to a simple logic bug the 'pointopoint' attribute was ignored when
specifying and address as <ip/mask> and only considered when IP and mask
where given seperately. This commit fixes this behaviour.
When configured in ptp mode »ip addr« will show the IP address without a
netmask which will make »ifquery -c« mark the IP as failed. The check has
been fixed, too.
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Ticket:
Reviewed By: Roopa
Testing Done:
Debian Bug#855401, we didn't list pkg_resource as a dependency so the
installation is failing for upstream users.
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit adds support for configuring GRE/IPIP/SIT tunnel interfaces as know
from previous versions of ifupdown. Currently only configuration checks for GRE
and SIT tunnels are implemented.
A tunnel interface configuration could look like this:
auto gre42
iface gre42 inet tunnel
mode gre
local 198.51.100.1
endpoint 203.0.113.2
#
# optional tunnel attributes
ttl 64
mtu 1400
tunnel-physdev eth0
#
address 192.0.2.42/31
address 2001:db8:d0c:23::42/64
auto he-ipv6
iface he-ipv6 inet tunnel
mode sit
endpoint 203.0.113.6
local 198.51.100.66
#
# optional tunnel attributes
ttl 255
mtu 1466
tunnel-physdev vrf_external
#
address 2001:db8:666::2/64
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
The option »veth-peer-name« forces an veth peer link to be created with
a specific interface name. As the interface name of the "local" part of
the veth link pair already is defined by the name of the interface stanza
this option is added to, now both sides are clearly named.
As there is a bidirectional dependency of both link pairs - both cannot
exist without the other - this presents a problem when setting up all
interfaces. Depending on which interface is set up first there might be
a problem when only on dependency is specified. Therefore adding the
»veth-peer-name« option to both interface of the veth link pair ensures
that regardless of which side is configured first the peer name will be
set correctly. This intentionally creates a circular dependency which is
handled accordingly.
Fixing the config check for veth link-type while at it :)
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>