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

1147 Commits

Author SHA1 Message Date
9b585f9e67 addons: bridge: down: when ifreload_down_changed=1: purge bridge and upper devices cache
On ifreload (down ops) we need to purge the cache entry of the bridge and its upper devices
to avoid stale values in our cache.

ifup this config, then remove bridge-vids 20, ifreload: since the bridge is removed because
of ifreload_down_changed=1, we need torecreate the vlan bridge.10 and it's configuration, the
cache is stale. We need to clear it to remove the ip 10.10.10.10/32.

auto bridge
iface bridge
      bridge-ports swp1 swp2
      bridge-vids 10 20
      bridge-vlan-aware yes

auto swp1
iface swp1
      link-speed 10000

auto swp2
iface swp2

auto bridge.10
iface bridge.10
      address 10.10.10.10/32

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:56:14 +08:00
92c2d4a9e7 addons: addressvirtual: vrrp: protodown new macvlans
New VRRP macvlan devices should be set into protodown when first
created, to prevent ND traffic and other automatically generated kernel
traffic from being transmitted on the interface and causing downstream
MAC moves.

Reviewed-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:55:47 +08:00
1b9d23e8a0 addons: bridge: don't disable ipv6 on vlan-aware vxlan-bridge
ipv6 shouldn't be disabled on a bridge vlan aware

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:55:28 +08:00
3832dce663 addons: bridge: get default mcsnoop value when bridge_vxlan is not set
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:55:09 +08:00
6cd081d1d7 .gitignore: pycharm remote execution update
To work on ifupdown2 i'm using Pycharm on macOS. ifupdown2 runs in a
debian VM. To use Pycharm remote execution capabilities, we need several
symlinks (one per command). Git needs to ignore those symlinks :)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:54:51 +08:00
dbc23e6cbf nlpacket: vxlan: encode: fix payload length
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:53:59 +08:00
32d448a81c addons: addressvirtual: vrrp: set addrgen mode random on VRRP macvlans
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:53:42 +08:00
9f8f3b0d65 addons: bridge: check kernel state for igmp snooping on vxlan brport
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:53:23 +08:00
b994bd3977 addons: addressvirtual: vrrp: fix multiline-merge attribute detection
Now we support the following config:
auto swp1
iface swp1
      vrrp 3 50.0.1.1/24
      vrrp 3 2001:50:0:1::1/64
      vrrp 3 2001:50:0:42::1/64

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:53:01 +08:00
3e112a1c03 addons: addressvirtual: vrrp: fix macvlan name to include vrrp id
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:52:46 +08:00
c3f1a1a064 debian: changelog: 1.2.6-1: update changelog entry for new release
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:52:21 +08:00
bd451a4846 addons: addressvirtual: vrrp: remove macvlan device when all ipvX addrs are removed
For each VRRP configuration we create 2 macvlans (ip4 and ip6), if the ip4
is removed from the config we need to remove the associated macvlan (same
for ip6).

Testing Done: remove all ip4 (or ip6) from vrr attribute line

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:50:42 +08:00
43d3655165 addons: ethtool: raise error on ethtool command failure
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:50:24 +08:00
80adb3c144 addons: bridge: add new policy vxlan_bridge_igmp_snooping_enable_port_mcrouter
if igmp snooping is enabled on a vxlan bridge and if the
vxlan_bridge_igmp_snooping_enable_port_mcrouter is turned on, ifupdown2
will automatically enable multicast router on the vxlan brport unless
this attribute was provided by the user. The policy is enabled by default.

The policy can be disabled as follow:
{
    "bridge": {
	"module_globals": {
	    "vxlan_bridge_igmp_snooping_enable_port_mcrouter": "no"
	}
    }
}

auto br0
iface br0
      bridge-ports vx42
      bridge-mcsnoop yes

auto vx42
iface vx42
      vxlan-id 42

$ ifreload -ad
will show that the config is applied

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:50:00 +08:00
e588acb7d8 addons: addressvirtual: create VRRP macvlans in bridge mode
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:49:44 +08:00
68c8d699db addons: addressvirtual: vrrp: base macvlan prefix on parent ifindex
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:49:29 +08:00
8fb6dd67b2 addons: addressvirtual: make sure vrr macvlans names are 15 chars long max
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:49:15 +08:00
709f7942a2 addons: addressvirtual: delete macvlan when vrrp config is removed (ifreload case)
Add a vrrp config under swp intf - ifup, then remove the vrrp config - ifreload
the macvlans are not removed without this patch

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:49:02 +08:00
ec25a08c3a addons: vxlan: add support for vxlan-ttl attribute
New vxlan-ttl attribute: specifies the TTL value to use in outgoing
packets. Valid values: range 1..255 or auto (0)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:48:36 +08:00
5bc963f0ad addons: addressvirtual: add support for VRRP attribute
syntax: vrrp ID ip[4|6]

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:43:25 +08:00
1d35560dc6 addons: bridge: fix 'NoneType' object has no attribute '__getitem__' error
Fixes #90

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 10:30:05 +08:00
09f9afc782 debian: changelog: update 1.2.5-1 timestamp entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
1.2.5-1
2019-01-21 11:01:13 +08:00
739f9c7ea0 scheduler: ifupdown2 scripts: log warning on EACCES exception (Fixes #89)
ifupdown2 behaviour significantly diverges from ifupdown on debian stretch.
Original ifupdown uses run-parts which supposedly doesn't run non-executable
files in the directory. However, ifupdown2 doesn't seem to make this
distinction.
This patch will log warning EACCES exceptions (instead of log error) and exit 0

Reported-by: George Diamantopoulos <gedia>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-01-18 15:52:59 +08:00
a64d337ee6 setup.py: update copyright year (2019)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-01-17 12:41:25 +08:00
91d461673b setup.py: bump version number to 1.2.5
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-01-17 12:34:30 +08:00
35b9d035c1 debian: install sysvinit script (Fixes: #26)
Fixes github issue #26 and debian bug #918775

Reported-by: Joerg Dorchain <joerg@dorchain.net>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>

Co-authored-by: Joerg Dorchain <joerg@dorchain.net>
Co-authored-by: Julien Fortin <julien@cumulusnetworks.com>
2019-01-17 12:26:47 +08:00
0aa3d31930 debian: postinst: remove diversion after upgrade from stretch
closes: #919443

Reported-by: Andreas Beckmann <anbe@debian.org>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-01-16 18:35:28 +08:00
9f98f3604e statemanager: configure state_dir via ifupdown2.conf
ifupdown2 used /var/tmp/network/ to store its state file
upstream users reported that when /var/tmp is not mounted
before network configuration ifupdown2 fails. We now let
user define which location they want to use for the state
file.

closes: #918832

Reported-by: Maximilian Wilhelm <max@sdn.clinic>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
1.2.4-1
2019-01-11 12:08:10 +08:00
72ba456971 log: use stderr if syslog initialization fails
closes: #917534

Reported-by: Joerg Dorchain <joerg@dorchain.net>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
1.2.3-1
2018-12-30 22:45:47 +07:00
e28cc68413 debian: changelog: add debian revision and refactor 1.2.2-1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
1.2.2-1
2018-12-20 11:18:22 +01:00
7a3f3bbefd debian: changelog: add B.A.T.M.A.N. changelog entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-20 09:48:43 +01:00
cf98afd144 debian: control: add python-pkg-resources to suggested dependencies-list
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-19 20:34:53 +01:00
ca45d4aaa8 man: remove non-implemented -m option (closes: #905572)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-19 20:04:33 +01:00
e5019fc9b8 debian: changelog: tag older version with UNRELEASED tag
some of those release were available but under a different name so
technically those version numbers were never released.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-19 18:56:31 +01:00
0cbd3d8c05 debian: source: format: moving to non-native package
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-19 18:56:02 +01:00
e38b64a51c debian: control: update debhelper dependency and drop dh-systemd
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-19 18:46:21 +01:00
df106c519e LinkUtils: tunnel_change: do not purge the cache on tunnel change
Author: Sven Auhagen <Sven.Auhagen@voleatech.de>
2018-12-19 11:48:16 +01:00
8d8cd4f438 addons: batman_adv: import and IO api refactoring
The new code base supports installation via pypi so we need to update the
imports statement.
It's also good practice to use the existing IO apis to read/write and execute
sub-commands, those API will do error handling and logging.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-19 07:14:15 +01:00
b1a2d2417b Add addon module for B.A.T.M.A.N. advanced interface configuration. #12
batman wasn't in master-next so it got removed during the last merge
this commit adds it back to master.
See PR #12

From Maximilian Wilhelm:
  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: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>

Author: Maximilian Wilhelm <max@rfc2324.org>
2018-12-19 07:12:58 +01:00
6039c4d778 addons: tunnel: fix tunnel creation (#80)- master branch refactoring
During the recent merge between master and master-next the changes introduced
by PR #80 were lost. This commit adds them back with some refactoring to use
the new netlink cache.

Co-authored-by: Maximilian Wilhelm <max@sdn.clinic>
Co-authored-by: Julien Fortin <julien@cumulusnetworks.com>

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-18 17:05:30 +01:00
5a4147c4c1 netlink: add tunnel device support in ipcmd cache
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-18 15:58:11 +01:00
35848ca0d3 nlpacket: add decode support for tunnel devices
Tunnel device now supported (decode):
- gre
- gretap
- erspan
- ip6gre
- ip6gretap
- ip6erspan
- ipip
- sit
- ip6tnl
- vti
- vti6

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-18 13:33:50 +01:00
3b69ce6e62 debian: changelog: new entry for version 1.2.2
ifupdown2 (1.2.2) unstable; urgency=medium

  * Support for new iproute2 format (bridge vlan show)
  * Pypi install: local addons modules should be loaded first
  * Fix: link-down yes on vrf slaves
  * Fix: nlmanager: use strerror to format kernel error
  * Add: new checks for existing device with vxlan attributes
  * Ethtool: FEC: translate None and NotSupported values to link-fec off

 -- Julien Fortin <julien@cumulusnetworks.com>  Thu, 13 Dec 2018 23:42:42 -0800

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 17:09:46 -08:00
61da44592d config: local addons modules should be loaded first
ifupdown2 can be installed via apt/dpkg or via pypi (pip), those two installation methods have
two different installation directory. Our main installation dir is /usr/share/ifupdown2. This is
also were other scripts might add their own addon.
If ifupdown2 is installed via pypi we need to make sure we are loading the script-added addon modules

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 15:18:17 -08:00
e7206159ed addons: vrf: fix link-down yes on vrf slaves
because of a typo (use of wrong object) we weren't looking at the correct
ifaceobj for LINK_DOWN lookup. In some cases we didn't honor link-down yes
on VRF slaves

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 15:18:00 -08:00
b067bba9b9 addons: vxlan: if device exists check that it's a vxlan (link_kind)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 15:17:46 -08:00
6328de59d2 addons: ethtool: FEC: translate None and NotSupported values to link-fec off
$ /sbin/ethtool --show-fec swp42
FEC parameters for swp42:
FEC encodings   : None
$ ifquery swp42
auto swp42
iface swp42
      link-fec off

$ ifreload -av |& grep ethtool
info: executing /sbin/ethtool swp42
info: executing /sbin/ethtool --show-fec swp42
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 15:17:23 -08:00
d54d014d9c nlmanager: use strerror to deal with kernel error
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 15:17:09 -08:00
5234020236 ifupdownaddons: LinkUtils: bridge vlan show: add support for new iproute2 format
A newer iproute2 version changed the bridge vlan show output, ifupdown2 relies
on the previous format, we have the convert  data into old format:

{
   "vx-1002": [{
        "vlan": 1002,
        "flags": ["PVID", "Egress Untagged"]
    }],
    "vx-1004": [{
        "vlan": 1004,
        "flags": ["PVID", "Egress Untagged"]
    }]
 }

auto bridge
iface bridge
        bridge-vlan-aware yes
        bridge-ports vx-1000 vx-1001 vx-1002 vx-1003 vx-1004 hostbond3 hostbond4
        bridge-stp on
        bridge-vids 1000-1004
        bridge-pvid 1

auto vx-1002
iface vx-1002
        vxlan-id 1002
        bridge-access 1002
        vxlan-local-tunnelip 27.0.0.15
        bridge-learning off
        bridge-arp-nd-suppress on
        mstpctl-portbpdufilter yes
        mstpctl-bpduguard yes
        mtu 9152

auto hostbond4
iface hostbond4
        bond-slaves swp2 swp3
        bond-mode 802.3ad
        bond-min-links 1
        bond-lacp-rate 1
        mtu 9152
        alias Local Node/s TORS1 and Ports swp32s2 swp32s3 <==> Remote  Node/s HOSTS12 and Ports swp1 swp2
        bridge-pvid 1001

auto swp3
iface swp3
        link-speed 10000
        link-duplex full
        link-autoneg off

auto swp2
iface swp2
        link-speed 10000
        link-duplex full
        link-autoneg off

auto vx-1004
iface vx-1004
        vxlan-id 1004
        bridge-access 1004
        vxlan-local-tunnelip 27.0.0.15
        bridge-learning off
        bridge-arp-nd-suppress on
        mstpctl-portbpdufilter yes
        mstpctl-bpduguard yes
        mtu 9152

auto vx-1003
iface vx-1003
        vxlan-id 1003
        bridge-access 1003
        vxlan-local-tunnelip 27.0.0.15
        bridge-learning off
        bridge-arp-nd-suppress on
        mstpctl-portbpdufilter yes
        mstpctl-bpduguard yes
        mtu 9152

auto hostbond3
iface hostbond3
        bond-slaves swp5 swp6
        bond-mode 802.3ad
        bond-min-links 1
        bond-lacp-rate 1
        mtu 9152
        alias Local Node/s TORS1 and Ports swp32s0 swp32s1 <==> Remote  Node/s HOSTS11 and Ports swp1 swp2
        bridge-pvid 1000

auto swp6
iface swp6
        link-speed 10000
        link-duplex full
        link-autoneg off

auto swp5
iface swp5
        link-speed 10000
        link-duplex full
        link-autoneg off

auto vx-1001
iface vx-1001
        vxlan-id 1001
        bridge-access 1001
        vxlan-local-tunnelip 27.0.0.15
        bridge-learning off
        bridge-arp-nd-suppress on
        mstpctl-portbpdufilter yes
        mstpctl-bpduguard yes
        mtu 9152

auto vx-1000
iface vx-1000
        vxlan-id 1000
        bridge-access 1000
        vxlan-local-tunnelip 27.0.0.15
        bridge-learning off
        bridge-arp-nd-suppress on
        mstpctl-portbpdufilter yes
        mstpctl-bpduguard yes
        mtu 9152

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 15:16:40 -08:00
2229ca6371 addons: bridge: add "None" check (string) for unsupported bridge attr on some systems
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00