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

72 Commits

Author SHA1 Message Date
e537a6e6d6 add support for single vxlan device (bridge-vlan-vni-map)
new attribute:

"bridge-vlan-vni-map": {
    "help": "Single vxlan support",
    "example": "bridge-vlan-vni-map 1000-1001=1000-1001",
}

example of config:

auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-ports vxlan0 swp1
      bridge-stp on
      bridge-vids 1000-1001
      bridge-pvid 1

auto vxlan0
iface vxlan0
      vxlan-local-tunnelip 27.0.0.9
      bridge-learning off
      # vlan 1000-1001 maps to vni 1000-1001
      bridge-vlan-vni-map 1000-1001=1000-1001

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-14 02:18:39 +02:00
7840bd2c09 addons: bridge: add support for new bridge-always-up attribute
Enabling this attribute on a bridge will
enslave a dummy interface to the bridge

example:

auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-always-up yes
      bridge-ports vni42

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-14 02:05:52 +02:00
4d9f4e59f3 addons: dchp: add debug logs and retry mechanism for dhclient (controled by policy)
ifupdown2 now tries to monitor the dhclient call to see if an ip address was
successfully assigned on the requested device. The number of retry can be
customized using the "dhclient_retry_on_failure" policy variable (which defaults to 0)

This commit also add debugging capabilities by automatically enabling sysloging when
configuring dhcp at boot (with PERFMODE option).

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-14 01:53:22 +02:00
9b451d11dc networking.service: use start-networking script to control start/stop/reload
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-13 20:47:47 +02:00
9808982edf addons: bond: add support for es-sys-mac and es-bonds
ES bonds have the same "init state" requirements as CLAG bonds -
1. A bond needs to be designated as an "es-bond" for this purpose.
For clag-bonds we used "clag-id" attr (to designate a bond as a "clag-bond").
For ES bonds we will use "es-sys-mac" attr.

2. Slaves added to an "ES bond" must have protodown-on.
This is again similar to CLAG bonds

3. And vice-versa i.e. when a slave is removed from an "es-bond",
protodown-on must be cleared.

4. When es-sys-mac is first set on a bond, all the bond-slaves must be
placed in "protodown-on" state. This is needed whether FRR is running at that point or not.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-05-13 20:27:21 +02:00
74bac7e553 debian: changelog: update 3.0.0-1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-04-14 19:22:37 +02:00
16de4e7988 Merge branch 'master' into python3
* master:
  addons: address: process MTU before addrgen and adddresses
  ifupdownmain: support for marking interfaces as mgmt interfaces
  addons: bridge: fix TypeError: sequence item 0: expected string, int found
  addons: bridge: set bridge MTU after bridge creation addons: bridge: get bridge MTU from address policy not bridge
  addons: mstpctl: check mstpctl-stp and bridge-stp and fix bridge cache update
  lib: nlcache: fix dry_run exception
  addons: address: add support for a separate default mtu policy for eth interfaces
  debian: changelog: new 2.0.2-1 entry
  addons: ethtool: add support for "ethtool_ignore_errors" policy
  LinkUtils: mac_str_to_int: fix string to int conversion
  addons: dhcp: if mgmt vrf context exec dhclient in default vrf
2020-03-26 03:02:53 +01:00
f43edf057e debian: changelog: new 2.0.2-1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-03-04 16:24:50 +01:00
5b3907dc6b debian: changelog: update 3.0.0-1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2020-02-24 16:25:13 +01:00
3aa8da8a6c Merge branch 'master-next' into python3
* master-next:
  argv: move --nldebug option to common_argparse to avoid exception in ifreload
  debian: changelog: new 2.0.1-1 entry
  argv: add new command line argument --nldebug
  This commit adds the feature to change offloads for nics. Currently GRO, LRO GSO, TSO, UFO, TX and RX Offload are supported.
2020-01-02 15:50:51 +01:00
e65fae4889 debian: changelog: new 2.0.1-1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-31 15:25:07 +01:00
7e9990b1e8 setup.py: bump version to 3.0.0 and update changelog
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 17:23:13 +01:00
223ba5af1d ifupdown2 2.0.0-1
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-12-17 13:46:18 +01:00
5fb588fc9a debian: changelog: add empty 1.2.9-1 entry for next release
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-07-12 12:47:06 +04:00
79ba6a415a debian: changelog: add new changelog entry 1.2.8-1
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-07-12 12:22:36 +04:00
d0df31ff9d Merge pull request #116 from rajendra-dendukuri/dhcp6_duid
addons: dhcp: Policy to specify DUID type to use on dhcpv6 requests
2019-07-12 12:18:02 +04:00
1321d5e357 addons: dhcp: Policy to specify DUID type to use on dhcpv6 requests
Update module description and changelog

Signed-off-by: Rajendra Dendukuri <rajendra.dendukuri@broadcom.com>
2019-07-10 22:43:28 -07:00
cf1dac2ff7 debian: changelog: add new 1.2.7-1 entry
* New: Add bridge-ports-condone-regex option (closes #117)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-07-09 19:28:33 +04:00
c9091d7108 debian: changelog: updating 1.2.6-1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-06-24 15:52:06 +08:00
8cea3591b5 debian: changelog: update 1.2.6-1 entry
* New. policymanager: merge module policy instead of overriding duplicates
* New: set default mtu on user defined device (via link-type)

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-06-06 19:19:42 +08:00
adf8e888e3 debian: changelog: update 1.2.6-1 entry before release
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2019-04-22 11:05:12 +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
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
09f9afc782 debian: changelog: update 1.2.5-1 timestamp entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
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
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>
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>
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>
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
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
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
9d50518591 addons: address: new l3_intf_default_gateway_set_onlink policy closes #54
As shown in the following example, ifupdown1 sets the default route with the
onlink attribute. This patch will add this capability to ifupdown2 controlled
by a policy variable in the address module: "l3_intf_default_gateway_set_onlink"
default to on

[19:16:07] root:~ # cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet static
      address 78.46.193.234/32
      gateway 172.31.1.1
[19:16:19] root:~ # ifup -a -v
ifup: configuring interface enp0s3=enp0s3 (inet)
...
/bin/ip addr add 78.46.193.234/255.255.255.255 broadcast 78.46.193.234	  dev enp0s3 label enp0s3
/bin/ip link set dev enp0s3   up
/bin/ip route add default via 172.31.1.1  dev enp0s3 onlink
...
[19:16:21] root:~ # ip route show
default via 172.31.1.1 dev enp0s3 onlink
10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15
169.254.0.0/16 dev enp0s3 scope link metric 1000
[19:16:21] root:~ #

$ cat /etc/network/ifupdown2/policy.d/address.json
{
    "address": {
	"module_globals": {
	    "l3_intf_default_gateway_set_onlink": "yes"
	}
    }
}
$ ifquery swp1
auto swp1
iface swp1 inet static
	address 78.46.193.234/32
	gateway 172.31.1.1

$ ifreload -av |& grep "route add default"
info: executing /bin/ip route add default via 172.31.1.1 proto kernel dev swp1 onlink
$
$
$ emacs -nw /etc/network/ifupdown2/policy.d/address.json
$ cat /etc/network/ifupdown2/policy.d/address.json
{
    "address": {
	"module_globals": {
	    "l3_intf_default_gateway_set_onlink": "no"
	}
    }
}
$ ifdown -a -X eth0
$ ifreload -av |& grep "route add default"
info: executing /bin/ip route add default via 172.31.1.1 proto kernel dev swp1
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00
629b46992d debian: changelog: update all entry to unstable distribution
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00
2eecfaf3dd debian: changelog: 1.2.1: set RELEASED
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00
ebfc7e2952 debian: changelog: update 1.2.1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00
3abe662118 debian: changelog: 1.2.1: update entry date
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00
1b5c4ba96f debian: changelog: add l3_intf_arp_accept policy to 1.2.1 entry
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00
04f83b1adf debian: changelog: add link-fec changelog entry (release 1.2.1)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00
a0ab870e46 debian: changelog: update changelog for release 1.2.1
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00
664856a2ba debian: changelog: add ip[6]-forward entry for new validvals
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00
fecca2114a debian: changelog: 1.2.1: new entry: point-to-point protocol (ppp)
New addon to create/configure ppp interfaces

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:43:57 -08:00
23e8546d39 addons: addressvirtual: new policy (bool): addressvirtual_with_route_metric (default: yes)
Ifupdown2 is now setting a default metric on macvlan ips. This policy will let
users disable this new default behavior. addressvirtual_with_route_metric is
boolean policy variable.

  addressvirtual_with_route_metric: yes|no|on|off|1|0 (default to yes)

$ cat /var/lib/ifupdown2/policy.d/addressvirtual.json
{
    "addressvirtual": {
        "module_globals": {
            "addressvirtual_with_route_metric": "no"
        }
    }
}

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:42:35 -08:00
43ea2a97e7 debian: changelog: new entry for version 1.2.1
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:42:35 -08:00
70a6640ce1 bridge: vlan-aware: add new boolean policy "vlan_aware_bridge_address_support"
closes #58

In linux its possible to assign a vlan-aware bridge an ip address
For some use cases is it useful to restrict users from configuring
ips on bridges VA. This patch will let admins and distributions
decide if it is necessary to warn the user in such case.

The patch introduces a new 'address' policy:

 vlan_aware_bridge_address_support: yes|no|on|off|0|1 (default to yes)

[16:46:09] root:~ # cat /var/lib/ifupdown2/policy.d/address.json
{
    "address": {
	"module_globals": {
	    "enable_l3_iface_forwarding_checks": "yes"
	},
	"defaults": {
	    "mtu": "1500",
	    "ip-forward": "on",
	    "ip6-forward": "on"
	}
    }
}
[16:46:16] root:~ # ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto bridge
iface bridge
	bridge-ports swp1
	bridge-vlan-aware yes
	address 10.10.10.10/32

[16:46:20] root:~ # ifup -a --syntax-check
[16:46:22] root:~ # echo $?
0
[16:46:33] root:~ # nano /var/lib/ifupdown2/policy.d/address.json
[16:46:47] root:~ # cat /var/lib/ifupdown2/policy.d/address.json
{
    "address": {
	"module_globals": {
	    "enable_l3_iface_forwarding_checks": "yes",
	    "vlan_aware_bridge_address_support": "no"
	},
	"defaults": {
	    "mtu": "1500",
	    "ip-forward": "on",
	    "ip6-forward": "on"
	}
    }
}
[16:46:48] root:~ # ifup -a --syntax-check
warning: bridge: ignoring ip address. Assigning an IP address is not allowed on bridge vlan aware interfaces
[16:46:51] root:~ # echo $?
1
[16:46:52] root:~ #

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:42:35 -08:00
7b66b2fc47 debian: changelog: 1.2.0: new entry: metric on macvlan ip
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:42:35 -08:00
7cdb931e5d addons: vrf: add support for 'link-down yes' on VRF slaves
$ ifquery -a
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
	vrf mgmt
	link-down yes

auto mgmt
iface mgmt
	vrf-table auto

$ ifup -a -d
...
...
debug: mgmt: pre-up : running module vrf
info: executing /usr/lib/vrf/vrf-helper create mgmt 1001
debug: mgmt: eth0: slave configured with link-down yes
info: mgmt: netlink: ip link set dev mgmt up
...
$ ip link show eth0
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master mgmt state DOWN mode DEFAULT group default qlen 1000
    link/ether 08:00:27:80:e2:97 brd ff:ff:ff:ff:ff:ff

Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:42:35 -08:00
05a4955081 ifupdownmain: run up/down on manual interfaces, but ignore any errors. (closes #48)
ifupdown changed its original behavior on "manual" address method:
12d333d619

ifupdown2 needs to change it's behavior too.

Reported-by: Alexandre Derumier <aderumier@odiso.com>
Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Co-authored-by: Alexandre Derumier <aderumier@odiso.com>
Co-authored-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-12-13 14:42:35 -08:00