uplink-id is an integer
it's used to abstract the interface name (could be different on
differents hosts)
and map it to a transportzone.
uplink-id is only allowed on physical interfaces (bond,eth,vlan)
as it's used for traffic to external
example:
auto eth0
iface eth0 inet manual
uplink-id 1
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
this allows us to always show the 'address' the 'netmask' and the 'cidr'
both for ipv4 and ipv6
there is a small api change involved in one scenario:
if one manually changed the address to cidr format like
'10.0.0.4/24'
we now get from the api the parsed values
addr => 10.0.0.4
netmask => 24
cidr => 10.0.0.4/24
instead of
addr => 10.0.0.4/24
netmask =>
but i think that circumventing our api when writing the file, but still
relying on the api for reading is not a valid use case, i would argue
that we can change this, especially since we have a new field that
contains that information again (cidr)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
We can add to a bridge a non defined vlan interface.
We only need to check that physical interface exist
example:
auto eno1
iface eno1 inet manual
auto vmbr0
iface vmbr0 inet manual
bridge_ports eno1.1
[w.bumiller@proxmox.com: style & commit message fixup]
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
- special check for bond, set parent mtu from slaves mtu if no defined.
- error if parent mtu is lower than child mtu (not bigger)
- return if child mtu is not defined
- fix vlan check (parent/child was inverted)
The previous condition didn't fail tests because it was
always false. The 'exists' property is not actually usable
when writing the interface file. It is merely a hint that
the interface existed in /proc/net/dev while parsing the
interfaces file and is otherwise actually unused here.
Simply check for the existence of the interface in $ifaces.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
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)
This avoids a circular dependency between PVE::INotify and
PVE::Network.
Also renamed to get_active_network_interfaces since the
package name now doesn't hint at this anymore.
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().
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