Skip to content

Commit

Permalink
netconf: Ignore internal ifaces (e.g. DSA ports) in factory-config
Browse files Browse the repository at this point in the history
On some system, certain interfaces are not usable by an end-user. The
canonical example of this is the ethernet MAC connected to a switch,
i.e. the DSA port.

Avoid having these be picked up in the generated factory-config, which
would be confusing to a user, by classifying them as "internal" ports
to be ignored by confd and friends.
  • Loading branch information
wkz committed Aug 24, 2023
1 parent 7ca7ac1 commit 75decf8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions board/common/rootfs/etc/iproute2/group
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
1 port
2 iface
3 internal
2 changes: 1 addition & 1 deletion board/common/rootfs/lib/infix/nameif
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ for netif in /sys/class/net/*; do

dsa="dsa$num"
logger -k -p user.notice -t "$ident" "Found DSA interface, renaming $iface -> $dsa"
ip link set dev "$iface" name $dsa
ip link set dev "$iface" name $dsa group internal
num=$((num + 1))
done

Expand Down
1 change: 1 addition & 0 deletions board/netconf/rootfs/lib/infix/factory/gen-interfaces
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ EOF
phys_ifaces=$(ip -d -j link show | jq -r '
.[] |
select(.link_type == "ether") |
select(.group != "internal") |
select(has("linkinfo") | not) |
.ifname')

Expand Down

0 comments on commit 75decf8

Please sign in to comment.