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

28 Commits

Author SHA1 Message Date
Julien Fortin
2c592263a4 ifupdown: valivals keyword: remove <auto> and renaming <ipaddr> to <ip>
Ticket: None
Reviewed By: Daniel Walton
Testing Done:

This commit was need to keep nclu and ifupdown2 consistent.
The naming were differing and we decided to keep nclu version.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-08-01 17:23:30 +02:00
Julien Fortin
482b2fab80 attribute syntax check using validvals/validrange and keywords
Ticket: CM-8101
Reviewed By: CCR-4949
Testing Done: smoke tests + ran ifup -a -s on every interface configuration file from GSS cl-supports collection

This commit is introducing ~20 keywords. The value of the different attributes
will be check against raw values and <keywords>:

'<mac>'
'<text>'
'<ipv4>'
'<ipv6>'
'<auto>': "auto"
'<ipaddr>': ipv4/6 with preflix len
'<number>'
'<interface>'
'<ipv4-vrf-text>': equivalent to: <ipv4> "vrf" <text>
'<number-ipv4-list>': example: "100=172.16.100.1 101=172.16.101.1"
'<interface-list>': example: "swp1 swp2 swp3"
'<ipv4/prefixlen>'
'<ipv6/prefixlen>'
'<ipaddr/prefixlen>'
'<number-range-list>': example: "2000 2200-3000"
'<interface-range-list>': example: "swp1=100 swp2=100" ('validrange' : ['0', '65535'])
'<mac-ipaddr/prefixlen-list>'
'<number-interface-list>': example: "4 swp1 swp2"
'<interface-yes-no-list>': example: "swp1=yes swp2=no"
'<interface-yes-no-0-1-list>'
'<interface-yes-no-auto-list>'

It's possible to combine a keyword with a range from validrange. example:
validrange: 10-50
validvals: <intrface-range-list>
value: swp1=21 swp2=42 ...

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-08-01 09:28:16 +02:00
Roopa Prabhu
1b284018d5 addons: addressvirtual: enslave macvlans on vrf slaves to the vrf master
Ticket: CM-11803
Reviewed By: dsa, scotte, wkok, nikhil, julien
Testing Done: tested config of address-virtual lines on vrf slaves

This patch does the following:
- addressvirtual: enslaves macvlans created on vrf slaves
to the vrf master
- vrf: when looking for stale slaves on vrf master, skip
macvlan devices. This code does basic checking right now
and can be improved to include more cases.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-07-26 14:43:47 -07:00
Julien Fortin
a28b54359f addons: addressvirtual: allowing address-virtual attr for vrf slave interfaces
Ticket: CM-11745
Reviewed By: Roopa, Nikhil G
Testing Done: configuration provided in the bug

User was attempting to configure a traditional bridge under a VRF with VRR.
When issuing ifreload -a, the configuration failed to apply with an error.

Applying an address-virtual keyword to an interface with upper interfaces
or parent interfaces was not allowed. But now we are allowing the use of
this keyword only for vrf slaves.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-07-13 23:25:07 +01:00
Scott Emery
f8ad40ceea ifupdown2: Disable IPv6 duplicate address detection on VRR interfaces
Ticket: CM-11511
Reviewed By: CCR-4890
Testing Done: Used "address-virtual" keyword to create VRR interface with IPv6
address. Checked sysctl and dad failures.

In a VRR setup, both switches are programmed with the same IPv6 address and that
address is active on both switches. This causes the IPv6 duplicate address
detection to kick in and diable the use of one of the address on one of the
switches. This patch causes duplicate address detection to be disabled on VRR
interfaces by setting the net.ipv6.conf.<ifname>.accept_dad and
net.ipv6.conf.<ifname>.dad_transmits sysctl's to 0. The only IPv6 addresses
which are defined on these interfaces are the virtual addresses and the link
local address (which is unused). No other operational IPv6 addresses should ever
be assigned to these interfaces. Instead, operational IPv6 addresses should be
assigned to the "base", or lower, interface of the VRR interface.
2016-06-24 10:49:27 -07:00
Daniel Walton
c6370b563b Add validvals to addons, to be used by iface/ifedit wrapper
Ticket: CM-8669
Reviewed By: Julien
Testing Done:

<DETAILED DESCRIPTION (REPLACE)>
2016-06-16 03:37:35 +01:00
Julien Fortin
2864d6f361 Replace rtnetlink modules with python-nlmanager calls
Ticket: CM-7360
Reviewed By: CCR-4721
Testing Done: smoke / testifreload / Tested on amd64 platform (by Sam)

This patch replaces all calls to rtnetlink with python-nlmanager.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-06-16 03:37:35 +01:00
Roopa Prabhu
bf3eda91db addons: move some warns to errors and make sure all errors set the exit
code correctly

Ticket: CM-7168
Reviewed By: julien
Testing Done: Tested ifupdown2 negative testcases and ran ifupdown2 smoke

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-05-15 13:54:53 -07:00
Julien Fortin
b66881465d addons: address virtual: adding 0s to (if necessary) pad address-virtual
Ticket: CM-10853
Reviewed By: Roopa
Testing Done: Tested with the provided interface file and different
address-virtual value.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-05-10 17:27:37 +02:00
Julien Fortin
9e0be374dc new ifupdown2.conf variable to adjust logical devices MTU
Ticket: CM-8736
Reviewed By: Roopa
Testing Done: Smoke tests + the ones from the ticket

By default ifupdown2 will adjust logical devices MTU
based on the physical interface they are running on top of.
set this flag to 0 to disable this behaviour
adjust_logical_dev_mtu=1
2016-04-29 21:19:42 +02:00
Julien Fortin
f466af7a8c addons: addressvirtual: fixing: duplicate address-virtual lines cause switch to lockup
Ticket: CM-10478
Reviewed By: Roopa
Testing Done: Tested with the interface file provided in the ticket and a custom one.
2016-04-25 17:39:57 +02:00
Roopa Prabhu
fc5e1735c0 ifupdown: add new ifupdownflags class to carry ifupdown flags
Ticket: cleanup
Reviewed By:
Testing Done: Tested ifupdown sanity

This gets rid of some ugly previous flag handling which was
passed through modules. This creates a global instance of
flags that all addon modules and helper modules can use.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-04-14 22:30:53 -07:00
Nikhil
586535e8db addons: vrf: ifquery fixes for vrf
Ticket: CM-10175
Reviewed By: Roopa Prabhu
Testing Done: yes, by installing ifupdown .deb onto dell-s3000-02

This patch fixes inappropriate ifquery fails.
This patch also include a review comment update for addressvirtual.py
[CCR-4310], ticket: [CM-8658]
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2016-04-04 02:20:44 -07:00
Nikhil
050838834b Revert "addons: vrf: ifquery fixes for vrf"
This reverts commit 934c4c49c0.

    Ticket: CM-10175
    Reviewed By: Roopa Prabhu
    Testing Done: yes, by installing ifupdown .deb file onto dell-s3000-02

default addr fix for vrf check is deleting lo addrs accidentally
info: rtnetlink: setting link lo up
info: executing ip addr del ::1/128 dev lo
info: executing ip addr del 127.0.0.1/8 dev lo
info: eth0: running ops ...

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2016-04-01 21:33:16 -07:00
Nikhil
934c4c49c0 addons: vrf: ifquery fixes for vrf
Ticket: CM-10175
Reviewed By: Roopa Prabhu
Testing Done: yes, by installing ifupdown .deb onto dell-s3000-02

This patch fixes inappropriate ifquery fails.
This patch also include a review comment update for addressvirtual.py
[CCR-4310], ticket: [CM-8658]
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2016-03-30 19:13: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
Sam Tannous
5df79763d3 Virtual interfaces for VRR bounced during ifreload -a
Ticket: CM-8143
Reviewed By: scotte, roopa
Testing Done: ssim and powerpc

This was first seen as a side issue with switchd terminating and not restarting (filed as CM-8109).

When ifreload -a is issued, all of the vrr interfaces were bounced, even though there were not any
configuration changes.

In keeping with the philosphy of making ifreload non-disruptive, this patch no longer
disrupts vrrs if the existing config has not changed.
2015-11-16 23:43:39 -05:00
Sam Tannous
55072bd128 ifupdown2 patch to properly remove address-virtual mac addresses
Ticket: CM-6702
Reviewed By: roopa
Testing Done: unit and smoke tested with ifupdown2 suite

When address-virtual mac adddress is modified, removed from an SVI, or the SVI is removed,
the permanent mac address is not removed.

This patch addresses all three cases but creating a global statemanager instance
and removing address-virtual FDB entries that were previously configured.
2015-07-23 15:43:45 -04:00
Roopa Prabhu
00f6105d9f Add hack to flap macvlan dev if it already exists and if the route to the vrr network is pointing to it (part of commit 1ef86ab1930d198b0fba7ac33576c22f34d89f14)
Ticket: CM-4639
Reviewed By:
Testing Done: Tested with interfaces file and steps from the bug

This is a Hack to make sure the primary address
is the first in the routing table. Its not a full proof solution.

We use `ip route get` on the vrr network to see which
device the kernel returns. if it is the mac vlan device,
flap the macvlan device to adjust the routing table entry.
flapping the macvlan device makes sure the macvlan
connected route goes through delete + add, hence adjusting
the order in the routing table.
2014-12-31 23:43:27 -08:00
Roopa Prabhu
a9d3664814 Dont warn on fdb del failures during down
Ticket: CM-4178
Reviewed By:
Testing Done: Tested vrr interface up and down

Checking and deleting is expensive. so, ignore delete failures.
Currently logs them at debug level.
2014-11-11 21:22:36 -08:00
Roopa Prabhu
aaef0a7928 limit macvlan device names to 15chars
Ticket: CM-3346
Reviewed By:
Testing Done: sanity test address-virtual lines
2014-11-08 06:29:26 -08:00
Roopa Prabhu
8e113d6319 misc query and fdb/vlan add fixes
Ticket: CM-3346
Reviewed By:
Testing Done: ifupdown2 sanity
2014-11-03 17:55:51 -08:00
Roopa Prabhu
cb46a2082f misc bug fixes for svi address propagation, svi query etc
Ticket: CM-3346
Reviewed By:
Testing Done: Tested new format with new bridge driver

- add/del vlan aware bridge svi mac addresses from bridge
- shorten macvlan interface names to <bridge>-<vid>-v<n>
- fix query check for address-virtual interfaces
- fix query check for vlan interfaces
2014-10-28 23:04:40 -07:00
Roopa Prabhu
e160136944 Bug fixes and some query support
Ticket: CM-3346
Reviewed By:
Testing Done: sanity testing and syntax testing for new bridge driver
2014-10-28 16:10:00 -07:00
Roopa Prabhu
84ca006f82 First phase checkin for new format for vlan aware bridge
Ticket: CM-3346
Reviewed By:
Testing Done: Sanity test + test new bridge format

There are a bunch of open issues with `vlan` interface handling.
Below is the format.

auto swp1
iface swp1
    bridge-access 300
    mstpctl-pathcost 0
    mstpctl-adminedge yes
    mstpctl-autoedge yes
    mstpctl-p2p yes
    mstpctl-bpduguard yes
    mstpctl-treeprio 64
    mstpctl-network yes
    mstpctl-bpdufilter yes

auto swp2
iface swp2
    bridge-vids 301
    bridge-pvid 302
    bridge-pathcost 10
    bridge-priority 10
    bridge-multicast-router 0
    bridge-multicast-fast-leave 1

auto br0
iface br0
    bridge-vlan-aware yes
    bridge-stp on
    bridge-ports swp1 swp2
    bridge-vids 2001

auto br0.2001
iface br0.2001
    address 10.0.14.2
    hwaddress 00:03:00:00:00:12
    address-virtual 00:00:5e:00:01:01 11.0.4.1/24

auto br0.2001
vlan br0.2001
    bridge-igmp-querier-src 172.16.101.1
2014-10-24 10:11:07 -07:00
Roopa Prabhu
e74d01e1b2 Add rtnetlink api's for link creates
Ticket: CM-3346
Reviewed By:
Testing Done:
2014-10-12 13:50:05 -07:00
Roopa Prabhu
667d62f587 Make query check a no-op for the vlan aware bridge until correctly fixed
Ticket: CM-3346
Reviewed By:
Testing Done: sanity test
2014-10-09 21:22:12 -07:00
Roopa Prabhu
15ef32ea14 Move ifupdown2addons into ifupdown2 pacakge
Ticket: CM-3864
Reviewed By:
Testing Done: Tested build and install

open item:
- cleanup stale ifupdown2-addons package files
2014-10-09 16:02:46 -07:00