1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

1002 Commits

Author SHA1 Message Date
Julien Fortin
b11c3c41d2 ifupdown2 2.0.0 release
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:42:35 -08:00
Julien Fortin
d486dd0df0 ifupdown2 2.0.0 release
This is a major update coming all at once from master-next branch
master-next branch was started with --orphan option which is basically a new
branch without history.

The major changes are:
    - repackaging
    - cleanup the directory tree
    - rewritte setup.py to allow install from deb file or pypi (pip install)
    - add a Makefile to make things (like building a deb) easier
    - review all debian files

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 11:43:32 -08:00
Julien Fortin
a9c3c89431 Merge pull request #80 from BarbarossaTM/tunnel-fixes-master
Tunnel fixes master
2018-10-30 12:17:56 +01:00
Maximilian Wilhelm
fdb5abcf7b 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-29 20:35:30 +01:00
Maximilian Wilhelm
dcc62f895d 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-29 20:31:17 +01:00
Julien Fortin
6cc8ffae45 Merge pull request #73 from carlanton/ethtool-typo-fix
addons: ethtool: fix indentation error for link-fec attr handling
2018-09-10 13:07:21 +02:00
Anton Lindström
b9ab286e3f Fix indentation error in ethtool.py 2018-09-09 19:28:31 +02:00
Julien Fortin
d54b30b4b8 Merge pull request #46 from svenauhagen/feature/ppp
ppp support closes #22
2018-04-13 19:38:25 +02:00
Sven Auhagen
6cba66af57 dependent device fix 2018-04-13 19:32:04 +02:00
Sven Auhagen
6cb7753857 ppp load 2018-04-07 19:22:33 +02:00
Sven Auhagen
f101cb2ba5 do not load ppp if not installed 2018-04-07 19:21:04 +02:00
Sven Auhagen
9b60795aa1 exclude ppp like dhcp 2018-04-07 18:07:30 +02:00
Sven Auhagen
b2650e4a37 typo 2018-04-07 17:35:04 +02:00
Sven Auhagen
c9b6e2f883 ppp support 2018-04-07 17:29:51 +02:00
Julien Fortin
b64ab20ebf Merge pull request #45 from svenauhagen/feature/tunnels
tunnel changes
2018-04-06 16:45:00 +12:00
Sven Auhagen
d14c61b603 chache error on change 2018-04-05 07:32:42 +02:00
Sven Auhagen
e452c2cf53 fix tunnel v4 to v6 change 2018-04-04 20:53:32 +02:00
Sven Auhagen
887e55019e name fix 2018-04-04 20:06:48 +02:00
Sven Auhagen
12425dc496 tunnel changes 2018-04-04 19:49:34 +02:00
skorpy
8a0aa008bb 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-03-13 14:57:27 +11:00
Julien Fortin
5b563460f8 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-03-13 14:57:19 +11:00
Maximilian Wilhelm
00ff264407 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>
2018-03-13 14:54:36 +11:00
Maximilian Wilhelm
7d5877831d 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>
2018-03-13 14:54:31 +11:00
Maximilian Wilhelm
008f587603 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>
2018-03-13 14:54:25 +11:00
kokel
fa83ce4e36 Addons/tunnel: fix typo in validvals (#31) 2018-03-13 14:54:19 +11:00
Maximilian Wilhelm
8de397effa 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>
2018-03-13 14:54:05 +11:00
Julien Fortin
1025163e73 sbin: ifupdown2: update ifupdown2 version number for --version option
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-13 14:53:18 +11:00
Julien Fortin
bfec7d134f 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>
2018-03-13 14:53:01 +11:00
Maximilian Wilhelm
2e2adb0e84 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>
2018-03-13 14:50:31 +11:00
Julien Fortin
db65511035 closes: #810844: debian: control: Unlisted dependencies
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-13 14:48:27 +11:00
Maximilian Wilhelm
6bfea931ff batman_adv: Ignore non-existing batman interface when setting up batman iface.
Previously a single non existing batman member interface could prevent the
  configuration of the batman interface. This patch makes sure only existing
  member interfaces will be considered when setting up the interface.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:47:54 +11:00
Maximilian Wilhelm
a8c175f91f batman_adv: Rename _sysfs_mgmt_member_if() to _batctl_if() and use absolute path to batctl.
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:47:45 +11:00
Maximilian Wilhelm
f08f4d8a8a batman-adv: Show function where error occured in message.
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:47:37 +11:00
Maximilian Wilhelm
53f3470485 Add support for setting phys-dev for VXLAN interfaces.
Add interface configuration option »vxlan-physdev« to set »dev« attribute
  of VXLAN interfaces and a check for the running configuration.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:45:25 +11:00
Maximilian Wilhelm
8c264d01eb Addons: vxlan: Fix check of »vxlan-svcnodeip« config option.
The »vxlan-svcnodeip« corresponds with the multicast »group« parameter
  of the VXLAN interface and should be checked against this value instead
  of the »remote« parameter for unicast ptp tunnels.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:44:55 +11:00
Julien Fortin
f00d85a17a docs: examples: new batman_adv folder with configuration script and example
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-13 14:43:59 +11:00
Maximilian Wilhelm
97e09957b4 Add addon module for B.A.T.M.A.N. advanced interface configuration. (#12)
* Add addon module for B.A.T.M.A.N. advanced interface configuration.

  This commit adds support for configuring B.A.T.M.A.N. advanced interfaces
  with ifupdown2. B.A.T.M.A.N. advanced is a protocol to build Layer2 based
  mesh networks with. It's supported in the Linux kernel and thus available
  in many Linux environments.

  A configuration could look like this

  auto bat0
  iface bat0
      batman-ifaces eth1 eth2.23
      batman-ifaces-ignore-regex .*_nodes
      batman-hop-penalty 23
      #
      address 192.0.2.42/24

  where »bat0« would be the local connection to the mesh network.

  The interfaces »eth1« and »eth2.23« would be used by the B.A.T.M.A.N. adv.
  protocol to communicate to other member of the mesh network.

  Any interfaces matching the »ifaces-ignore-regex« will be gently ignored
  by ifquery and ifreload as there might be some tunnels or interfaces
  added to the mesh network by other means which should not be removed by
  any subsequent ifreload run.

  The »hop-penalty» parameter set the penalty of this node within the mesh
  network.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>

* addons: batman_adv: replacing rtnetlink by netlink api call and iproute2 instantiation fix

These changes are due to modifications we introduced in debian-prep2.
We no longer use the rtnetlink_api but a new one "netlink" build on top of python-nlmanager.

* Reflect upstream change where flags are stored.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:41:46 +11:00
Julien Fortin
753807fde3 Revert "iproute2: addr_add: change default broadcast to '+' so iproute2 generate broadcast addrs"
this patch is breaking ip6, i'll try to fix it later by adding a ip4 check first.

This reverts commit c4d1cffc5e34d4afb38606ecf4288b431c82b683.
2018-03-13 11:05:52 +11:00
Julien Fortin
c4d1cffc5e 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:46:53 +11:00
Gaudenz Steinlin
ca2ec1ac23 Pass environment variables to addon scripts (#32)
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
2017-10-24 17:00:27 -07:00
Julien Fortin
dc89c7cd42 Update README.md with install instructions 2017-10-13 16:10:29 -07:00
Jeffrey
fc7fac14b2 Update README.rst (#11)
Fixed formatting issue which did put the second 'apt-get install' line behind the first one.
2017-08-01 16:08:10 +02:00
Nigel Kukard
6a5a7c6b2c For hotplug devices check if the link is present, not up (#28)
Checking operstate would require firmware to be loaded and link
negotiation to of taken place. Some firmwares take a few seconds to
upload and online the device, and some link negotiations take a second
or two.

Immediately checking operstate is not feasible here. Checking if the
link is present is a more suitable non-delaying approach.

Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
2017-07-27 01:45:52 +02:00
Julien Fortin
9a5c706f45 Merge remote-tracking branch 'cumulus/dev'
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-02-23 17:17:26 +07:00
Julien Fortin
23cba755ed debian: changelog: update changelog for new version cl3u10 (unreleased)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-02-23 17:11:10 +07:00
Julien Fortin
de1127b0be 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 16:42:34 +07:00
Julien Fortin
ac40c03262 sbin: ifupdown2: drop the dependency to pkg_resource, 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 16:31:58 +07:00
Daniel Walton
a981087c9e ifupdown2: bond-downdelay and bond-updelay need validrange
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   julien@cumulusnetworks.com

Ticket: CM-15012
2017-02-23 03:13:40 +12:00
Daniel Walton
932bfff598 ifupdown2: restrict mstpctl-treeprio validvals
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   julien@cumulusnetworks.com

Ticket: CM-15011
2017-02-23 03:12:16 +12:00
Julien Fortin
8a5626d4f4 Merge remote-tracking branch 'origin/dev-next' into dev 2017-02-18 01:46:15 +07:00