Commit Graph

949 Commits

Author SHA1 Message Date
Julien Fortin 3ec9ce3fe3 Merge pull request #106 from BarbarossaTM/batman-routing-algo
addons: batman_adv: Add support to set B.A.T.M.A.N. advanced routing_algo
2019-05-22 02:04:31 +08:00
Maximilian Wilhelm 3864019c5c addons: batman_adv: Add support to set B.A.T.M.A.N. advanced routing_algo
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>
2019-05-21 17:20:07 +02:00
Julien Fortin c704ae5d2c Merge pull request #25 from BarbarossaTM/veth
Add option 'veth-peer-name' to veth links and ensure proper configuration
2019-01-16 14:14:18 +08:00
Julien Fortin f8f8cba7c2 Merge pull request #82 from BarbarossaTM/ptp-gw-fix
addons: address: Fix address check for pointopoint setups.
2018-11-01 19:53:03 +01:00
Julien Fortin 22ba670e63 Merge pull request #81 from BarbarossaTM/tunnel-fixes-debian-prep2
Tunnel fixes debian prep2
2018-11-01 01:10:04 +01:00
Maximilian Wilhelm d37f0d0e41 addons: address: Fix address check for pointopoint setups.
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>
2018-11-01 01:02:21 +01:00
Maximilian Wilhelm 8ce9eee0fe addons: tunnel: Fix (re)creation of tunnelsof any kind.
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>
2018-10-31 14:48:13 +01:00
Maximilian Wilhelm 22eb540506 addon: tunnels: Port get_dependent_ifacenames() from master branch.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2018-10-31 14:45:19 +01:00
Maximilian Wilhelm 96877f6fa7 addons: tunnel: Make sure tunnel modes are read correctly
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>
2018-10-31 12:55:32 +01:00
Julien Fortin 0b93b457de dhcp: add support for inet + inet6 dhcp on same interface (fixes #44)
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>
2018-05-16 22:52:41 +02:00
Julien Fortin 87bbeff99d Merge pull request #45 from svenauhagen/feature/tunnels
tunnel changes
2018-04-06 18:39:49 +12:00
Julien Fortin f59010913f debian: changelog update 20180313-1 changelog entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
debian-upload-20180313-1
2018-03-14 16:26:33 +11:00
Julien Fortin 1344b9c55c delete old file sbin/ifupdown
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-13 17:26:17 +11:00
Julien Fortin 82421c8d29 addons: usercmds: fix putenv exception: transform list to string
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-13 17:26:11 +11:00
Julien Fortin e5a1877a82 debian: changelog: add changelog entry for 20180313-1
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-13 15:08:10 +11:00
Julien Fortin fa1a896770 Revert "iproute2: addr_add: change default broadcast to '+' so iproute2 generate broadcast addrs"
this is breaking ipv6

This reverts commit 45bd71f688.
2018-03-03 18:03:30 +11:00
Julien Fortin 252b7ed4ed iproute2: addr_add: change default broadcast to '+' so iproute2 generate broadcast addrs
today ifupdown2 doesn't generate the broadcast address for an intf while ifupdown1(debian)
    does, simply changing the default broadcast value to '+' solve the issue.

    auto bond1
    iface bond1 inet static
            address 88.213.145.1
            netmask 255.255.255.0
            bond-slaves ens6 ens6d1
            bond-mode 0
            bond-miimon 100

    $ ifconfig bond1
    bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
            inet 88.213.145.1  netmask 255.255.255.0  broadcast 0.0.0.0
            inet6 fe80::f652:14ff:fe33:ea01  prefixlen 64  scopeid 0x20<link>
            ether f4:52:14:33:ea:01  txqueuelen 1000  (Ethernet)
            RX packets 6  bytes 522 (522.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 66  bytes 4878 (4.8 KB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    $ ip addr show bond1
    13: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether f4:52:14:33:ea:01 brd ff:ff:ff:ff:ff:ff
        inet 88.213.145.1/24 scope global bond1
           valid_lft forever preferred_lft forever
        inet6 fe80::f652:14ff:fe33:ea01/64 scope link
           valid_lft forever preferred_lft forever

    ******************************************
    With ifupdown1 (debian) with the same configuration

    bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
            inet 88.213.144.1  netmask 255.255.255.0  broadcast 88.213.144.255
            inet6 8f54:2573:3de8:92ba::2  prefixlen 126  scopeid 0x0<global>
            inet6 fe80::f652:14ff:fe33:eac2  prefixlen 64  scopeid 0x20<link>
            ether f4:52:14:33:ea:c2  txqueuelen 1000  (Ethernet)
            RX packets 18  bytes 1566 (1.5 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 51  bytes 4508 (4.5 KB)

    5: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether f4:52:14:33:ea:c2 brd ff:ff:ff:ff:ff:ff
        inet 88.213.144.1/24 brd 88.213.144.255 scope global bond1
           valid_lft forever preferred_lft forever
        inet6 8f54:2573:3de8:92ba::2/126 scope global
           valid_lft forever preferred_lft forever
        inet6 fe80::f652:14ff:fe33:eac2/64 scope link
           valid_lft forever preferred_lft forever

    Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-01 16:48:41 +11:00
Julien Fortin 45bd71f688 iproute2: addr_add: change default broadcast to '+' so iproute2 generate broadcast addrs
today ifupdown2 doesn't generate the broadcast address for an intf while ifupdown1(debian)
    does, simply changing the default broadcast value to '+' solve the issue.
    
    auto bond1
    iface bond1 inet static
            address 88.213.145.1
            netmask 255.255.255.0
            bond-slaves ens6 ens6d1
            bond-mode 0
            bond-miimon 100
    
    $ ifconfig bond1
    bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
            inet 88.213.145.1  netmask 255.255.255.0  broadcast 0.0.0.0
            inet6 fe80::f652:14ff:fe33:ea01  prefixlen 64  scopeid 0x20<link>
            ether f4:52:14:33:ea:01  txqueuelen 1000  (Ethernet)
            RX packets 6  bytes 522 (522.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 66  bytes 4878 (4.8 KB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    $ ip addr show bond1
    13: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether f4:52:14:33:ea:01 brd ff:ff:ff:ff:ff:ff
        inet 88.213.145.1/24 scope global bond1
           valid_lft forever preferred_lft forever
        inet6 fe80::f652:14ff:fe33:ea01/64 scope link
           valid_lft forever preferred_lft forever
    
    ******************************************
    With ifupdown1 (debian) with the same configuration

    bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
            inet 88.213.144.1  netmask 255.255.255.0  broadcast 88.213.144.255
            inet6 8f54:2573:3de8:92ba::2  prefixlen 126  scopeid 0x0<global>
            inet6 fe80::f652:14ff:fe33:eac2  prefixlen 64  scopeid 0x20<link>
            ether f4:52:14:33:ea:c2  txqueuelen 1000  (Ethernet)
            RX packets 18  bytes 1566 (1.5 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 51  bytes 4508 (4.5 KB)
    
    5: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether f4:52:14:33:ea:c2 brd ff:ff:ff:ff:ff:ff
        inet 88.213.144.1/24 brd 88.213.144.255 scope global bond1
           valid_lft forever preferred_lft forever
        inet6 8f54:2573:3de8:92ba::2/126 scope global
           valid_lft forever preferred_lft forever
        inet6 fe80::f652:14ff:fe33:eac2/64 scope link
           valid_lft forever preferred_lft forever
    
    Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-01 16:47:30 +11:00
Julien Fortin 1343159f8c Merge pull request #41 from skorpy2009/batctl-path
addon/batctl: lookup batctl dynamically from PATH
2018-02-26 10:56:24 +11:00
skorpy 47148c440a addon/batctl: lookup batctl dynamically from PATH
Currently it is called from /usr/sbin/batctl what makes it impossible to use in case one runs a self compiled version for example
2018-02-25 23:35:59 +01:00
Julien Fortin e8f8d8c670 addons: vrf: fix vrf slave link kind (fixes #39)
$ 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>
2018-01-29 22:33:50 +08:00
Julien Fortin 985e9b44e2 debian: changelog: add git20180109 changelog entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-01-09 16:13:45 +11:00
Julien Fortin 5c8828a109 Merge pull request #19 from BarbarossaTM/vxlan-physdev
Add support for setting phys-dev for VXLAN interfaces and fix check for vxlan-svcnodeip option.
2018-01-09 15:38:16 +11:00
Julien Fortin dbb67bd856 Merge pull request #17 from BarbarossaTM/bridge-ports-condone-regex
Add bridge-ports-condone-regex option.
2018-01-09 15:30:28 +11:00
Julien Fortin 83d348192e Pass environment variables to addon scripts (#32)
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>
2017-10-24 17:16:06 -07:00
Julien Fortin 13abf360dd Update README.md with install instructions 2017-10-24 17:12:21 -07:00
Maximilian Wilhelm f776a7d4be addons: bridge: allow "bridge-ports: none" for bridges without initial ports. (#33)
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>
2017-10-24 11:58:10 -07:00
Maximilian Wilhelm 30b37a9d75 addons: tunnel: Add support for GRETAP tunnels. (#34)
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>
2017-10-24 11:42:10 -07:00
Maximilian Wilhelm abe81f3d12 addons: batman_adv: Add support for more B.A.T.M.A.N. adv. attributes. (#35)
* 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>
2017-10-24 11:38:32 -07:00
kokel fe3004b067 Addons/tunnel: fix typo in validvals (#31) 2017-10-03 09:48:12 -07:00
Maximilian Wilhelm d09bc421cf addons: address: Fix handling of 'pointopoint' attr. (#23)
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>
2017-08-23 14:11:57 -07:00
Julien Fortin d0fc1e6aff changelog: update changelog for new release (git20170314)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
debian-upload-20170314-1
2017-03-15 07:11:06 +09:00
Julien Fortin da659a011e debian: install files: fix LC_ALL=C.UTF-8 following comments on bug #857258
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-03-10 11:29:35 +07:00
Julien Fortin 5479d95097 sbin: ifupdown2: update --version value to 20170308
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
debian-upload-20170308-1
2017-03-09 01:07:19 +07:00
Julien Fortin 8eda17db4d debian: add LC_ALL=C.UTF-8 directive in prestinst, postinst, postrm files
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-03-09 00:55:31 +07:00
Julien Fortin 0ab28c271d debian: preinst, postinst, postrm: add LC_ALL=C.UTF-8 directive to avoid locale specific issues
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-03-09 00:29:16 +07:00
Julien Fortin 4e07c86c27 sbin: ifupdown2: update version number for --version option (20170307)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
debian-upload-20170307-1
2017-03-08 01:52:09 +07:00
Roopa Prabhu 5f72c6249d debian: fix last version to reflect current date 1.0~git20170307-1
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-03-07 09:54:23 -08:00
Julien Fortin 91928083e0 debian: update changelog for 1.0~git20170214-1
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-03-07 09:51:26 -08:00
Julien Fortin 284f3e8a1e debian: ifupdown2.preinst: remove 'by' text from grep filter
Fixes localized system (debian Bug#856970)

Reported-by: Tobias Stein <grand.ouvert@googlemail.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-03-06 13:27:13 -08:00
Julien Fortin 5478fb2fdf sbin: ifupdown2: update ifupdown2 version number for --version option
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-03-06 00:21:55 +07:00
Julien Fortin b524e4a57a debian: changelog: update changelog for new version (1.0~git20170223-1)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
debian-upload-20170223-1
2017-02-23 17:32:43 +07:00
Julien Fortin aeedf5cd13 sbin: ifupdown2: drop the dependency to pkg_resources, hardcode version number
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>
2017-02-23 17:23:29 +07:00
Julien Fortin cdd92682b0 sbin: start-networking: adjust allow-hotplug behavior to ifupdown
Ticket: Bug#855598: src:ifupdown2: allow-hotplug behaves differently, not UPing interfaces
Reviewed By: Roopa
Testing Done: mark an interface (ethX) as hotplug then reboot

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-02-23 17:23:15 +07:00
Julien Fortin 4e0b8492de debian: changelog: update changelog for new version 1.0~git20170214-1
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
debian-upload-20170214-1
2017-02-15 03:55:03 +07:00
Julien Fortin a79072dbe8 debian: preinst: remove stale code
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-02-15 03:46:59 +07:00
Julien Fortin 05102ca78b debian: control: add back Conflicts ifupdown
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-02-15 03:46:14 +07:00
Maximilian Wilhelm e693321849 Add support GRE/SIT tunnels. (#20)
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>
2017-01-29 01:54:43 +03:00
Maximilian Wilhelm bffa619b11 Add option 'veth-peer-name' to veth links and ensure proper configuration.
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>
2017-01-14 19:08:01 +01:00
Julien Fortin 6a413b0870 debian: changelog: fix changelog entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
debian-upload-20170114-1
2017-01-14 06:15:27 +03:00