Ticket: CM-12552
Reviewed By: julien, nikhil
Testing Done: tested with failing config with bridge-access 1
This is similar to the fix done in the below commit for pvid:
"5061730ea5bf ("addons: bridge: fix default pvid handling in cases where
cache is stale")"
easier steps to reproduce:
- have a vlan aware bridge with more than one ports
- add 'bridge-access 1' to one of the ports
- boot the box with the config
- check that the vlans are fine
- ifdown <interface_with_bridge_access_1>
- ifreload -a
- the interface with bridge_access 1 does
not have the pvid flag on vlan 1
This patch makes sure we assume the right running
vid and pvid value ie [1] and 1 if the
cache returns no values. vid = [1] and pvid = 1
are the kernel default/initial values for a port.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Ticket: CM-12084
Reviewed By: julien, nikhil
Testing Done: tested with --allow=mgmt class
This fixes a problem where vrf map file was getting deleted
at boot during the second invocation of ifup. This is because
the code uses PERFMODE to check it is boot..but does
not realize that this may not be the first invocation of
ifup during the boot.
This patch adds additional checks for mgmt netdev to
make sure we delete the vrf map file only the first time.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
pvid_to_del is calculated
Ticket: CM-12355
Reviewed By: julien, nikhil
Testing Done: tested with failing config
My previous fix for the same bug did not fix the problem completly.
In this patch all running pvid calculation
is done before the pvid_to_del is calculated.
This makes sure the old pvid is deleted if it is not
the same as current pvid in all cases
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Ticket: CM-12302
Reviewed By: Daniel, Roopa, Nikhil G
Testing Done: ifupdown2 smoke test
With this pretty straight forward, we introduce a new Attribute in nlmanager,
so that we have single check and no code redundancy for ifname length. This
also prevent loosing time sending a netlink packet for an known error.
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Ticket: CM-12355
Reviewed By: julien, nikhil
Testing Done: tested with failing config
This can happen if the bridge vlans were
cached before the interface become a bridge port.
and when the interface becomes a bridge port
kernel adds a default pvid of 1. so this patch
assumes a default pvid is 1 if we did not find
anything in the cache. This will delete
the default pvid of 1 if the user has configured a
different pvid.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Ticket: CM-8610
Reviewed By: Roopa, Nikhil G
Testing Done:
It used to be a silent exception, but not anymore because we catch it and log
accordingly (error) and flag the ifaceobj so that ifupdown2 returns 1.
$ cat /etc/network/interfaces
auto tap0
iface tap0
mtu 9000
address 172.17.28.0/31
$ ifreload -a
$ echo "address 2002:17:27:17/120" >> /etc/network/interfaces
$ ifreload -a
$ echo $?
0
$ # applying this patch
$ ifreload -a
error: tap0: cmd 'ip -force -batch - [addr add 172.17.28.0/31 dev tap0
addr add 2002:17:27:17/120 dev tap0
]' failed: returned 1 (RTNETLINK answers: File exists
Command failed -:1
Error: an inet prefix is expected rather than "2002:17:27:17/120".
)
$ echo $?
1
$
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Ticket: None
Reviewed By: Roopa, Nikhil G, Daniel
Testing Done: ifupdown2 smokes
The message logged and the exception raised by nlmanager, when receiving
an NLMSG_ERROR packet from the kernel, wasn't super explicit plus if the
error wasn't a netlink related failure we didn't provide any information
Now we use strerror with the provided error code to generate a nice msg.
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Ticket: None
Reviewed By: Roopa, Nikhil G, Daniel
Testing Done: ifupdown2 smoke
We used to have these checks in the old rtnetlink python library.
They were missing in python-nlmanager this was a big regression for
ifupdown2.
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
statically configured
Ticket: CM-12277
Reviewed By: CCR-5059
Testing Done: ifreload with a VxlanClagClosConfig.py config
get_vxlan_peers gets remote ip addresses if they are statically configured
through ifupdown2 (vxlan-remoteip <address>). These are cached in
ifupdown2's link object so that they can be used in 'ip link set' (if link
exists already), 'ifquery -r' and 'ifquery -c'. ifupdown2 should ignore and
not cache these addresses if they are provisioned by vxrd. Check if vxrd is
running before caching remote ip addresses. This helps in optimizing time
taken to ifreload with 1k bridge/vxlan interfaces (vlan-aware bridge) in a
vxrd/vxsnd setup.
Signed-off-by: Balakrishnan Raman <ramanb@cumulusnetworks.com>
we should leave the mtu on lo to the default mtu
if user has not requested to change it. lo has
a larger mtu because it does not really depend on a
physical mtu.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Ticket: CM-12084
Reviewed By: julien, nikhil
Testing Done: Tested ifreload/ifup/ifdown --allow=<class>
vrf slave brings up the master if master is not up yet.
Today this is done only when ALL (auto) option is set
just as an optimization. because you dont want to bring
up the master in cases where user just wants to
bring up the vrf slave. eg ifup -v eth0.
This does not work so well, when user uses
--allow classes to bring up vrf master and slaves
together (eg mgmt vrf).
This patch removes the ALL check when bringing
up master and replaces it with an ALL or
CLASS check. ie make sure vrf master belongs to the
same class as you when CLASS is specified.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
This patch moves ifupdownmain flag IFACE_CLASS to
ifupdownflags.CLASS. ifupdownflags.CLASS is set to true
if the user is asking for a class of interfaces.
example: ifreload --allow=mgmt
By moving it to ifupdownflags, we make it visible
to add modules.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Ticket: CM-11804
Reviewed By: julien, nikhil
Testing Done: Tested with failing config in the bug
This patch makes sure macvlan devices are ignored by ifquery -ra
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Ticket: CM-12201
Reviewed By: Roopa
Testing Done:
The syntax: netmask <number> is ifupdown legacy support
We want to deprecate it so we don't want to officially support it.
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Ticket: CM-12151
Reviewed By: julien, nikhil
Testing Done: Tested bridge vid errors with multiple iface stanzas for
ports
This patch just uses the HAS_SIBLINGS and OLDEST_SIBLINGS
flags on an iface to make sure we flag the error
on the last interface ie oldest of the siblings. all interfaces
with multiple iface objects have HAS_SIBLINGS set and the last iface
has OLDEST_SIBLINGS set.
The other way to fix this for the user would be to set ifaceobj_squash=1
in /etc/network/ifupdown2/ifupdown2.conf
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
unaware
Ticket: CM-12070
Reviewed By: julien, nikhil
Testing Done: Tested with config in the bug
The bug also talks about removing the vlans during this
transition. If the vlans are removed from the interfaces file,
ifupdown2 will delete them on an ifreload. In any case, once moved to
vlan unaware bridge settings, kernel and switchd
don't look at vlans any more.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
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>
Ticket: CM-11773
Reviewed By: Roopa, Nikhil G
Testing Done: smoke + hand testings :
$ cat /etc/network/interfaces
auto br2
iface br2
bridge-vlan-aware yes
bridge-vids 100
bridge-pvid 1
bridge-ports swp1 swp4 swp5
bridge-stp on
$ ifreload -a -v
[...]
info: netlink: set link swp1 up
info: netlink: set link swp4 up
info: netlink: set link swp5 up
info: br2: applying mstp configuration specific to ports
info: br2: processing mstp config for port swp1
info: executing /sbin/mstpctl showportdetail br2 json
info: executing /sbin/mstpctl settreeportprio br2 swp1 0 128
info: br2: processing mstp config for port swp4
info: executing /sbin/mstpctl settreeportprio br2 swp4 0 128
info: br2: processing mstp config for port swp5
info: executing /sbin/mstpctl settreeportprio br2 swp5 0 128
info: netlink: set link br2 up
[...]
$
/sbin/mstpctl settreeportprio br2 swpX 0 128 is executed for every port.
ifupdown2 tries to set this attr to 128 (the default value). This is a
problem at scale. We shouldn't try to set this value if the running value
is already 128.
With the attached patch:
$ ifreload -a
[...]
info: netlink: set link swp1 up
info: netlink: set link swp4 up
info: netlink: set link swp5 up
info: executing /sbin/mstpctl showportdetail br2 json
info: br2: applying mstp configuration specific to ports
info: br2: processing mstp config for port swp1
info: br2: processing mstp config for port swp4
info: br2: processing mstp config for port swp5
info: netlink: set link br2 up
[...]
$
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
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>
Ticket: CM-12036
Reviewed By: roopa
Testing Done: used same config from bug
This patch avoids printing port attributes under
vlan-AWARE-bridge on 'ifquer -ra'.
This patch also avoids printing following attributes
on 'ifquer -ra' if not defined:
mstpctl-maxhops
mstpctl-portpathcost
mstpctl-treeportcost
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
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>
Ticket: CM-11998
Reviewed By: roopa
Testing Done: used same config given in bug descreption
When we try to unconditionally remove 'pvid' from 'vids' set,
we run into KeyError if 'vids' set doesn't contain 'pvid'
Example configuration:
auto swp9
iface swp9
mstpctl-portautoedge no
auto frontnet
iface frontnet
bridge-vlan-aware yes
bridge-ports swp9
bridge-vids 10
bridge-stp on
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
Ticket: CM-8629
Reviewed By: roopa, julien
Testing Done: used same config given in bug description
This patch avoids vlan aware bridge over-writing it's port's
config with default values
Example configuration:
auto swp9
iface swp9
mstpctl-portautoedge no
auto frontnet
iface frontnet
bridge-vlan-aware yes
bridge-ports swp9
bridge-vids 10
bridge-stp on
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
Ticket: CM-8596, CM-5118
Reviewed By: roopa, julien
Testing Done: used same config mentioned in bug
Previously, only first configured gateway is set as default route.
This patch sets all the configured gateways as default routes.
This patch also removes default route on ifup
after removing 'gateway' from the interface
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
Ticket: CM-11811
Reviewed By: roopa, julien
Testing Done: used same configuration from ticket
For a VLAN aware bridge, if 'bridge-pvid' is not configured,
auto bridge
iface bridge
bridge-ports swp7 swp8
bridge-vids 1-200
bridge-vlan-aware yes
'1' is would be running pvid and [2-200] would be running vids.
While doing _query_check() we compare configred versus running
vids excluding running 'pvid'. Configured vids here is [1-200]
and running is [2-200], but instead of excluding running 'pvid'
we used to exclued configured 'pvid' which is None in this case.
Comparison used to fail because of this.
This patch excludes running 'pvid' instead of configured 'pvid'
during _query_check()
This patch also fixes 'ifquery -c' error for bridge-pvid if
configured under a port of vlan aware bridge
This patch also avoids printing 'bridge-pvid' on 'ifquery -c'
if bridge-pvid is not configured under vlan aware bridge port
sample configuration:
auto swp4
iface swp4
auto swp7
iface swp7
bridge-pvid 2
auto swp8
iface swp8
bridge-pvid 2
auto bridge
iface bridge
bridge-ports swp4 swp7 swp8
bridge-vids 1-200
bridge-pvid 20
bridge-vlan-aware yes
sample output:
root@dell-s3000-02:~# ifquery -c -a
auto swp4
iface swp4 [pass]
bridge-pvid 20 [pass]
auto swp7
iface swp7 [pass]
bridge-pvid 2 [pass]
auto swp8
iface swp8 [pass]
bridge-pvid 2 [pass]
auto bridge
iface bridge [pass]
bridge-vlan-aware yes [pass]
bridge-ports swp8 swp7 swp4 [pass]
bridge-pvid 20
bridge-vids 1-200 []
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
Ticket: CM-11043
Reviewed By: roopa
Testing Done: used the config mentioned in bug
This patch adds a delay before starting IPv6 dhclient to
make sure the configured interface/link in up.
Also, ifdown on a IPv6 interface, this patch makes sure
that the link in up before dhcp release. Dhcp release is
done using a default lease file.
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
Ticket: CM-11811
Reviewed By: roopa, julien
Testing Done: used same configuration from ticket
For a VLAN aware bridge, if 'bridge-pvid' is not configured,
auto bridge
iface bridge
bridge-ports swp7 swp8
bridge-vids 1-200
bridge-vlan-aware yes
'1' is would be running pvid and [2-200] would be running vids.
While doing _query_check() we compare configred versus running
vids excluding running 'pvid'. Configured vids here is [1-200]
and running is [2-200], but instead of excluding running 'pvid'
we used to exclued configured 'pvid' which is None in this case.
Comparison used to fail because of this.
This patch excludes running 'pvid' instead of configured 'pvid'
during _query_check()
This patch also fixes 'ifquery -c' error for bridge-pvid if
configured under a port of vlan aware bridge
sample configuration:
auto swp4
iface swp4
auto swp7
iface swp7
bridge-pvid 2
auto swp8
iface swp8
bridge-pvid 2
auto bridge
iface bridge
bridge-ports swp4 swp7 swp8
bridge-vids 1-200
bridge-pvid 20
bridge-vlan-aware yes
sample output:
root@dell-s3000-02:~# ifquery -c -a
auto swp4
iface swp4 [pass]
bridge-pvid 20 [pass]
auto swp7
iface swp7 [pass]
bridge-pvid 2 [pass]
auto swp8
iface swp8 [pass]
bridge-pvid 2 [pass]
auto bridge
iface bridge [pass]
bridge-vlan-aware yes [pass]
bridge-ports swp8 swp7 swp4 [pass]
bridge-pvid 20
bridge-vids 1-200 []
Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
This reverts commit cfc51ed18be9aee902cbc89a57350d9e99a1950d.
this commit seems to have broken usercmds. reverting it until it is
fixed.
Closes: CM-11856
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
commands
Ticket: CM-11274
Testing Done: julien, wkok, nikhil
It uses and goes with the the other batch variables and apis.
This one just calls the 'bridge -batch' command instead
of the 'ip -batch' command.
This can be used to batch bridge commands.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Ticket: CM-11517
Reviewed By: julien, nikhil, jtoppins
Testing Done: ethtool sanity test
ethtool module should really care only about
physical interfaces. so, this patch makes ethtool
module ignore all logical interfaces, ie interfaces
with link_kind set.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Ticket: None
Reviewed By: Roopa
Testing Done: with a dummy script I printed the value passed by ifupdown
After the changes I did the same with ifupdown2 and checksd if the values
matched correctly.
This issue was reported on the github repository.
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>