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

742 Commits

Author SHA1 Message Date
Julien Fortin
3da42c983c addons/bridge.py: warn and ignore bridge-ports duplicate lines
Ticket: CM-8744
Reviewed By: CCR-4321

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-03-29 00:47:03 +02:00
Julien Fortin
041ac313a5 sbin/ifupdown2: Adding -V/--version argument to display current ifupdown2 version
Ticket: CM-8564
Reviewed By: CCR-4369

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-03-28 21:23:03 +02:00
Nikhil
c47acd7902 ifupdownmain: Reverting commit 25f41c2ab3
Ticket: CM-10112
Reviewed By: Shrijeet Mukherjee, Natarajan Sankaran
Testing Done: yes, by installing ifupdown .deb file onto act-5712-09

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2016-03-25 18:51:57 -07:00
Roopa Prabhu
60fa92039e addons: vrf: temporarily disable kill_ssh
Ticket: CM-10094
Reviewed By:
Testing Done:

It is killing ifupdown2 and setsid is not working as expected
2016-03-25 08:25:44 -07:00
Nikhil
32f6e6ca40 addons: vrf: drop ssh connections over eth0 on enable or disable
Ticket: CM-9881
Reviewed By: Roopa Prabhu
Testing Done: yes

This patch is the second version of drop ssh sessions
changes:
    added try catch around os.setsid()

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2016-03-25 00:45:24 -07:00
Roopa Prabhu
aa36221f34 addons: vrf: more ordering fixes for management vrf and dhcp vrf slaves
fixes the following:
- if the vrf slave had a master but is no longer a slave
according to ifaceobj, look at running state and
undo vrf enslavement
- add support to cl-vrf service disable <vrf>

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-24 21:59:54 -07:00
Roopa Prabhu
25f41c2ab3 ifupdownmain: don't down vrf master in sched callback ops
This was bringing down vrf master earlier than required
leading to ssh session hangs in case of management vrf

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-24 21:55:58 -07:00
Nikhil
5c5a7b93cd addons: vrf: drop ssh connections over eth0 on enable or disable
Ticket: CM-9881
Reviewed By: Roopa Prabhu
Testing Done: yes

***initial version ***
SSH clients will be closed to avoid the connection hang
when management VRF is enabled or disabled using a login through eth0
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2016-03-24 17:55:47 -07:00
Roopa Prabhu
f825610ec6 addons: vrf: down the slave after unslaving during down
Ticket: CM-10050
Reviewed By:
Testing Done: tested with bridge testcase described in the bug
2016-03-23 23:51:11 -07:00
Roopa Prabhu
892c495ea8 scheduler: do not propagate upperiface bring up error state
Ticket: CM-10016
Reviewed By:
Testing Done: Tested with the upperiface bring up case described in
CM-10016

upperiface bringup is best effort and does not imply that the current
interface bring up has an error. It only means that the upperiface may
be in an incomplete state. Hence this patch resets scheduler error state
before returning from upperiface bringup.
2016-03-23 22:24:30 -07:00
Roopa Prabhu
f1c9248267 addons: vrf: delete rules before deleting the vrf interface on down
Ticket: CM-10057
Reviewed By: trivial
Testing Done: Tested ifdown of a vrf interface
2016-03-23 21:12:47 -07:00
Roopa Prabhu
fd8c6caf7f addons: vrf: enforce reserved table id range 1001-5000
Ticket:
Reviewed By:
Testing Done: Tested vrf-table id with valid and invalid table ids

currently the reserved table id range is set to 1001-5000
and it comes from a policy file /var/lib/ifupdown2/policy.d/vrf.json
2016-03-23 19:33:16 -07:00
Roopa Prabhu
c4be54818e addons: vrf: during down of a vrf device make sure to refresh dhcp slaves
Ticket: CM-10049
Reviewed By:
Testing Done: Tested disabling management vrf
2016-03-23 19:04:59 -07:00
Roopa Prabhu
097533507b addons: vrf: multiple fixes to vrf enslavement and auto handling
Ticket: CM-10005
Reviewed By:
Testing Done: Tested boot and ifreload after changes

- fix access to addr_method on an object which had no
address method defined. This was a recently introduced
regression that caused vrf enslavement to end per-matuarely.
- few fixes around vrf_table conversion between string
and integer
2016-03-23 00:08:34 -07:00
Roopa Prabhu
3f1811d949 addons: vrf: use full path to cgdelete
Ticket: CM-10018
Reviewed By: trivial
Testing Done: Tested ifdown of vrf device
2016-03-22 21:38:23 -07:00
Roopa Prabhu
b5c2f02ff7 scheduler: fix incorrect check of SCHED_STATUS
Ticket: CM-9993
Reviewed By: julien
Testing Done: Tested with interfaces file and steps described in the CM

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-22 14:11:23 -07:00
Sam Tannous
16e30aab93 ifquery --running should not display link attributes unless they are different then defaults.
Ticket: CM-9995
Reviewed By: julien
Testing Done: Tested on amd64 hardnode

Right now, ifquery -r shows link speed, duplex and autoneg current running values.
This patch changes the behavior to not show link attributes unless they
differ then the defaults for that interface.
2016-03-22 15:53:05 -04:00
Nikhil
c61672da44 addons: vrf: move ip -6 fib rule for local table
Ticket: CM-9968
Reviewed By: Roopa Prabhu
Testing Done: yes, by installing ifupdown .deb file onto dell-s3000-02

patch to move ip -6 fib rule for local table after vrf rules

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2016-03-21 12:39:18 -07:00
Nikhil
e607276995 addons: vrf: Avoid adding duplicate fib6 rule
Ticket: CM-9975
Reviewed By: Roopa Prabhu
Testing Done: yes, by installing deb file onto dell-s3000-02

Avoid adding duplicate ipv6 fib rule when one is missing for IPv4
2016-03-21 12:35:58 -07:00
Nikhil
4d3dc0f752 addons: addressvirtual: vrr virtual mac multicast bit check
Ticket: CM-8658
Reviewed By: Roopa Prabhu, Scott Emery
Testing Done: Yes, by installing ifupdown .deb file onto cel-e1031-01

This patch includes a check for multicast bit of vrr virtual mac
address and set an error

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2016-03-21 12:35:58 -07:00
Roopa Prabhu
3cdb161971 networkinterfaces: don't warn if sourced lines contain globs
Ticket: CM-9908
Reviewed By: julien
Testing Done: tested sourcing files with globs and non-globs

warn if sourced line has a glob ('*')
2016-03-19 19:45:33 -07:00
Roopa Prabhu
4d2c979814 addons: vrf: fix a few vrf enslavement and table id allocation corner cases
Ticket: CM-9957
Reviewed By: dsa, julien, nikhil
Testing Done: Tested vrf enslave/deslave + ifreload

This patch fixes a few corner cases:
- release dhcp on all new enslavement or change of enslavement
- fix a NoneType error on ifreload when a vrf enslavement was removed
- handle a corner case with auto table ids

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-18 21:25:09 -07:00
Roopa Prabhu
2009513fa2 ifupdownmain: scheduler: propagate sched error on interfaces to upper layers
Ticket: CM-7168
Reviewed By: julien, nikhil, stannous
Testing Done: Tested with errors in interfaces file

This patch changes a few errors to warns. and propagates errors
on ifaceobjects to upperlayers.

- any exception passed to upper layers (/sbin/ifupdown) results in
exit code of 1

- It uses a global SCHED flag to flag a scheduler error (maybe there is
  a better way). But traversing all the interfaces again to check status
is an overkill

- Changes a few errors to warns

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-18 11:45:54 -07:00
Roopa Prabhu
d54baa2232 addons: vrf: fix cases where auto was getting written to iproute2 vrf map
Ticket:
Reviewed By: trivial
Testing Done:

This also changes a few errors to warn

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-18 11:22:22 -07:00
Roopa Prabhu
aa4e30220a ifupdownmain: ifreload: log a message if no new interfaces found
Ticket:
Reviewed By: trivial
Testing Done:

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-17 16:23:40 -07:00
Roopa Prabhu
122ef35bf9 addons: vrf: release any dhcp leases before vrf slave enslavement
Ticket: CM-9929
Reviewed By:
Testing Done: Tested vrf dhcp slave enslavement on ifreload

algo:
- when a vrf slave enslavement changes, before performing the
  new master enslavement,
- check if vrf slave has dhcp configured
- if yes, release dhclient running on the vrf slave
2016-03-17 16:18:14 -07:00
Roopa Prabhu
05ca6f0140 addons: vrf: set metric 240 for vrf installed default unreachable routes
Ticket: CM-9934
Reviewed By: trivial
Testing Done: Tested vrf create and destroy
2016-03-17 12:34:56 -07:00
Roopa Prabhu
df53966d0d addons: vrf: handle auto table ids for dhcp slaves
Ticket: CM-9921
Reviewed By: trivial
Testing Done: Tested with table id auto for management vrf

I have recently added special handling for vrf slaves with dhcp.
And missed handling of vrf-table auto for such slaves.
This patch fixes auto when bringing up vrf masters for dhcp vrf
slaves

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-17 09:07:53 -07:00
Roopa Prabhu
2ddd65c587 ifupdownmain: squash multiple iface stanzas for the same interface by
default

Ticket:
Reviewed By: CCR-4268 (previous review)
Testing Done: Tested ifup/ifdown/ifreload/ifquery of multiple iface stanzas for
same interface

This patch is an extension to previous commit 99ce689411.
The previous commit squashes both external (ifquery) and internal
(ifup/ifdown/ifreload) representation of multiple iface stanzas into
one and it is off by default.

What we really want is internal representation to be squashed by
default. To that effect this patch introduces a new config flag
ifaceobj_squash_internal to only squash internal representation which is
used by ifup/ifdown/ifreload. ifquery forces this flag to off so that
external representations remain unsquashed and user does not see any
difference. This flag is on by default.

User can still get a squashed external representation if he sets
ifaceobj_squash=1 in ifupdown2.conf

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-16 18:50:06 -07:00
David Ahern
dad6af7eb7 docs: Update mgmt vrf example
Change mgmt vrf name to just 'mgmt'
Add loopback address
Change table from 252 to auto

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
2016-03-16 17:33:40 -06:00
Nikhil
8b43d01d67 addons: vrf: avoids ifupdown2 error when VRF defined but not used
Ticket: CM-9596
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown2 deb onto cel-e1031-01

This patch makes sure ifupdown2 will not report a NoneType error
when VRF is defined but not used
2016-03-16 14:07:28 -07:00
Julien Fortin
1edfb8a39b Detect and ignore the ether keyword in /etc/network/interface
Current supported syntax: "hwaddress [ether] 01:02:03:04:05:06"

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-03-16 19:40:50 +01:00
Julien Fortin
24ec034044 Revert "Detect and ignore the ether keyword in /etc/network/interface"
This reverts commit d60b92a59f.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-03-16 19:30:08 +01:00
Julien Fortin
d60b92a59f Detect and ignore the ether keyword in /etc/network/interface
Current supported syntax: "hwaddress [ether] 01:02:03:04:05:06"

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-03-16 18:31:45 +01:00
Julien Fortin
428206bfb7 Detect and ignore the ether keyword in /etc/network/interface
Ticket: CM-6896
Reviewed By: CCR-4276
Testing Done:

host: sm-e1031-02

$ # > adding "hwaddress 02:01:02:03:04:08" to eth0 in /etc/network/interfaces
$ ifreload -a
$ ifup -v -a
$ ifdown -a -v
$ ifquery -c -a
$ reboot
$ # > analyze /var/log/syslog for boot error message
$ cat /var/log/syslog | grep ifupdown

I did the same process with "hwaddress ether 02:01:02:03:04:11"
also without the hwaddress statement.
2016-03-15 15:41:04 +01:00
Roopa Prabhu
8ad5c76784 addons: vrf: special handling for vrf slaves configured for dhcp
Ticket: CM-9868
Reviewed By: dsa, nikhil, julien
Testing Done: tested with vrf slaves with dhcp

Problem:
since vrf slaves are brought up before master, When vrf slaves are
configured for dhcp, the dhclient hook for vrf runs before the master is
up. This was seen with management vrf.
This solution is special logic to handle vrf slaves with
dhcp in the vrf addon module.

currently only supports interface declared with dhcp and
indicated as vrf slave. as in example below (dhcp and vrf must be in the
same iface stanza):

auto eth0
iface eth0 inet dhcp
        vrf mgmt

changes to vrf module:
- make vrf module methods accept the ifaceobj lookup function, which is
already passed as argument to all methods from ifupdown scheduler
- during vrf slave bringup,
        - if master does not exist and slave's address_method is dhcp
        - lookup master object, and bring up the vrf master
        - mark this master as processed so that the next time this vrf
          module sees master it knows that it is already processed
          (this is covered by the vrfPrivFlags)

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-14 23:01:05 -07:00
Roopa Prabhu
40103cf756 addons: vrf: use full path to cgcreate and cgset
This avoids 'No such file or directory' errors at bootup
when ifupdown2 is called from the init script

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-14 22:05:49 -07:00
Roopa Prabhu
4a95c92f55 addons: vrf: fix typo in reading vrf-max-count attribute name get at init
Ticket: CM-9105
Reviewed By: trivial
Testing Done: tested vrf bringup and default attributes at boot
2016-03-13 18:17:35 -07:00
Roopa Prabhu
83841a5136 addons: vrf: fix typo in vrf default attribute name get at init
Ticket: CM-9105
Reviewed By: trivial
Testing Done: tested vrf bringup and default attributes at boot

also change some policy manager errors to info
2016-03-13 18:04:23 -07:00
Roopa Prabhu
6f2890fcf4 vrf: finish support for vrf-table auto
Ticket: CM-9105
Reviewed By: dsa, nikhil, julien
Testing Done:

This commit contains:
- few logic fixes in vrf-table auto handling code
- adds a new policy manager api to read module global
attributes like the below:
 "module_globals": {"vrf_table-id-start" : 1001,
                    "vrf_table-id-end" : 5000,
                    "vrf-max-count" : 64 },
                    "vrf-cgroup-create" : "yes" },

- Accepts following new vrf attributes from policy files

{
    "vrf": {
        "module_globals": {"vrf_table-id-start" : 1001,
                           "vrf_table-id-end" : 5000,
                           "vrf-max-count" : 64 },
                           "vrf-cgroup-create" : "yes" },
        "defaults": { "vrf-default-route": "yes" }
    }
}
2016-03-11 18:44:25 -08:00
Roopa Prabhu
2876ca35c1 Revert "Detect and ignore the ether keyword in /etc/network/interface"
This reverts commit bed653e31b.

Reverting commit because this does not do the right thing and also
prints 'NoneType' errors. We should not be changing anything for
running values. The ether check is only needed for configured values.
2016-03-11 15:56:34 -08:00
Julien Fortin
bed653e31b Detect and ignore the ether keyword in /etc/network/interface
Upstream syntax : "hwaddress ether 01:02:03:04:05:06"
Our new syntax: "hwaddress [ether] 01:02:03:04:05:06"

Ticket: CM-6896
Reviewed By: CCR-4276
Testing Done:

Modified /etc/network/interfaces adding/removing `ether` and playing around
2016-03-11 20:59:56 +01:00
Nikhil
4ce47ce4ed vrf: Fix to remove FIB rules on VRF delete
Ticket: CM-9814
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown .deb file onto cel-e1031-01
2016-03-10 15:40:23 -08:00
Nikhil
0ba9abeb60 vrf: adding default route to ipv6 table
Ticket: CM-9773
Reviewed By: Roopa Prabhu
Testing Done: yes, by installing ifupdown .deb file onto cel-e1031-01

adding default route to ipv6 table when the attribute
vrf-default-route is set to yes
2016-03-10 13:57:12 -08:00
Roopa Prabhu
d1e1c43bcf vrf: check for cgroup existance before creating and deleting them
Ticket: CM-9776
Reviewed By: dsa
Testing Done: tested repeated up and downs
2016-03-10 11:29:30 -08:00
Roopa Prabhu
2df6a60f74 vrf: add and delete l3mdev task cgroups
Ticket: CM-9776
Reviewed By:
Testing Done: Tested ifup and ifdown of a vrf dev

$ifup -a -v
info: Executing cgcreate -g l3mdev:blue
info: Executing cgset -r l3mdev.master-device=blue blue

$ifdown -a -v
info: Executing cgdelete -g l3mdev:blue
2016-03-10 11:10:50 -08:00
Roopa Prabhu
b3745e05ed modulebase: add ifaceobj.set_status calls in log_error and log_warn
Ticket:
Reviewed By: trivial
Testing Done:

This can be used by callers to set iface object status.
2016-03-10 11:10:50 -08:00
Roopa Prabhu
ceed018d8e iface: add status WARNING and a new method set_status
Ticket:
Reviewed By: trivial
Testing Done:

This patch adds WARNING to ifaceStatus and adds a new method
iface:set_status

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-10 11:10:49 -08:00
Sam Tannous
972026024f ifquery --check should not check default attributes when not requested
Ticket: CM-7938
Reviewed By: roopa
Testing Done: tested on amd64 cel-redxp box

If the user has not configured a link attribute,
we should not be checking it against the default config.
This will only confuse users into thinking link attributes
were configured.

Modifications to the ethtool.py addon module
to check of configs exist before checking them.
2016-03-10 10:33:13 -05:00
Julien Fortin
4ce08bc737 When bringing up a bond with a clag id rtnetlink_api is raising an exception
Ticket: CM-9615
Reviewed By: CCR-4272
Testing Done:

The protodown calls to rtnetlink_api now have a try/except.
2016-03-10 02:04:48 +01:00