Commit Graph

1620 Commits

Author SHA1 Message Date
Maximilian Wilhelm
f08f4d8a8a batman-adv: Show function where error occured in message.
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:47:37 +11:00
Maximilian Wilhelm
53f3470485 Add support for setting phys-dev for VXLAN interfaces.
Add interface configuration option »vxlan-physdev« to set »dev« attribute
  of VXLAN interfaces and a check for the running configuration.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:45:25 +11:00
Maximilian Wilhelm
8c264d01eb Addons: vxlan: Fix check of »vxlan-svcnodeip« config option.
The »vxlan-svcnodeip« corresponds with the multicast »group« parameter
  of the VXLAN interface and should be checked against this value instead
  of the »remote« parameter for unicast ptp tunnels.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:44:55 +11:00
Julien Fortin
f00d85a17a docs: examples: new batman_adv folder with configuration script and example
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-13 14:43:59 +11:00
Maximilian Wilhelm
97e09957b4 Add addon module for B.A.T.M.A.N. advanced interface configuration. (#12)
* Add addon module for B.A.T.M.A.N. advanced interface configuration.

  This commit adds support for configuring B.A.T.M.A.N. advanced interfaces
  with ifupdown2. B.A.T.M.A.N. advanced is a protocol to build Layer2 based
  mesh networks with. It's supported in the Linux kernel and thus available
  in many Linux environments.

  A configuration could look like this

  auto bat0
  iface bat0
      batman-ifaces eth1 eth2.23
      batman-ifaces-ignore-regex .*_nodes
      batman-hop-penalty 23
      #
      address 192.0.2.42/24

  where »bat0« would be the local connection to the mesh network.

  The interfaces »eth1« and »eth2.23« would be used by the B.A.T.M.A.N. adv.
  protocol to communicate to other member of the mesh network.

  Any interfaces matching the »ifaces-ignore-regex« will be gently ignored
  by ifquery and ifreload as there might be some tunnels or interfaces
  added to the mesh network by other means which should not be removed by
  any subsequent ifreload run.

  The »hop-penalty» parameter set the penalty of this node within the mesh
  network.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>

* addons: batman_adv: replacing rtnetlink by netlink api call and iproute2 instantiation fix

These changes are due to modifications we introduced in debian-prep2.
We no longer use the rtnetlink_api but a new one "netlink" build on top of python-nlmanager.

* Reflect upstream change where flags are stored.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:41:46 +11:00
Julien Fortin
753807fde3 Revert "iproute2: addr_add: change default broadcast to '+' so iproute2 generate broadcast addrs"
this patch is breaking ip6, i'll try to fix it later by adding a ip4 check first.

This reverts commit c4d1cffc5e.
2018-03-13 11:05:52 +11:00
Julien Fortin
c4d1cffc5e
iproute2: addr_add: change default broadcast to '+' so iproute2 generate broadcast addrs
today ifupdown2 doesn't generate the broadcast address for an intf while ifupdown1(debian)
    does, simply changing the default broadcast value to '+' solve the issue.
    
    auto bond1
    iface bond1 inet static
            address 88.213.145.1
            netmask 255.255.255.0
            bond-slaves ens6 ens6d1
            bond-mode 0
            bond-miimon 100
    
    $ ifconfig bond1
    bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
            inet 88.213.145.1  netmask 255.255.255.0  broadcast 0.0.0.0
            inet6 fe80::f652:14ff:fe33:ea01  prefixlen 64  scopeid 0x20<link>
            ether f4:52:14:33:ea:01  txqueuelen 1000  (Ethernet)
            RX packets 6  bytes 522 (522.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 66  bytes 4878 (4.8 KB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    $ ip addr show bond1
    13: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether f4:52:14:33:ea:01 brd ff:ff:ff:ff:ff:ff
        inet 88.213.145.1/24 scope global bond1
           valid_lft forever preferred_lft forever
        inet6 fe80::f652:14ff:fe33:ea01/64 scope link
           valid_lft forever preferred_lft forever
    
    ******************************************
    With ifupdown1 (debian) with the same configuration

    bond1: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
            inet 88.213.144.1  netmask 255.255.255.0  broadcast 88.213.144.255
            inet6 8f54:2573:3de8:92ba::2  prefixlen 126  scopeid 0x0<global>
            inet6 fe80::f652:14ff:fe33:eac2  prefixlen 64  scopeid 0x20<link>
            ether f4:52:14:33:ea:c2  txqueuelen 1000  (Ethernet)
            RX packets 18  bytes 1566 (1.5 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 51  bytes 4508 (4.5 KB)
    
    5: bond1: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether f4:52:14:33:ea:c2 brd ff:ff:ff:ff:ff:ff
        inet 88.213.144.1/24 brd 88.213.144.255 scope global bond1
           valid_lft forever preferred_lft forever
        inet6 8f54:2573:3de8:92ba::2/126 scope global
           valid_lft forever preferred_lft forever
        inet6 fe80::f652:14ff:fe33:eac2/64 scope link
           valid_lft forever preferred_lft forever
    
    Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-01 16:46:53 +11:00
Gaudenz Steinlin
ca2ec1ac23 Pass environment variables to addon scripts (#32)
Pass the same environment variables to addon scripts from /etc/network/
as are passed to user defined commands in interfaces stanzas. This is
needed for compatibility with ifupdown.

Fixes: #14
2017-10-24 17:00:27 -07:00
Julien Fortin
dc89c7cd42 Update README.md with install instructions 2017-10-13 16:10:29 -07:00
Jeffrey
fc7fac14b2 Update README.rst (#11)
Fixed formatting issue which did put the second 'apt-get install' line behind the first one.
2017-08-01 16:08:10 +02:00
Nigel Kukard
6a5a7c6b2c For hotplug devices check if the link is present, not up (#28)
Checking operstate would require firmware to be loaded and link
negotiation to of taken place. Some firmwares take a few seconds to
upload and online the device, and some link negotiations take a second
or two.

Immediately checking operstate is not feasible here. Checking if the
link is present is a more suitable non-delaying approach.

Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
2017-07-27 01:45:52 +02:00
Julien Fortin
9a5c706f45 Merge remote-tracking branch 'cumulus/dev'
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-02-23 17:17:26 +07:00
Julien Fortin
23cba755ed debian: changelog: update changelog for new version cl3u10 (unreleased)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-02-23 17:11:10 +07:00
Julien Fortin
de1127b0be sbin: start-networking: adjust allow-hotplug behavior to ifupdown
Ticket: Bug#855598: src:ifupdown2: allow-hotplug behaves differently, not UPing interfaces
Reviewed By: Roopa
Testing Done: mark an interface (ethX) as hotplug then reboot

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-02-23 16:42:34 +07:00
Julien Fortin
ac40c03262 sbin: ifupdown2: drop the dependency to pkg_resource, hardcode version number
Ticket:
Reviewed By: Roopa
Testing Done:

Debian Bug#855401, we didn't list pkg_resource as a dependency so the
installation is failing for upstream users.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-02-23 16:31:58 +07:00
Daniel Walton
a981087c9e ifupdown2: bond-downdelay and bond-updelay need validrange
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   julien@cumulusnetworks.com

Ticket: CM-15012
2017-02-23 03:13:40 +12:00
Daniel Walton
932bfff598 ifupdown2: restrict mstpctl-treeprio validvals
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   julien@cumulusnetworks.com

Ticket: CM-15011
2017-02-23 03:12:16 +12:00
Julien Fortin
8a5626d4f4 Merge remote-tracking branch 'origin/dev-next' into dev 2017-02-18 01:46:15 +07:00
Roopa Prabhu
3e587bb524 debian: mark 1.1-cl3u9 RELEASED
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-02-08 10:51:22 -08:00
Roopa Prabhu
85398780f0 debian: add new changelog entry for 1.1-cl3u9
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-02-06 13:24:09 -08:00
Roopa Prabhu
f03e7a2f28 addons: bridge: support for bridge-learning attribute
Ticket: CM-14683
Reviewed By: julien, mallik, anita, vivek, balki, wkok
Testing Done: tested with bridge-learning on off

- support for bridge-learning attribute on bridge ports.
  (currently uses sysfs, must move to netlink soon)
- Additional feature for vxlan bridge ports: sync learning
flag to vxlan bridge ports. No ifquery check for this auto
sync feature.

example config for vxlan ports:
auto vxlan1000
iface vxlan1000
        vxlan-id 1000
        bridge-learning off
        bridge-access 100

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-02-06 10:32:25 -08:00
Nikhil
c3fc3b8f00 addons: bond: adding attribute bond-(up|down)delay
Ticket: CM-8424
Reviewed By: Roopa, Julien
Testing Done: using the config mentioned in bug

updelay

    Specifies the time, in milliseconds, to wait before enabling a
    slave after a link recovery has been detected.  This option is
    only valid for the miimon link monitor.

downdelay

    Specifies the time, in milliseconds, to wait before disabling
    a slave after a link failure has been detected.  This option
    is only valid for the miimon link monitor.

Signed-off-by: Nikhil Gajendrakumar <nikhil@cumulusnetworks.com>

Conflicts:
	ifupdownaddons/bondutil.py
2017-02-01 10:45:56 -08:00
Julien Fortin
c09025b2b0 Merge branch 'dev' into dev-next 2017-01-27 23:40:07 +03:00
Julien Fortin
82f84f8278 Revert "ifupdownaddons: bridgeutils: uncomment parsing code for brctl mc attributes"
This reverts commit 65beb82662.

it's causing testifupdown2.py:TestMakoJson to fail... Basically this commit
uncomment codes which parse mc value from brctl output. So `ifquery -r` output
is different (this new attribute show up under the bridge). TestMakoJson at
some point does:
$ ifquery -a -r -t json > running_json
Then later
$ ifup -i running_json...
This ifup fails on:
...
warning: br0: unsupported attribute 'bridge-mclmt'
...
2017-01-27 17:34:13 +03:00
Roopa Prabhu
b258e406af addons: vxlan: ifquery: fix remote-ip handling
Ticket: CM-14628
Reviewed By: julien, nikhil, vivek, mallik
Testing Done: Tested with vxlan config and remote ips added externally

Recent handling of vxlan-purge-routes as part of CM-13815 did not fix
handling of remote ips during ifquery --check and ifquery --running.
This patch fixes ifquery -c and ifquery running for external
vxlan controller cases.

Without this, ifquery --check always returns exit code of 1 for
external vxlan controller configs

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-01-26 14:57:33 -08:00
Julien Fortin
c529c18583 Merge branch 'dev' into dev-next 2017-01-24 02:53:53 +03:00
Nikhil
c426b8dcc7 Revert "addons: mstpctl: reset (default) bridge mstpctl options when users remove settings"
This reverts commit a3d36dd86d.
Ticket CM-14516 has been filed to track this

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2017-01-20 13:39:45 -08:00
Nikhil
d03b0695e0 addons: mstpctl: ifquery -c --with-default, ignore mstpctl default attributes when stp is off
Ticket: CM-13779
Reviewed By: roopa, satish, julien
Testing Done: testing the config given in the CM

mstpctl showportdetail <bridge> command won't output anything when
bridge-stp is off, therefore ignore mstpctl default attributes during
ifquery -c --with-defaults

This patch also consistently updates bridge and bridge port cache
at the same time.
Earlier bridge and bridge port cache were not consistent
because of the early return condition
    attrs = MSTPAttrsCache.get(bridgename)
        if attrs:
            return attrs
If either of bridge port cache and bridge cache is updated, function used to
return inconsistent cache values

Signed-off-by: Nikhil Gajendrakumar <nikhil@cumulusnetworks.com>
2017-01-20 10:42:05 -08:00
Julien Fortin
65beb82662 ifupdownaddons: bridgeutils: uncomment parsing code for brctl mc attributes
Ticket: None
Reviewed By: Roopa, Nikhil G
Testing Done: ssim ifupdown2-tests

runtests.sh -T ~/result_smoke/single/ifupdown2-tests.log -r ~/result_smoke/single/summary_ifupdown2tests.txt -d cel-redxp-06 -t nightly -l INFO -k $VM_BASE_KERNEL -i $VM_BASE_IMG $TESTS_HOME/tests/smoke/testOneConfigifupdown2.py:Testifupdown2OneConfig

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-19 12:22:44 +03:00
Nikhil
4b875c17c6 addons: address: replay all gateway commands at every ifreload
Ticket: CM-14472
Reviewed By: Roopa, Julien
Testing Done: used the config mentioned in CM

Fix introduced by "addons: address: add both v4 and v6 gateways
instead of just one" changed the way gateway commands were configured.
ifupdown2 does not replay default gateway commands on ifreload

This patch ensures all the gateway commands at every ifreload are replayed

Signed-off-by: Nikhil Gajendrakumar <nikhil@cumulusnetworks.com>
2017-01-17 17:55:35 -08:00
Nikhil
a3d36dd86d addons: mstpctl: reset (default) bridge mstpctl options when users remove settings
Ticket: CM-8401
Reviewed By: Roopa, Julien
Testing Done: tested on all bridge mstpctl attributes.

This patch resets th following bridge attributes to defauls when
users remove settings from interface config file.

mstpctl-treeprio
mstpctl-ageing
mstpctl-fdelay
mstpctl-maxhops
mstpctl-maxage
mstpctl-txholdcount
mstpctl-forcevers
mstpctl-hello

Added an api in policy manager to get policy default value of any
module attribute.

Added a cache for bridge attributes to save some runtime

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
2017-01-17 17:19:54 -08:00
Julien Fortin
bea8c8d105 debian: ifupdown2.postinst: refine 'iface lo' regex
Ticket: CM-14362
Reviewed By: Roopa, Nikhil G
Testing Done:

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-17 15:49:23 +03:00
Julien Fortin
ad71ea833c debian: changelog: update changelog for new version cl3u8
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-17 11:03:02 +03:00
Daniel Walton
f66fd6f12e 'link-down' needs 'default' entry in dictionary
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by:   roopa@cumulusnetworks.com

Ticket: CM-14330
2017-01-13 18:18:39 +00:00
Julien Fortin
5b66674938 addons: address: log error when ip route gateway command fails
Ticket: CM-14386
Reviewed By: Roopa, Purna, NIkhil G
Testing Done:

We have incorrect Address Range and Default g/w configuration. Kernel will give
error in such condition and ignore the route. but ifupdown2 is masking this
error and making user in blind spot.

$ ifdown -a -X eth0
$ ifreload -a
error: h2t_c-1: cmd 'ip route add table DataVrf1080 default via 3.0.0.1 dev h2t_c-1' failed: returned 2 (RTNETLINK answers: Network is unreachable
)
$ echo $?
1
$ ifquery -a
auto h2t_c-1
iface h2t_c-1
      address 6.0.0.1/26
      address 2001:fee1::1/64
      bond-slaves swp1 swp2
      bond-mode 802.3ad
      bond-miimon 100
      bond-min-links 1
      bond-xmit-hash-policy layer3+4
      bond-lacp-rate 1
      mtu 9152
      alias Local Node/s hostd-1-1 and Ports swp1 swp2 <==> Remote  Node/s torc-1-1 torc-1-2 and Ports swp7 swp7
      gateway 3.0.0.1
      gateway 2001:fee1::1
      vrf DataVrf1080

auto DataVrf1080
iface DataVrf1080
      vrf-table 1080

$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-13 06:51:28 +03:00
Julien Fortin
23d70d0414 addons: bridge: warn/err if bridge-access is missing under vxlan bridge VA port
Ticket: CM-14209
Reviewed By: Julien
Testing Done:

vids was a list and pvid is not a list, hence the check was failing

$ cat /etc/network/interfaces
auto vxlan1000
iface vxlan1000
      vxlan-id 1000
      vxlan-local-tunnelip 172.16.20.103
      vxlan-remoteip 172.16.20.106

auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-ports swp1 vxlan1000
      bridge-vids 100 200

$
$ ifdown -a -X eth0
$ ifreload -a -s
warning: vxlan1000: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
$ ifreload -a
warning: bridge: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
error: bridge: errors applying port settings
$ ifreload -a
error: vxlan1000: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
warning: bridge: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
error: bridge: errors applying port settings

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-12 23:08:57 +03:00
Roopa Prabhu
cc90a0c8ec Revert "addons: bridge: warn/err if bridge-access is missing under vxlan bridge VA port"
This reverts commit 4e2db07956.

reverting because of some reported false errors.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-01-11 19:58:02 -08:00
Julien Fortin
4e2db07956 addons: bridge: warn/err if bridge-access is missing under vxlan bridge VA port
Ticket: CM-14209
Reviewed By: Roopa
Testing Done:

$ cat /etc/network/interfaces
auto vxlan1000
iface vxlan1000
       vxlan-id 1000
       vxlan-local-tunnelip 172.16.20.103
       vxlan-remoteip 172.16.20.106

auto bridge
iface bridge
       bridge-vlan-aware yes
       bridge-ports swp1 vxlan1000
       bridge-vids 100 200

$
$ ifdown -a -X eth0
$ ifreload -a -s
warning: vxlan1000: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
$ ifreload -a
warning: bridge: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
error: bridge: errors applying port settings
$ ifreload -a
error: vxlan1000: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
warning: bridge: `bridge-access` attribute is mandatory when vxlan device (vxlan1000) is part of vlan aware bridge (bridge)
error: bridge: errors applying port settings
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-12 03:19:19 +03:00
Julien Fortin
aec6cd82f6 addons: bridge: fix syntax check failing on bridge without port
Ticket: CM-13653
Reviewed By: Roopa, Daniel W
Testing Done:

$ cat /etc/network/interfaces
auto bridge
iface bridge
    bridge-vids 10-15
    bridge-vlan-aware yes

$ ifup --syntax-check --verbose --all --interfaces /etc/network/interfaces
info: loading builtin modules from /usr/share/ifupdown2/addons
info: executing /var/lib/ifupdown2/hooks/get_reserved_vlan_range.sh
info: executing /bin/pidof -x clagd
info: executing /var/lib/ifupdown2/hooks/get_reserved_vlan_range.sh
info: executing /bin/pidof mstpd
info: executing /sbin/ip rule show
info: executing /sbin/ip -6 rule show
info: address: using default mtu 1500
info: 'link_master_slave' is set. slave admin state changes will be delayed till the masters admin state change.
info: processing interfaces file /etc/network/interfaces
$ echo $?
0
$

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-11 23:01:11 +03:00
Roopa Prabhu
b207b83d8c vxlan: add new attribute vxlan-purge-remotes to make purging remotes explicit
Ticket: CM-13815
Reviewed By:
Testing Done: Tested remote purging

vxlan purging remotes is a feature where we clean up
existing fdb remote entries in favor of the ones specified in the
interfaces file. Obviously in precense of an external controller
like bgp or vxrd this is not a good thing because these remotes
maybe installed by these external controller  daemons.
This patch makes the purgining behaviour explicit by a new attribute.
We will ship with a default policy file which sets vxlan-purge-remotes to no.

This also cleans up a bug introduced by fix to CM-13767 where we were
trying to delete default remote entry pointing to the local ip.

more details below.

problem:
for static configuration, ifupdown2 has some code to "purge" existing
default remote fdb entries and install
new ones corresponding to the ones specified in the interfaces file
(with vxlan-remoteip).
For non-static configuration (ie in presence of an external controller),
it skips this "purge"...because these entries
maybe added by an external controller. To detect that there is no
external controller running..., today it
checks if the vxrd process is running or not. We need to extend this
check to now include bgp (for evpn)...and it gets trickier with bgp
since just checking the quagga pid is not good.

Solution:
I would like to make this purging explicit with an attribute. This patch
adds a 'vxlan-purge-remotes yes|no' attribute. vxlan remote address purging
will take into affect when:
        vxlan-remoteip attribute is present in the interfaces file
        or
        vxlan-purge-remotes is set to 'yes'

We will ship a ifupdown2 default policy file to disable purging by
default (vxlan-purge-remotes no).
For existing customer deployed static configs, since the interfaces file
will already have remote entries, this change
will behave as existing code (ie purge = yes).

For existing vxrd deployments, as long as already deployed interfaces
files have no vxlan-remoteip entries,
this patch does not change any behavior (can people confirm that
existing vxrd deployments have no vxlan-remoteip entries in their
interfaces ?)

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-01-10 17:52:41 -08:00
Julien Fortin
b8b579f36d Merge branch 'dev' into dev-next 2017-01-08 16:32:35 +03:00
Julien Fortin
7bdf7072bd addons: bridge: add support for bridge-vids alias: bridge-trunk
Daniel: Having both bridge-vids and bridge-trunk at the
net add interface NAME <TAB>
level creates confusion… need to remove bridge-vids

This commit adds bridge-trunk as an alias for bridge-vids

Ticket: CM-14041
Reviewed By: Roopa, Nikhil G
Testing Done:

$ ifquery -a
auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-ports swp1 swp9
      bridge-trunk 2-100
      bridge-pvid 101
      bridge-stp on

$ ifrelaod -a
$ ifquery -a -c
auto bridge
iface bridge                                                        [pass]
      bridge-vlan-aware yes                                       [pass]
      bridge-ports swp1 swp9                                      [pass]
      bridge-stp yes                                              [pass]
      bridge-pvid 101
      bridge-trunk 2-100                                              []

$ ifquery -a -r
auto bridge
iface bridge
      bridge-vlan-aware yes
      bridge-ports swp9 swp1
      bridge-stp yes
      bridge-pvid 101
      bridge-vids 2-101

$ net show bridge vlan
port       vlan ids
swp1        2-100
             101 PVID Egress Untagged

swp9          2-100
               101 PVID Egress Untagged

bridge         None

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-08 07:38:35 +03:00
Julien Fortin
984146fb34 Merge branch 'dev' into dev-next 2017-01-08 05:40:26 +03:00
Julien Fortin
a9633d0591 addons: bond: add support for attribute aliases (bond-ports)
This features will allow attributes to have aliases. Our use case today is
between bond-slaves and bridge-ports, which be a little confusing.
It follows the kernel api and existing linux tools. Bonding driver calls them
slaves and to the bridge driver they are ports.

With NCLU we we would like to be more consistent. We will now also support
"bond-ports"a

Ticket: CM-12763
Reviewed By: Roopa
Testing Done:

$ ifquery -a -c
auto bond0
iface bond0                                                         [pass]
      bond-slaves swp1                                            [pass]

auto bond1
iface bond1                                                         [pass]
      bond-ports swp2                                             [pass]

root@cel-redxp-06:~# ifquery -a -r
auto bond0
iface bond0
      bond-lacp-bypass-allow 0
      bond-slaves swp1
      bond-mode 802.3ad
      bond-use-carrier 1
      bond-lacp-rate 1
      bond-min-links 1
      bond-miimon 100
      bond-xmit-hash-policy layer3+4

auto bond1
iface bond1
      bond-lacp-bypass-allow 0
      bond-slaves swp2
      bond-mode 802.3ad
      bond-use-carrier 1
      bond-lacp-rate 1
      bond-min-links 1
      bond-miimon 100
      bond-xmit-hash-policy layer3+4

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-06 17:58:49 +03:00
Julien Fortin
ac49bf0ec5 addons: bridge: warn/err if bridge-access is missing under vxlan bridge VA port
Ticket: CM-12235
Reviewed By: Roopa, Nikhil G
Testing Done:

$ ifquery vx br0
auto vx
iface vx
      vxlan-id 14567100
      vxlan-local-tunnelip 27.0.0.11
      mstpctl-portbpdufilter yes
      mstpctl-bpduguard yes
      mtu 1500

auto br0
iface br0
      bridge-stp off
      bridge-ports vx
      bridge-vlan-aware yes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-01-06 05:20:10 +03:00
Roopa Prabhu
9858b0a680 ifupdown: add missing supporting code for 'link-down [yes|no]'
Ticket: CM-13434
Reviewed by: julien, nikhil, daniel
Testing Done: ifreload and multiple down [yes|no] sequences under
physical and logical interfaces (ifupdown2-tests test case is pending)

This also moves the fix done for CM-4125 (inet manual handling for
logical devices) into a single place under ifupdownmain.

attribute 'link-down [yes|no]' will not work in all cases when 'inet manual'
is used. This is only to preserve the semantics of 'inet manual'.
Best use of 'link-down [yes|no]' is to use it without 'inet manual'..
they are conflicting features anyways.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-01-05 11:28:16 -08:00
Roopa Prabhu
417e5675c4 addons: link: add new 'link-down [yes|no]' link attribute to keep link down
Ticket: CM-13434
Reviewed by: julien, nikhil, daniel
Testing Done: ifreload and multiple down [yes|no] sequences under
physical and logical interfaces (ifupdown2-tests test case is
pending)

This also moves the fix done for CM-4125 (inet manual handling for
logical devices) into a single place under ifupdownmain.

attribute 'link-down [yes|no]' will not work in all cases when 'inet
manual' is used. This is only to preserve the semantics of 'inet manual'.
Best use of 'link-down [yes|no]' is to use it without 'inet manual'..
they are conflicting features anyways.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-01-05 11:07:41 -08:00
Roopa Prabhu
f0e5bd8708 Revert "addons: address: add 'down' keyword to modinfo dictionary"
This reverts commit a21c63b65c.

Moving this to link-down in link.py addon module..due to conflict
with usercmds.py

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-01-05 10:51:32 -08:00
Roopa Prabhu
81d3e0271e Revert "ifupdown: add new 'down [yes|no]' link attribute to keep link down"
This reverts commit 02e00f54bb.

reverting this commit to move it to link.py addon module.
down conflicts with usercmds.py 'down'

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-01-05 10:50:48 -08:00
Roopa Prabhu
a21c63b65c addons: address: add 'down' keyword to modinfo dictionary
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-01-05 08:44:26 -08:00