5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2024-12-22 21:33:47 +03:00
Commit Graph

34 Commits

Author SHA1 Message Date
Thomas Lamprecht
0dc7fd7b50 inotify: network: improve "allow-hotplug" & "auto" interaction
commit c86cfb8bbd dropped allow-hotplug
from the primary interfaces file completely on write, but that breaks
setups that come from plain Debian.

Instead, as stop-gap measurement, transform "allow-hotplug" to auto
in the PVE controlled config.

That avoids conflict and improves installing PVE on top of plain
Debian, as the interface still comes up after the first reboot.

But it is not ideal auto is not the same as hotplug, so we need to
also track that difference in the future, but that needs some
adaptions in the API too (change autostart from boolean to
string+enum or so=

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-29 09:57:59 +02:00
Thomas Lamprecht
89075c3505 test: import JSON for quicker debugging
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-09-24 12:56:09 +02:00
Alexandre Derumier
fe2a773cd0 Inotify: write_network_interfaces : always autostart bond slaves interfaces
Currently, bond slaves are mostly working without autostart,
because bond slaves scripts from ifupdown1 && also ifupdown2
 have some kind of hacks to start the slaves.

But if users want to do some tuning on the ifaces, they are not applied.

Also, with ifupdown2 + ovs, this kind of hack is not implemented (yet), so the
slaves of the bond are still down.

Debian/Ubuntu official docs always set "auto ethX" for bond slaves,
it's really more clean like this.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-06-08 17:34:57 +02:00
Alexandre Derumier
e1b784f36e t.list-interfaces.pl: add cidr address test
also reuse wanted values

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-13 12:16:52 +01:00
Thomas Lamprecht
fa6e694656 inotify/interfaces: ensure cidr, address and netmask are set correctly
This should bring back compatibillity in the read site and one for
all clears that cidr is cidr, netmask is mask and address is address
(outgoing).

We're still very flexible on what can be written out.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-13 11:35:52 +01:00
Thomas Lamprecht
f110671de4 test: list ifaces: fix indentation of expected structure
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-13 11:07:17 +01:00
Thomas Lamprecht
ffe0b0e075 runtest: clone config before passing to write to avoid side effects
write changes some parts of the config, if this is a reference to the
config used for checking parsing it may lead to unexpected failures
due to those side effects..

For me it was "cidr" and "cidr6" getting deleted, and thus upcomming
tests for a compat change failing without any apparent reason.. :/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-13 11:02:01 +01:00
Thomas Lamprecht
f6c9d9a4f3 inotify: fix compatibillity with address + netmask separate passed
fixes commit 78c6656c9aba1d57786f916717c2622a3059fb6 which dropped
writing out the netmask but missed to add compat code for the case
where the caller did not suplly a address in CIDR format already.

Check if an address ends with /\d+, if not see if a netmask is
available and add that similar how it gets handled on read.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
2020-03-12 16:10:18 +01:00
Alexandre Derumier
36bbe29db8 INotify : fix OVSBond && OvsintPort order + tests
OVSBond was missing
OvsintPort under ethx interfaces
2020-03-07 17:48:01 +01:00
Alexandre Derumier
beedabb4ab remove extra space after address && gateway options
only 1 space like all others options

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-03-04 14:59:34 +01:00
Alexandre Derumier
378c6656c9 INotify: use cidr for address on config change
netmask/broadcast options are deprecated since buster
https://manpages.debian.org/buster/ifupdown/interfaces.5.en.html

This still read both "old address/netmask" or "address cidr" format,
but always convert it to cidr address format

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-03-04 14:59:34 +01:00
Alexandre Derumier
a70e9925ae INotify : check_bridge : fix bridge-ports with vlan tagged interface
Currently with strip vlan tag, that's wrong because
mtu && others check are done the main interface.
2020-02-07 12:56:24 +01:00
Alexandre Derumier
968c90f174 INotify: fix mtu check && add test
reverse the parent-child. (bridge-port is the parent)
2020-02-07 12:56:24 +01:00
Alexandre Derumier
f82c73738d tests: unknown interfaces order: rename vlan interfaces to unknown
vlan(X) interfaces are not unknown anymore
use generic name instead

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2020-01-25 16:01:34 +01:00
Alexandre Derumier
4ac94c72a2 network_interfaces: use allow-ovs for OVSBridge
new openvswitch-switch service use "ifup --allow-ovs",
and this race with "auto ..." used by networking service

bug reported here:
https://forum.proxmox.com/threads/so-is-openvswitch-bonding-just-broken-on-pve-6-whats-going-on.58020/

This is also fixing ovs with ifupdown2

Openvswitch github have a note about this:
e0dfd67b45 (diff-555e6da95251766b76e83867900bd8fe)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-09-20 09:06:47 +02:00
Wolfgang Bumiller
e90fc1e64b Fixup testcases for the previous commit
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-01-03 09:05:46 +01:00
Alexandre Derumier
8f5d56bfc9 Inotify: add support for 802.1ad stacked vlans 2018-10-04 13:06:54 +02:00
Wolfgang Bumiller
8b49281929 INotify: add tests for non-defined vlan bridge ports
This tests the case covered by the previous commit

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-09-11 14:13:39 +02:00
Wolfgang Bumiller
ec0f515131 tests: test newly added interfaces individually
And add eth2/3 to /proc/net/dev, that way we don't need to
create them "virtually" (which we shouldn't, for physical
interfaces).

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-07-10 12:34:10 +02:00
Alexandre Derumier
9b053d70de Inotify : add mtu option
also check if mtu value is lower than parent interface

fixme: vxlan interface should be 50bytes lower than outgoing interface
       we need to find which interface is used (unicast/multicast/frr)
2018-07-10 11:38:54 +02:00
Alexandre Derumier
c4e564708b Inotify : add check vlan
verify than parent interface exist
verify than parent interface type is eth,bond,bridge
verify than parent bridge is vlan aware if type bridge
2018-07-10 11:38:54 +02:00
Alexandre Derumier
0115696f6a Inotify : add check_bond
verify than bond slaves exist && type is eth
2018-07-10 11:38:54 +02:00
Alexandre Derumier
9a052564e1 Inotify : add bridge ports options 2018-07-10 11:38:54 +02:00
Alexandre Derumier
95aa8788b8 Inotify : add vxlan interface support 2018-07-10 11:38:54 +02:00
Wolfgang Bumiller
f6c4a56381 INotify: write network: don't duplicate bridge-vids
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-06-20 10:27:08 +02:00
Alexandre Derumier
1accc6da65 Inotify : write network config : use modern syntax for options
-replace options with '_'  with '-'
-use 'bond-slaves' instead 'slaves'
2018-06-20 10:11:48 +02:00
Dietmar Maurer
5d5a179cda runtest.pl: use lib '.' - because newer perl does not have that by default
To make tests work again on debian stretch.
2017-01-24 11:12:53 +01:00
Dietmar Maurer
1801bdaa93 replace the smartmatch operator 2016-05-12 11:37:00 +02:00
Wolfgang Bumiller
12a235d624 Fix #882: active state of interfaces depends on ipv6
read_etc_network_interfaces used the content of
/proc/net/if_inet6 to decide whether an interface's state is
"active", which means an interface is only active when it
has an ipv6 address, thus using net.ipv6.conf.*.disable_ipv6
on an interface will cause it to show as inactive in the web
interface.

We now filter the interfaces found in /proc/dev/net by their
IFF_UP flag read via an SIOCGIFFLAGS ioctl().
2016-02-10 12:20:21 +01:00
Wolfgang Bumiller
aeac55e138 half-revert: remove autostart property from bridge ports
In commit 21d32c95cd autostart was removed from all bridge
ports but should have only been removed from ovs bridge ports.
2015-10-19 11:11:29 +02:00
Wolfgang Bumiller
7a82210017 don't reorder unknown interface types
Giving unknown interfaces an order-id of 0 caused them to
always be on top of the interfaces file. This is often
undesired. Instead we now only take type-ordering into
account when both interfaces which are being compared have a
known type, and otherwise only use the priority attribute.
This should result in a more stable modification of
interfaces.

Fixes #747
2015-10-07 13:43:28 +02:00
Wolfgang Bumiller
21d32c95cd remove autostart property from bridge ports
Fixes #711
2015-09-14 12:42:47 +02:00
Wolfgang Bumiller
c7c4208a33 tests: list/create/update network interfaces 2015-06-26 07:51:26 +02:00
Wolfgang Bumiller
936218b86f importing etc_network_interfaces tests 2015-06-26 07:49:16 +02:00