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

1145 Commits

Author SHA1 Message Date
d54b30b4b8 Merge pull request #46 from svenauhagen/feature/ppp
ppp support closes #22
2018-04-13 19:38:25 +02:00
6cba66af57 dependent device fix 2018-04-13 19:32:04 +02:00
6cb7753857 ppp load 2018-04-07 19:22:33 +02:00
f101cb2ba5 do not load ppp if not installed 2018-04-07 19:21:04 +02:00
9b60795aa1 exclude ppp like dhcp 2018-04-07 18:07:30 +02:00
b2650e4a37 typo 2018-04-07 17:35:04 +02:00
c9b6e2f883 ppp support 2018-04-07 17:29:51 +02:00
b64ab20ebf Merge pull request #45 from svenauhagen/feature/tunnels
tunnel changes
2018-04-06 16:45:00 +12:00
d14c61b603 chache error on change 2018-04-05 07:32:42 +02:00
e452c2cf53 fix tunnel v4 to v6 change 2018-04-04 20:53:32 +02:00
887e55019e name fix 2018-04-04 20:06:48 +02:00
12425dc496 tunnel changes 2018-04-04 19:49:34 +02:00
8a0aa008bb addon/batctl: lookup batctl dynamically from PATH
Currently it is called from /usr/sbin/batctl what makes it impossible to use in case one runs a self compiled version for example
2018-03-13 14:57:27 +11:00
5b563460f8 addons: vrf: fix vrf slave link kind (fixes #39)
$ cat /etc/network/interfaces
auto v0
iface v0
      link-type veth
      vrf blue

auto blue
iface blue
      vrf-table auto

$ ifreload -a
$ echo $?
0
$ ifquery -a -c
auto v0
iface v0                         [pass]
      link-type veth             [pass]
      vrf blue                   [pass]

auto blue
iface blue                       [pass]
      vrf-table 1001             [pass]
$ echo $?
0

Reported-by: Maximilian Wilhelm <max@rfc2324.org>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-13 14:57:19 +11:00
00ff264407 addons: bridge: allow "bridge-ports: none" for bridges without initial ports. (#33)
This simple patch allows the creation of bridges which should be set up
  without any ports, like a bridge for virtual machines on a hosting box.

  With this patch ifupdown2 get's a step closer to feature parity and
  compatiblity with ifupdown1.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2018-03-13 14:54:36 +11:00
7d5877831d addons: tunnel: Add support for GRETAP tunnels. (#34)
This commit adds support to configure and check gretap tunnels. An example
  configuration could look like this:

    iface tap0 inet tunnel
        mode gretap
        local 10.132.255.3
        endpoint 10.132.255.1
        ttl 64
        mtu 1400
        tunnel-physdev eth0
        #
        address 10.10.0.1/2

  ifup will happily configure the interface (which it does even without this
  patch) and ifquery now can successfully validate the configure interface:

    cr03.in.ffho.net:~# ifquery -c tap0
    iface tap0 inet tunnel                   [[ OK ]]
        tunnel-physdev eth0                  [[ OK ]]
        endpoint 10.132.255.1                [[ OK ]]
        local 10.132.255.3                   [[ OK ]]
        mode gretap                          [[ OK ]]
        ttl 64                               [[ OK ]]
        mtu 1400                             [[ OK ]]
        address 10.10.0.1/24                 [[ OK ]]

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2018-03-13 14:54:31 +11:00
008f587603 addons: batman_adv: Add support for more B.A.T.M.A.N. adv. attributes. (#35)
* addons: batman_adv: Rework B.A.T.M.A.N. adv. attribute handling.

  This commit reworks the internal handling of B.A.T.M.A.N. adv. attributes
  within the plugin. The new approach on setting and checking attributes is
  more generic and allows adding more B.A.T.M.A.N. adv. which should be set
  as attributes of an B.A.T.M.A.N. adv. interface in a simple way.

  This commit does not introduce any changes visibile to the user.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>

* addons: batman_adv: Add support for more B.A.T.M.A.N. adv. attributes.

  This commit adds supports for setting the following optional attributes:
   * gw-mode (one of { off, client, server })
   * multicast-mode (can be 'enabled' or 'disabled')
   * distributed-arp-table (cat be 'enabled' or 'disabled')

  Example config:

  pandora:~# ifquery -c bat-foo
  iface bat-foo                                         [pass]
      batman-ifaces dummy-bat                           [pass]
      batman-ifaces-ignore-regex                        [pass]
      batman-hop-penalty 7                              [pass]
      batman-multicast-mode enabled                     [pass]
      batman-distributed-arp-table enabled              [pass]
      batman-gw-mode client                             [pass]

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2018-03-13 14:54:25 +11:00
fa83ce4e36 Addons/tunnel: fix typo in validvals (#31) 2018-03-13 14:54:19 +11:00
8de397effa addons: address: Fix handling of 'pointopoint' attr. (#23)
Due to a simple logic bug the 'pointopoint' attribute was ignored when
  specifying and address as <ip/mask> and only considered when IP and mask
  where given seperately. This commit fixes this behaviour.

  When configured in ptp mode »ip addr« will show the IP address without a
  netmask which will make »ifquery -c« mark the IP as failed. The check has
  been fixed, too.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:54:05 +11:00
1025163e73 sbin: ifupdown2: update ifupdown2 version number for --version option
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-13 14:53:18 +11:00
bfec7d134f 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>
2018-03-13 14:53:01 +11:00
2e2adb0e84 Add support GRE/SIT tunnels. (#20)
This commit adds support for configuring GRE/IPIP/SIT tunnel interfaces as know
from previous versions of ifupdown. Currently only configuration checks for GRE
and SIT tunnels are implemented.

A tunnel interface configuration could look like this:

auto gre42
iface gre42 inet tunnel
        mode     gre
        local    198.51.100.1
        endpoint 203.0.113.2
	#
	# optional tunnel attributes
        ttl      64
        mtu      1400
	tunnel-physdev eth0
        #
        address  192.0.2.42/31
        address  2001:db8:d0c:23::42/64

auto he-ipv6
iface he-ipv6 inet tunnel
	mode sit
	endpoint 203.0.113.6
	local    198.51.100.66
	#
	# optional tunnel attributes
	ttl 255
	mtu 1466
	tunnel-physdev vrf_external
	#
	address 2001:db8:666::2/64

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:50:31 +11:00
db65511035 closes: #810844: debian: control: Unlisted dependencies
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2018-03-13 14:48:27 +11:00
6bfea931ff batman_adv: Ignore non-existing batman interface when setting up batman iface.
Previously a single non existing batman member interface could prevent the
  configuration of the batman interface. This patch makes sure only existing
  member interfaces will be considered when setting up the interface.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:47:54 +11:00
a8c175f91f batman_adv: Rename _sysfs_mgmt_member_if() to _batctl_if() and use absolute path to batctl.
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2018-03-13 14:47:45 +11:00
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
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
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
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
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
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 c4d1cffc5e34d4afb38606ecf4288b431c82b683.
2018-03-13 11:05:52 +11:00
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
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
dc89c7cd42 Update README.md with install instructions 2017-10-13 16:10:29 -07:00
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
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
9a5c706f45 Merge remote-tracking branch 'cumulus/dev'
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2017-02-23 17:17:26 +07:00
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
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
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
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
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
8a5626d4f4 Merge remote-tracking branch 'origin/dev-next' into dev 2017-02-18 01:46:15 +07:00
3e587bb524 debian: mark 1.1-cl3u9 RELEASED
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2017-02-08 10:51:22 -08:00
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
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
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
c09025b2b0 Merge branch 'dev' into dev-next 2017-01-27 23:40:07 +03:00
82f84f8278 Revert "ifupdownaddons: bridgeutils: uncomment parsing code for brctl mc attributes"
This reverts commit 65beb82662576c047a281389bd663589dcba09db.

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
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>
cl3u8
2017-01-26 14:57:33 -08:00