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

31 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
b94e4d24ea addons: vrf: fix incorrect check when checking for running vs configured slaves
change 'or' to 'and'. Its valid for one of them to be null.
This was causing vrf enslavement errors during bootup.
This was a recent regression.

Closes: CM-9757
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-03-08 14:09:30 -08:00
867e11a242 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-02 13:07:11 -08:00
659097a03b ifupdownaddons: iproute2: Fix for error while enslaving 'eth0' to a vrf
Ticket: CM-9594
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown2 deb onto cel-e1031-01

This patch fixes the failure to execute the command
'ip link set dev eth0 nomaster' when 'eth0' is associated with any vrf

This patch also include a review comment update for CCR-4210
2016-03-02 10:32:45 -08:00
3fcb15febd addons: vrf: Ensures fib rule for local table have higher pref than fib vrf rule
Ticket: CM-9541
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown2 deb onto cel-e1031-01

This patch checks if fib rule for local table have higher pref
than vrf table, if not, it deletes fib rule for local table
with lower pref and adds fib rule for local table with
higher pref than vrf table.

This patch also avoid repeated addition of vrf rules on each ifup
2016-02-29 19:03:51 -08:00
d1d103e17a addons: vrf: support to avoid changing table ids
Ticket: CM-9107
Reviewed By: Roopa Prabhu
Testing Done: Yes, by installing ifupdown2 deb onto cel-e1031-01

This patch adds a check to detect change in vrf config table id
compared to running table id and throw an error accordingly.
2016-02-26 16:29:09 -08:00
768b4ec52f vrf: handle slaves when vrf device is brought up
The vrf device may not be up when ifup is executed on the
slaves. This commit makes sure:
- vrf slaves dont try to enslave themselves when vrf device is
not present
- And vrf master enslaves any missing slaves during ifup of vrf master
- Also make vrf device the link master, this will make sure
the vrf device brings the vrf slave links up. This is needed to work
around the ipv6 address flush issue

Closes: CM-9493
Review: dsa, nikhil, wkok (via git send-mail)
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-02-26 15:42:42 -08:00
54616d3f51 addons: vrf: support for vrf-default-route attribute
Ticket:CM-9106
Reviewed By: Roopa Prabhu and Dave Olson
Testing Done: Yes, by installing ifupdown and cumulus-tools deb on to cel-e1031-01

This patch adds per vrf default route: "ip route add table <tbid> unreachable default"

It also accepts a policy file with vrf-default-route [yes/no]

This also includes ifquery fixes for running and check.
2016-02-23 16:02:31 -08:00
a1c2368634 addons: vrf: iproute2 only reads .conf files
Fix iproute2 vrf map file to end with .conf

Closes: CM-9137
Reviewed By: Roopa
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
2016-02-04 22:02:30 -08:00
8465de9077 addons: support for new addon module for vrf
This patch adds initial support for vrf in ifupdown2.

Example interfaces file section:
auto swp1.100
iface swp1.100
    vrf blue

auto blue
iface blue
    vrf-table 10

iproute2 vrf map is generated under:
/etc/iproute2/rt_tables.d/ifupdown2.vrf_map

this patch also adds prelimnary support for 'vrf-table auto'.
But this needs more work.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-01-28 22:01:59 -08:00