6
24
Fork
You've already forked ifstate
13

support for macsec #130

Open
opened 2025年10月31日 18:49:43 +01:00 by felbinger · 1 comment
Contributor
Copy link

It would be nice if IfState would be capable of macsec. ifstatecli show already shows an interface of kind macsec, but thats it. The schema neither supports kind macsec, nor other configuration elements (like sci, encrypt, cipher, ...) yet.

It would be nice if IfState would be capable of macsec. `ifstatecli show` already shows an interface of kind macsec, but thats it. The schema neither supports kind macsec, nor other configuration elements (like sci, encrypt, cipher, ...) yet.
Owner
Copy link

I've added basic schema support allowing to create macsec links. Due to missing support in pyroute2 it is currently not possible to set any macsec related settings 🫤

# ip netns exec ms1 ifstatecli shell
Links:
 1: lo
 2: eth1
 3: eth0
 8: macsec0
Symbols:
 ipr = pyroute2.IPRoute()
ifstate 2.0.2; pyroute2 0.9.4
>>> pprint(ipr.get_link(index=8))
{'__align': (),
 'attrs': [('IFLA_IFNAME', 'macsec0'),
 ('IFLA_TXQLEN', 1000),
 ('IFLA_OPERSTATE', 'DOWN'),
 ('IFLA_LINKMODE', 0),
 ('IFLA_MTU', 1468),
 ('IFLA_MIN_MTU', 0),
 ('IFLA_MAX_MTU', 65535),
 ('IFLA_GROUP', 0),
 ('IFLA_PROMISCUITY', 0),
 ('UNKNOWN', {'header': {'length': 8, 'type': 61}}),
 ('IFLA_NUM_TX_QUEUES', 1),
 ('IFLA_GSO_MAX_SEGS', 65535),
 ('IFLA_GSO_MAX_SIZE', 65536),
 ('IFLA_GRO_MAX_SIZE', 65536),
 ('UNKNOWN', {'header': {'length': 8, 'type': 63}}),
 ('UNKNOWN', {'header': {'length': 8, 'type': 64}}),
 ('IFLA_TSO_MAX_SIZE', 65536),
 ('IFLA_TSO_MAX_SEGS', 65535),
 ('IFLA_NUM_RX_QUEUES', 1),
 ('IFLA_CARRIER', 0),
 ('IFLA_CARRIER_CHANGES', 1),
 ('IFLA_CARRIER_UP_COUNT', 0),
 ('IFLA_CARRIER_DOWN_COUNT', 1),
 ('IFLA_PROTO_DOWN', 0),
 ('IFLA_ADDRESS', '6a:12:27:b6:f9:d5'),
 ('IFLA_BROADCAST', 'ff:ff:ff:ff:ff:ff'),
 ('IFLA_STATS64', {'rx_packets': 0, 'tx_packets': 0, 'rx_bytes': 0, 'tx_bytes': 0, 'rx_errors': 0, 'tx_errors': 0, 'rx_dropped': 0, 'tx_dropped': 0, 'multicast': 0, 'collisions': 0, 'rx_length_errors': 0, 'rx_over_errors': 0, 'rx_crc_errors': 0, 'rx_frame_errors': 0, 'rx_fifo_errors': 0, 'rx_missed_errors': 0, 'tx_aborted_errors': 0, 'tx_carrier_errors': 0, 'tx_fifo_errors': 0, 'tx_heartbeat_errors': 0, 'tx_window_errors': 0, 'rx_compressed': 0, 'tx_compressed': 0}),
 ('IFLA_STATS', {'rx_packets': 0, 'tx_packets': 0, 'rx_bytes': 0, 'tx_bytes': 0, 'rx_errors': 0, 'tx_errors': 0, 'rx_dropped': 0, 'tx_dropped': 0, 'multicast': 0, 'collisions': 0, 'rx_length_errors': 0, 'rx_over_errors': 0, 'rx_crc_errors': 0, 'rx_frame_errors': 0, 'rx_fifo_errors': 0, 'rx_missed_errors': 0, 'tx_aborted_errors': 0, 'tx_carrier_errors': 0, 'tx_fifo_errors': 0, 'tx_heartbeat_errors': 0, 'tx_window_errors': 0, 'rx_compressed': 0, 'tx_compressed': 0}),
 ('IFLA_XDP', {'attrs': [('IFLA_XDP_ATTACHED', None)]}),
 ('IFLA_LINKINFO', {'attrs': [('IFLA_INFO_KIND', 'macsec'), ('IFLA_INFO_DATA', '0c:00:01:00:6a:12:27:b6:f9:d5:00:01:05:00:03:00:10:00:00:00:0c:00:04:00:02:00:00:01:00:c2:80:00:05:00:06:00:00:00:00:00:05:00:07:00:01:00:00:00:05:00:08:00:01:00:00:00:05:00:09:00:01:00:00:00:05:00:0a:00:01:00:00:00:05:00:0b:00:00:00:00:00:05:00:0c:00:01:00:00:00:05:00:0d:00:02:00:00:00:05:00:0f:00:00:00:00:00:08:00:05:00:8e:00:00:00')]}),

(There is no decoding for the IFLA_INFO_DATA attribute.)

I've added basic schema support allowing to create macsec links. Due to missing support in pyroute2 it is currently not possible to set any macsec related settings 🫤 ```python # ip netns exec ms1 ifstatecli shell Links: 1: lo 2: eth1 3: eth0 8: macsec0 Symbols: ipr = pyroute2.IPRoute() ifstate 2.0.2; pyroute2 0.9.4 >>> pprint(ipr.get_link(index=8)) {'__align': (), 'attrs': [('IFLA_IFNAME', 'macsec0'), ('IFLA_TXQLEN', 1000), ('IFLA_OPERSTATE', 'DOWN'), ('IFLA_LINKMODE', 0), ('IFLA_MTU', 1468), ('IFLA_MIN_MTU', 0), ('IFLA_MAX_MTU', 65535), ('IFLA_GROUP', 0), ('IFLA_PROMISCUITY', 0), ('UNKNOWN', {'header': {'length': 8, 'type': 61}}), ('IFLA_NUM_TX_QUEUES', 1), ('IFLA_GSO_MAX_SEGS', 65535), ('IFLA_GSO_MAX_SIZE', 65536), ('IFLA_GRO_MAX_SIZE', 65536), ('UNKNOWN', {'header': {'length': 8, 'type': 63}}), ('UNKNOWN', {'header': {'length': 8, 'type': 64}}), ('IFLA_TSO_MAX_SIZE', 65536), ('IFLA_TSO_MAX_SEGS', 65535), ('IFLA_NUM_RX_QUEUES', 1), ('IFLA_CARRIER', 0), ('IFLA_CARRIER_CHANGES', 1), ('IFLA_CARRIER_UP_COUNT', 0), ('IFLA_CARRIER_DOWN_COUNT', 1), ('IFLA_PROTO_DOWN', 0), ('IFLA_ADDRESS', '6a:12:27:b6:f9:d5'), ('IFLA_BROADCAST', 'ff:ff:ff:ff:ff:ff'), ('IFLA_STATS64', {'rx_packets': 0, 'tx_packets': 0, 'rx_bytes': 0, 'tx_bytes': 0, 'rx_errors': 0, 'tx_errors': 0, 'rx_dropped': 0, 'tx_dropped': 0, 'multicast': 0, 'collisions': 0, 'rx_length_errors': 0, 'rx_over_errors': 0, 'rx_crc_errors': 0, 'rx_frame_errors': 0, 'rx_fifo_errors': 0, 'rx_missed_errors': 0, 'tx_aborted_errors': 0, 'tx_carrier_errors': 0, 'tx_fifo_errors': 0, 'tx_heartbeat_errors': 0, 'tx_window_errors': 0, 'rx_compressed': 0, 'tx_compressed': 0}), ('IFLA_STATS', {'rx_packets': 0, 'tx_packets': 0, 'rx_bytes': 0, 'tx_bytes': 0, 'rx_errors': 0, 'tx_errors': 0, 'rx_dropped': 0, 'tx_dropped': 0, 'multicast': 0, 'collisions': 0, 'rx_length_errors': 0, 'rx_over_errors': 0, 'rx_crc_errors': 0, 'rx_frame_errors': 0, 'rx_fifo_errors': 0, 'rx_missed_errors': 0, 'tx_aborted_errors': 0, 'tx_carrier_errors': 0, 'tx_fifo_errors': 0, 'tx_heartbeat_errors': 0, 'tx_window_errors': 0, 'rx_compressed': 0, 'tx_compressed': 0}), ('IFLA_XDP', {'attrs': [('IFLA_XDP_ATTACHED', None)]}), ('IFLA_LINKINFO', {'attrs': [('IFLA_INFO_KIND', 'macsec'), ('IFLA_INFO_DATA', '0c:00:01:00:6a:12:27:b6:f9:d5:00:01:05:00:03:00:10:00:00:00:0c:00:04:00:02:00:00:01:00:c2:80:00:05:00:06:00:00:00:00:00:05:00:07:00:01:00:00:00:05:00:08:00:01:00:00:00:05:00:09:00:01:00:00:00:05:00:0a:00:01:00:00:00:05:00:0b:00:00:00:00:00:05:00:0c:00:01:00:00:00:05:00:0d:00:02:00:00:00:05:00:0f:00:00:00:00:00:08:00:05:00:8e:00:00:00')]}), ``` (There is no decoding for the `IFLA_INFO_DATA` attribute.)
Sign in to join this conversation.
No Branch/Tag specified
main
move-paths-into-module
feature-libifstate-rs
ifstate-2.4
pages
ifstate-2.1
ifstate-2.3
ifstate-2.0
ifstate-2.2
ifstate-1.x
2.4.1
2.4.0
2.3.0
2.3.0-pre6
2.2.6
2.3.0-pre5
2.3.0-pre4
2.3.0-pre3
2.3.0-pre2
2.3.0-pre1
2.2.5
2.3.0-pre0
2.2.4
2.2.4-pre2
2.2.4-pre1
2.2.4-pre0
2.2.3
2.2.2
2.2.1
2.2.0
2.1.0
1.13.9
2.0.2
2.0.1
1.13.8
2.0.0
2.0.0rc6
2.0.0rc5
2.0.0rc4
2.0.0rc3
2.0.0rc2
2.0.0rc1
1.13.7
1.13.6
1.13.5
1.13.4
1.13.3
1.13.2
1.13.1
1.13.0
1.12.0
1.11.9
1.11.8
1.11.7
1.11.6
1.11.5
1.11.4
1.11.3
1.11.2
1.11.1
1.11.0
1.10.1
1.10.0
1.9.0
1.8.5
1.8.4
1.8.3
1.8.2
1.8.1
1.8.0
1.7.0
1.6.1
1.6.0
1.5.8
1.5.7
1.5.6
1.5.5
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.0
1.3.2
1.3.1
1.3.0
1.2.1
1.2.0
1.1.0
1.0.0
0.9.0
0.8.1
0.8.0
0.7.3
0.7.2
0.7.1
0.7.0
0.6.3
0.6.2
0.6.1
0.6.0
0.5.1
0.5
0.4
0.3
0.2
Labels
Clear labels
bug
Something isn't working
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
more info
Further details are required, the problem may not yet be reproducible, yet
question
Further information is requested
TBD
To be discussed
wontfix
This will not be worked on
AI slop
Burning out
bug
Something is not working
contribution welcome
Contributions are very welcome, get started here
duplicate
This issue or pull request already exists
enhancement
New feature
good first issue
Interested in contributing? Get started here.
help wanted
Need some help
invalid
Something is wrong
question
More information is needed
upstream
Related to an upstream repository, already reported there
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
routerkit/ifstate#130
Reference in a new issue
routerkit/ifstate
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?