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

843 Commits

Author SHA1 Message Date
Julien Fortin
0b1bea5bb3 addons: bridge: bridge-portmcfl: add support for yes/no value
Ticket: CM-14146
Reviewed By: Roopa, Daniel W, Nikhil G
Testing Done:

bridge-portmcfl attribute needs to validate an <interface-yes-no-0-1-list>
to support the yes/no syntax.
This is an incremental commit for CM-8866

$ ifquery -a
auto br0
iface br0
      bridge-ports swp1 swp2 swp3 swp4
      bridge-portmcfl swp1=yes swp2=no swp3=1 swp4=0

auto br1
iface br1
      bridge-vlan-aware yes
      bridge-ports swp5 swp6 swp7 swp8

auto swp5
iface swp5
      bridge-portmcfl yes

auto swp6
iface swp6
      bridge-portmcfl no

auto swp7
iface swp7
      bridge-portmcfl 1

auto swp8
iface swp8
      bridge-portmcfl 0
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-03 18:48:59 +03:00
Daniel Walton
291bdc04ec only ipv4 tunnel end points supported for Vxlan
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   roopa@cumulusnetworks.com

Ticket: CM-14197
2017-01-03 15:42:43 +00:00
Julien Fortin
b68a9ea541 addons: bridge: missing bridge-portmcrouter yes/no support under port
Ticket: CM-14199
Reviewed By: Roopa, Nikhil G, Daniel W
Testing Done:

$ cat /etc/network/interfaces
auto br0
iface br0
        bridge-ports swp1

auto swp1
iface swp1
        bridge-portmcrouter yes

$ ifreload -a
$ ifquery -a -c
auto br0
iface br0                                                           [pass]
      bridge-ports swp1                                           [pass]

auto swp1
iface swp1                                                          [pass]
      bridge-portmcrouter yes                                     [pass]

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-03 10:40:26 +03:00
Julien Fortin
2ff98bb9aa addons: address: purge ifalias when no alias keyword is provided
Ticket: CM-13044
Reviewed By: Roopa, Nikhil G, Daniel W,
Testing Done:

For some reason we can't simply write into a file when we want to purge the
ifalias, we have to exec a command. I wasn't able to make it work in any
other way.

add an alias to an interface, ifreload, ip link show interface
modify it, ifreload, ip link show interface
remove it, ifreload, ip link show interface

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-02 02:25:28 +04:00
Daniel Walton
100ab3ea0a 'address-virtual' needs to be multivalue
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   roopa@cumulusnetworks.com

Ticket: CM-14164
2016-12-29 16:29:20 +00:00
Roopa Prabhu
2521bd83df addons: bridge: identify a bridge with bridge-ports or bridge-vlan-aware keywords
Ticket: CM-14158
Reviewed By: julien, nikhilg
Testing Done: Tested with a bridge config without bridge-ports line.

NCLU wants the ability to create a bridge without ports (to add them
later). Today we cannot specify an attribute without values. We get the
below error:
info: processing interfaces file /etc/network/interfaces
error: /etc/network/interfaces: line10: iface bridge: invalid syntax
'bridge-ports'

The error comes from a generic parser check...we will
need to add exceptions to the generic check if we allow attributes
without values.

This patch simply identifies a bridge by both the bridge-vlan-aware and
bridge-ports keyword. For vlan aware bridge it will simply work.
For old bridge driver nclu will have to specify 'bridge-vlan-aware no'
to achieve the same. nclu does not support old bridge
model today, so defering the old bridge driver discussion for later.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-12-21 23:13:10 -08:00
Roopa Prabhu
bca43c556c debian: update changelog
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-12-07 21:19:07 -08:00
Roopa Prabhu
d20a2ae0ad addons: address: fix _cache_update to use the right set cache api
Ticket: CM-13967
Reviewed By: julien, nikhil
Testing Done: tested failing config in the bug

This patch fixes a cache_update problem caught during mtu updates.
Cache updates were failing silently, leaving stale cache values.
For the below config, ifupdown2 was falsely reporting an mtu error,
because the cache had a stale mtu default value

$ifquery peerlink-3 peerlink-3.4094
auto peerlink-3
iface peerlink-3
        bond-slaves swp32s0 swp32s1
        bond-mode 802.3ad
        mtu 9202

auto peerlink-3.4094
iface peerlink-3.4094
        address 27.0.0.11/32
        mtu 9202

$ifreload -a
warning: peerlink-3.4094: vlan dev mtu 9202 is greater than lower realdev peerlink-3 mtu 1500

Before patch:
sequence of events:
- build cache with current system running mtu
- link set mtu 9202 on peerlink-3
- update cache for peerlink-3 to 9202 <---- cache update fails
- when processing peerlink-3.4094, query cache for lowerdev peerlink-3
  mtu: this returns 1500   <--- stale cache value
- print warning

After patch:
sequence of events:
- build cache with current system running mtu
- link set mtu 9202 on peerlink-3
- update cache for peerlink-3 to 9202 <---- cache updates to 9202
- when processing peerlink-3.4094, query cache for lowerdev peerlink-3
  mtu: this returns 9202
- success and proceed

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-12-07 16:41:36 -08:00
Julien Fortin
77934a112f Revert "addons: vxlan: log info when bridge add/del fails"
This reverts commit 6a7f69a5a6.
2016-12-06 04:37:18 +01:00
Julien Fortin
8eb2cf9cf7 ifupdownaddrons: moduleBase: adding length check before array manipulation
Ticket: CM-13862
Reviewed By: Roopa, Eric Pulvino, Nikghil G
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-12-05 03:27:08 +01:00
Julien Fortin
b2a87e4ead addons: ethtool: ifquery -c displays ethtool attribute as 'unknown' when we can't get the running values
Ticket: CM-13820
Reviewed By: Roopa, Daniel W
Testing Done: test from the bug

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-12-02 19:36:40 +01:00
Julien Fortin
96dddc0eaf addons: dhcp: release dhclient4/6 if it's still running but inet/inet6 is not configured
Ticket: CM-13817
Reviewed By: Roopa, Kanna, Nikhil G
Testing Done:

1) use inet and inet6 dhcp in interfaces file
2) do a ifup -v
3) make sure dhclient v4 and v6 is running
4) now remove inet6 dhcp section
5) ifreload -a -v (should kill dhclient6)
6) replace inet by inet6
7) ifreload -a -v (should kill dhclient4 and exec dhclient6)

etc.. I played with all possible combinations

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-12-02 07:15:09 +01:00
Julien Fortin
6ceda69ef0 addons: ethtool: replacing loopback ipcmd check with private LOOPBACK flag
Ticket: CM-13737
Reviewed By: Roopa, Nikhil G
Testing Done:

Incremental commit for CM-13737

Create a policy file such as:

$ cat /var/lib/ifupdown2/policy.d/defaults_policy.json
{
    "README": "This file is automatically generated. Do not edit this file.",
    "ethtool": {
    	       "defaults": {
	       		   "link-autoneg": "off",
			   "link-duplex": "full",
			   "link-speed": "1000"
		},
		"iface_defaults": {}
    }
}

then do ifdown lo && ifup lo

without this patch or af8734d18a
you would reproduce the fail

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-12-02 06:21:35 +01:00
Roopa Prabhu
736e4b0d17 ifupdownmain: fix setting of loopback flag on 'lo' interface
It was initially set in a place where only interfaces with
dependencies were processed. This patch moves it to the right
place.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-12-01 15:51:04 -08:00
Julien Fortin
95735d3ea4 debian: changelog: updating changelog for version cl3u7
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-12-02 00:49:44 +01:00
Julien Fortin
de4104b092 addons: dhcp: executing dhclient4 and dhclient6 ops independently
Ticket: CM-13817
Reviewed By: CCR-5408
Testing Done: steups explained in the bug

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-12-02 00:39:35 +01:00
Roopa Prabhu
09096420d8 addons: address: fix syntax check handler for mtu
I had redefined the main syntax check handler for mtu.
fix it to be a new function.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-12-01 11:48:16 -08:00
Julien Fortin
4cbbf42e70 addons: bridge: don't warn several times for duplicate bridge-ports in stanza
auto br0
iface br0
      bridge-ports swp1 swp2
      bridge-ports swp3 swp4

running ifquery in this configuration gaves us 2 identical warnings:

warning: br0: ignoring duplicate bridge-ports lines: ['swp3 swp4']
warning: br0: ignoring duplicate bridge-ports lines: ['swp3 swp4']

when running ifreload -a we still see 2 warnings, this will need to be looked
at later.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-12-01 07:31:52 +01:00
Julien Fortin
b62a7e7375 addons: dhcp: check if iface has link-local address before starting dhclient6
Ticket: CM-13248
Reviewed By: Roopa, Kanna, Nikhil G
Testing Done: See bug

Today before starting dhclient6, we are sleeping 2 seconds we need to make sure
the configured interface is up and has a link-local address.
In some cases 2 seconds is not enough. This patch will install a retry loop
with a 10 sec timeout.
We are querying ip -6 addr show to make sure the interface is properly confi-
-gured but in the future the plan is to move this call to netlink.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-12-01 06:34:02 +01:00
Roopa Prabhu
1ce8b5bb82 addons: vrf: bring up master on first slave ifup if WITH_DEPENDS is set
Ticket: CM-12988
Reviewed By: julien, nikhil
Testing Done: Tested ifdown and ifup of vrf device with --with-depends

This patch fixes transient errors like below on vrf slaves when
vrf device is being brought up with --with-depends:
"error: swp1: vrf vrf1 not around, skipping vrf config
error: br100: vrf vrf1 not around, skipping vrf config
error: br101: vrf vrf1 not around, skipping vrf config"

In this patch, the vrf device is brought up on bringing
up of the first vrf slave. This is also done in the normal
ifreload -a case.

history on --with-depends for vrf: On vrf device down,
a bunch of slave state gets cleaned up.
and today, ifup of vrf device alone does not fix all that state
especially when there are vrr (macvlan) interfaces involved.
One has to use --with-depends. This is now also part of documentation
https://tickets.cumulusnetworks.com/browse/UD-851

$ifdown vrf1

$ifup vrf1 --with-depends

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-11-30 14:02:19 -08:00
Roopa Prabhu
5e26386921 addons: bridge: warn if we are ignoring bridge-pvid and bridge-vids when
bridge-access is given

Ticket: CM-13683
Reviewed By: julien
Testing Done: Tested with bridge-access, bridge-pvid and bridge-vids on
a bridge-port

$ifquery swp21 bridge
auto swp21
iface swp21
        bridge-access 100
        bridge-pvid 100

auto bridge
iface bridge
        bridge-ports swp20 swp21
        bridge-vlan-aware yes

$ifreload -a
warning: swp21: bridge-access given, bridge-vids and bridge-pvid will be
ignored

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-11-30 09:58:53 -08:00
Roopa Prabhu
8d1e346f53 addons: address: propagate physical mtu to upper vlan devices
Ticket: CM-13221
Reviewed By: julien, nikhil
Testing Done: tested mtu propagation for vlan devices

This is a followup to commit
29de36f36053 ("addons: address: various fixes for mtu handling").
This fixes a pending issue with mtu readjustments on vlan
interfaces on top of physical interfaces.
eg: with the below config:

$ifquery -a
auto swp1.100
iface swp1.100

auto swp1
iface swp1
        mtu 9000

/* at boot-up swp1 and swp1.100 mtu is set to 9000 */
$ifdown swp1  /* resets swp1 mtu to 1500. swp1.100 mtu is reset to 1500
                 implicitly by the kernel */
$ifup swp1    /* swp1 mtu is set to 1500. But swp1.100 mtu stays at 1500
*/

This problem is unique to physical interfaces and vlan devices on
physical interfaces. This is because, when logical interface is ifdown,
kernel deletes all its sub-interfaces.  And on the way up (ifup),
ifupdown2 re-creates all these sub-interfaces for you....that
sequence re-adjusts the mtu. For physical
interfaces, since the sub-interfaces are not deleted,
ifupdown2 does not do anything...and mtu of the subinterface is left to
what it was. And this ends up being what was there initially when the
lower interface went down. And ifdown of the lower physical interface,
resets the physical mtu to default which is 1500. The sub-interface mtu
returns to 1500 while the lower physical interface remains down.
(another detail here: kernel vlan driver re-adjusts mtu of the vlan
sub-interface on its own when the lower device mtu becomes lower. But
does not re-adjust its mtu when the lower device mtu increases. This is
expected and correct behavior). We will have to work around it in
ifupdown2 to suit our needs.

two solutions:
a) when physical interface is brought up, ifupdown2 can go and
pro-actively adjust the upper sub-interface mtu
OR
b) when physical interface is brought down, do not reset the mtu on the
device to default

(b) is the easiest and costs less if we dont expect the mtu of a
physical device to go to default on ifdown.
(a) is doable too, but is additional cost to go over all upper
interfaces.

This patch fixes this problem with solution (a). But, makes sure
this does not add additional cost to the default ifreload -a path.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-11-30 09:58:53 -08:00
Roopa Prabhu
ae330408d8 iface: add support for ifaceLinkPrivFlags.LOOPBACK
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-11-30 09:58:53 -08:00
Julien Fortin
6a7f69a5a6 addons: vxlan: log info when bridge add/del fails
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-29 02:43:24 +01:00
Julien Fortin
3ee939c3fa addons: vxlan: remove vxlan-local-tunnel-ip from bridge fdb add list
Ticket: None
Reviewed By: Roopa
Testing Done:

This was discover while working on CM-13767 and some other vxlan issues

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-29 01:43:14 +01:00
Julien Fortin
88d946862f addons: vxlan: continue to add or delete fdb entry after catching exception
Ticket: CM-13767
Reviewed By: Roopa, Purna, Nikhil G
Testing Done:

auto vx-1000
iface vx-1000
      vxlan-id 1000
      bridge-access 100
      vxlan-local-tunnelip 27.0.0.2
      vxlan-remoteip 27.0.0.1
      vxlan-remoteip 27.0.0.2
      vxlan-remoteip 27.0.0.3
      mstpctl-portbpdufilter yes
      mstpctl-bpduguard yes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-29 01:20:38 +01:00
Julien Fortin
ff59bbc370 Revert "addons: vxlan: support for multiple ip addresses for vxlan-remoteip keyword"
This reverts commit 32e2363a69.

I pushed this commit by mistake. It was a local commit waiting to be reviewed.
Reverting it for now, might be applied later after positive review.
2016-11-28 17:47:11 +01:00
Julien Fortin
af8734d18a addons: ethtool: skip ethtool if current ifaceobj is loopback interface
Ticket: CM-13737
Reviewed By: Roopa, Nikhil G
Testing Done:

tested on VX and hardnodes
2016-11-28 17:42:29 +01:00
Julien Fortin
32e2363a69 addons: vxlan: support for multiple ip addresses for vxlan-remoteip keyword
Ticket: CM-11317
Reviewed By: Roopa, Purna, Nikhil G, Scott Laffer
Testing Done: ifupdown2 smoke + ifupdown2-tests

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-28 14:38:06 +01:00
Julien Fortin
c0cfbfeddb debian: changelog: update changelog for version cl3u7
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 20:23:10 +01:00
Julien Fortin
7b98c26f1a ifupdownmain: properly squash ifaceobj based on their type
Ticket: CM-13689
Reviewed By: Roopa
Testing Done: ifupdown2 smokes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 20:20:50 +01:00
Julien Fortin
22b49c2810 addons: warn or ignore if IP address is assigned to an enslaved interface
Ticket: CM-11967
Reviewed By: Roopa, Daniel W, Nikhil G
Testing Done: ifupdown2-tests

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Julien Fortin
18700e2676 addons: ifquery: re-ordering bridge-ports and bond-slaves interfaces
Ticket: CM-11953
Reviewed By: Roopa, Nikhil G
Testing Done: ifupdown2-tests and ifupdown2 smokes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Scott Emery
abd9194b6e python-nlmanager: Handle decode of ILFA_ADDRESS which is 4 bytes
Ticket: CM-13536
Reviewed By: None
Testing Done: Sankaran tested it out

The IFLA_ADDRESS and IFLA_BROADCAST attributes for all interfaces has been a
6-byte MAC address. But the GRE interface uses a 4-byte IP address for this
attribute. This patch allows for decoding a 4-byte value as an IP address as
well as a 6-byte value as a MAC address.
2016-11-23 04:54:39 +01:00
Julien Fortin
3e960ac241 netlink: moving ip link set master commands to netlink
Ticket:
Reviewed By: Roopa, Daniel W, Nikhil G, Dave O, Scott E
Testing Done: ifupdown2 smokes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Julien Fortin
282b84af6e nlmanager: add support for ip link set master/nomaster
Reviewed By: Roopa, Daniel, Scott E, Nikhil G, Dave O
Testing Done: ifupdown2 smokes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Julien Fortin
38365d4afa addons: address: syntax check for multiple gateways in the same addr family
Ticket: CM-12760
Reviewed By: Roopa, Daniel W, Nikhil G
Testing Done:

$ ifquery br0
auto br0
iface br0
	bridge-ports tap0 tap1
	gateway 1.1.1.2
	gateway 1.1.1.3
	gateway 2001::2
	gateway 2004::2

$ ifreload -a -s
warning: br0: address: 1.1.1.3: multiple gateways for inet family
warning: br0: address: 2004::2: multiple gateways for inet6 family
$
$ echo $?
1
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Julien Fortin
b46f4b05cf ifupdown: iface: fix changes in default json output and ifquery -r output for inet6
Ticket: CM-12370
Reviewed By: Roopa, Nikhil G
Testing Done:

    incremental commit of:
    bef23f40a1e5 dhcp: add support for inet + inet6 dhcp on same interface

    (jessie-30-dev-switch-amd64-sbuild)root@host1:/home/cumulus# ifquery swp1 -o json
    [
        {
            "name": "swp1",
            "addr_method": "dhcp",
            "addr_family": "inet",
            "auto": true,
            "config": {
                "link-duplex": "full",
                "link-autoneg": "off",
                "link-speed": "10000"
            }
        },
        {
            "name": "swp1",
            "addr_method": "dhcp",
            "addr_family": "inet6",
            "auto": true,
            "config": {}
        }
    ]
    (jessie-30-dev-switch-amd64-sbuild)root@host1:/home/cumulus# ifquery swp1 -o json -c
    [
      {
        "name": "swp1",
        "addr_method": "dhcp",
        "addr_family": "inet",
        "auto": true,
        "config": {},
        "config_status": {},
        "status": "pass"
      },
      {
        "name": "swp1",
        "addr_method": "dhcp",
        "addr_family": "inet6",
        "auto": true,
        "config": {},
        "config_status": {},
        "status": "pass"
      }
    ]
    (jessie-30-dev-switch-amd64-sbuild)root@host1:/home/cumulus# ifquery swp1 -o json -r
    [
      {
        "name": "swp1",
        "addr_method": "dhcp",
        "addr_family": [
          "inet",
          "inet6"
        ],
        "auto": true,
        "config": {}
      }
    ]
    (jessie-30-dev-switch-amd64-sbuild)root@host1:/home/cumulus#

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Roopa Prabhu
32c7378dbf man: update ifreload man page to indicate that ifreload is
non-disruptive

Ticket: CM-12655
Reviewed By: julien
Testing Done: tested build and help

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Julien Fortin
05bfbb9a86 ifupdown: iface: if auto %ifacename is not part of the first stanza we squash it
Ticket: CM-12713
Reviewed By: Roopa, Nikhil G
Testing Done: Test from the bug

% for i in range(1,49):
iface swp${i}
    mtu 9216
    link-speed 10000
    link-duplex full
    link-autoneg off
% endfor

auto swp1
iface swp1

% ifup -a -v # should only up swp1

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Julien Fortin
50625cb02b ifupdownmain: warn user if an interface matches a regex but doesn't exists in the config anymore
Ticket: CM-13316
Reviewed By: Roopa, Nikhil G
Testing Done:

auto v0
iface v0
      vlan-id 100
      vlan-raw-device tap1

auto v1
iface v1
      vlan-id 100
      vlan-raw-device tap2

auto v2
iface v2
      vlan-id 100
      vlan-raw-device tap3

auto br0
iface br0
        bridge-ports tap9 regex v.*

In this specific case, if you remove v0 then execute ifreload ifupdown2 will
barf and say that v0 still exists as a dependency of br0.

From roopa:
The problem here is that the dependency gathering should have been done after
the ifdown's. However the ifdown's  need the dependency tree for built in
interfaces which could be part of globs. And this dependency tree needs to be
the current state of things so can't do the selective picking of interfaces
either. So, its a chicken and egg problem.

Ideally when one uses regex, if he is removing an interface that was matched by
a regex, he has to do a 'ifdown' manually today. 'ifdown v0' in this case.

So today we decided to change the warning message to let the user know that he
should manually down the interface that matches a regex.
This is not a permanent fix but a work-around. We don't want to introduce new
changes that may introduce false positive case for existing and working config

post 3.2:
-----------
we should consider doing the down's in two phases during ifreload
a) down everything that we are very certain was removed from the file
(to make sure regex's don't catch it).
b) build dependency tree and run through the down's once more, to
catch all glob matches for built-in interfaces

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Roopa Prabhu
4ea6554108 addons: bridge: disable ip fwding on a bridge with no ip and no upperifaces
Ticket: CM-8363
Reviewed By: purna, balki, julien
Testing Done: Tested bridge bringup with and without addr and svi's

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Roopa Prabhu
d521f1f053 systemd: start-networking: include interface exclusions in all targets
Ticket: CM-12934
Reviewed By: julien
Testing Done: tested systemctl <start|stop> networking with interface
exclusions

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Julien Fortin
dbac1c093e addons: usercmd: ifquery lists user commands and sets unknown status
Ticket: CM-12724
Reviewed By: Roopa, Nikhil G, Daniel W
Testing Done:

$ ifquery br0
auto br0
iface br0
      bridge-ports tap17 tap19
      		   up ls -l

$ ifquery br0 -c
auto br0
iface br0                                                           [pass]
      up ls -l                                                        []
      bridge-ports tap17 tap19					      [pass]

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Julien Fortin
004d1e6585 dhcp: add support for inet + inet6 dhcp on same interface
Ticket: CM-12370
Reviewed By: Roopa, Kanna, Scott E
Testing Done:

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.

(cumulus-qa-infra/cl-tests/tests/smoke/testdhcp.py:Testdhcp_relay)
auto swp1
iface swp1 inet dhcp
      link-speed 10000
      link-duplex full
      link-autoneg off

auto swp1
iface swp1 inet6 dhcp

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Julien Fortin
99b652303f addons: bridge/bond: fix ifquery regression where glob and regexes weren't expanded
Ticket:
Reviewed By: Roopa, Nikhil G
Testing Done:

auto br0
iface br0
      bridge-ports tap17 glob tap[2-4].100 tap19 regex tap2.*

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Roopa Prabhu
eba4da6e52 ifupdown: fix built-in iface ranges to include swp[1-3].100
Ticket: CM-11536, CM-11537
Reviewed By: julien, nikhil
Testing Done: Tested ifup, ifdown, ifquery for inerface ranges

Code already supports 'iface swp1.[2-4]'
This patch extends that support to include 'iface swp[1-3].100'.

Also fixes boundary conditions described in CM-11537. This
makes it consistent with glob syntax.

example config file with all cases:

auto swp[2-4].100
iface swp[2-4].100

auto swp5.[100-104]
iface swp5.[100-104]

auto br0
iface br0
        bridge-ports glob swp[6-7].100

auto bridge.[100-104]
vlan bridge.[100-104]
        bridge-igmp-querier-src 123.1.1.1

auto bridge
iface bridge
        bridge-vlan-aware yes
        bridge-ports glob swp8-9
        bridge-vids 100-104

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Julien Fortin
fa724923e1 netlink: force python to load ifupdown2's nlmanager cpy instead of python-nlmanager
Ticket: CM-13453
Reviewed By: Roopa, Nikhil G, Daniel W
Testing Done: ifupdown2-tests

We had an issue where python-nlmanager and ifupdown2's nlmanager differed
When netd starts it loads ifupdown2's addons, so it also tries to do the
imports. Since the current working directy is not /usr/share/ifupdown2 but
netd directory it won't load ifupdown2's nlmanager first but python-nlmanager
if it exists.

Here we insert/hardcode /usr/share/ifupdown2/ first in the path to make sure
we load the right nlmanager

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Roopa Prabhu
9f30b2cca7 addons: address: various fixes for mtu handling
Ticket: CM-6908, CM-6110, CM-13221
Reviewed By: julien, nikhil
Testing Done: added a new test in ifupdown2-tests which covers all cases

- move all mtu handling to a single function in addons/address.py
- Have an ifupdown2 default of 1500 mtu
- add a policy manager max_mtu check (we want to default cumulus max mtu
  to 9216)
- special handling for bond and bridges
        -  print an info log abt setting mtu on bridge
        -  this can be enhanced in the future to look
        at individual port mtu and rejecting the bridge mtu.
        this operation can be expensive right now. Hence
        just an info log.
- bond and vxlan dev mtu follow the rules of physical device mtu

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-11-23 04:54:39 +01:00
Vidya Sagar Ravipati
d8b6aad0d5 ifupdown2:ethtool: Add link-fec extension support
Ticket:CM-12695
Reviewed By:TBD
Testing Done:
Validated
a) ifup -v <interface>
b) ifdown -v <interface>
c) ifreload -a

Changes:
a) Support for link-fec attribute for link to configure
   FEC configuration

Ex:
auto swp17
iface swp17
link-autoneg on
link-fec rs

Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Vidya Sagar Ravipati <vidya@cumulusnetworks.com>
2016-11-23 04:54:38 +01:00