forked from vyos/vyos-1x
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path65-vyos-net.rules
More file actions
41 lines (31 loc) · 2 KB
/
Copy path65-vyos-net.rules
File metadata and controls
41 lines (31 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# These rules use vyos_net_name to persistently name network interfaces
# per "hwid" association in the VyOS configuration file.
ACTION!="add", GOTO="vyos_net_end"
SUBSYSTEM!="net", GOTO="vyos_net_end"
# Fallback path for Azure VF interfaces: if a VF still appears as plain ethN,
# rename it to vf_ethX before persistent synthetic interface naming runs to
# prevent it from incorrectly being considered as a synthetic interface.
ATTR{[dmi/id]sys_vendor}=="Microsoft Corporation", DRIVERS=="mlx*_core", KERNEL=="eth*", PROGRAM="vyos_vf_name %k", NAME="%c", GOTO="vyos_net_end"
ATTR{[dmi/id]sys_vendor}=="Microsoft Corporation", DRIVERS=="mana", KERNEL=="eth*", PROGRAM="vyos_vf_name %k", NAME="%c", GOTO="vyos_net_end"
# VF interfaces are not handled by vyos_net_name, so skip them.
# KERNEL=="vf_*" catches already-renamed Mellanox and MANA VFs.
# DRIVERS=="mlx*_core" and DRIVERS=="mana" on Azure catch VF interfaces
# in an unexpected intermediate state (still named ethN/eN) that must not
# be remapped by vyos_net_name.
# This guard is intentionally scoped to Microsoft Azure to
# avoid excluding bare-metal Mellanox NICs on physical hardware, which do
# need persistent naming via vyos_net_name.
KERNEL=="vf_*", GOTO="vyos_net_end"
ATTR{[dmi/id]sys_vendor}=="Microsoft Corporation", DRIVERS=="mlx*_core", GOTO="vyos_net_end"
ATTR{[dmi/id]sys_vendor}=="Microsoft Corporation", DRIVERS=="mana", GOTO="vyos_net_end"
# Do name change for ethernet and wireless devices only
KERNEL!="eth*|wlan*|e*", GOTO="vyos_net_end"
# ignore "secondary" monitor interfaces of mac80211 drivers
KERNEL=="wlan*", ATTRS{type}=="803", GOTO="vyos_net_end"
# If using VyOS predefined names
ENV{VYOS_IFNAME}!="eth*", GOTO="end_vyos_predef_names"
DRIVERS=="?*", PROGRAM="vyos_net_name %k $attr{address} $env{VYOS_IFNAME}", NAME="%c", GOTO="vyos_net_end"
LABEL="end_vyos_predef_names"
# ignore interfaces without a driver link like bridges and VLANs
DRIVERS=="?*", PROGRAM="vyos_net_name %k $attr{address}", NAME="%c"
LABEL="vyos_net_end"