Benutzer-Werkzeuge

Webseiten-Werkzeuge


raspberry-pi-macsec

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
raspberry-pi-macsec [2025/10/04 18:37] – [Neuen Kernel auf dem Pi nutzen] bennyraspberry-pi-macsec [2025/12/21 14:18] (aktuell) benny
Zeile 233: Zeile 233:
 </code> </code>
  
 +===== wpa_supplicant v2.11 kompilieren =====
 +
 +Wurde offenbar ohne MACsec kompiliert in Raspberry Pi OS Trixie, daher mal manuell probieren.
 +wpa_supplicant v2.11 reagiert nicht auf den "Key Server".
 +
 +<code>
 +pi@MACsecPi:~ wget https://w1.fi/releases/wpa_supplicant-2.11.tar.gz
 +pi@MACsecPi:~ tar xzf wpa_supplicant-2.11.tar.gz 
 +pi@MACsecPi:~/wpa_supplicant-2.11/wpa_supplicant $ 
 +pi@MACsecPi:~/wpa_supplicant-2.11/wpa_supplicant $ cp defconfig .config
 +pi@MACsecPi:~/wpa_supplicant-2.11/wpa_supplicant $ vi .config
 +pi@MACsecPi:~/wpa_supplicant-2.11/wpa_supplicant $ sudo apt install dbus-1 libnl-3.0 libssl-dev libdbus-1-3 libdbus-1-dev libnl-3-dev libnl-genl-3-dev install libnl-route-3-dev 
 +pi@MACsecPi:~/wpa_supplicant-2.11/wpa_supplicant $ make
 +</code>
 +
 +===== Konfiguration für 802.1X mit MACsec (802.1AE) =====
 +<code>
 +pi@MACsecPi:~ $ cat dot1X.conf
 +eapol_version=3
 +ap_scan=0
 +network={
 + key_mgmt=IEEE8021X
 + eap=TLS
 + identity="MACsecPi"
 + ca_cert="/home/pi/MACsecCA/radius_ca_chain.pem"
 + client_cert="/home/pi/MACsecCA/client.crt"
 + private_key="/home/pi/MACsecCA/client.key"
 + eapol_flags=0
 + macsec_policy=1
 + macsec_port=30000
 +}
 +</code>
 +
 +===== Befehl für Verbindungsaufbau =====
 +
 +<WRAP center round tip 60%>
 +Es ist elementar wichtig hier "macsec_linux" als Treiber zu verwenden anstatt "wired"!
 +</WRAP>
 +
 +<code>
 +pi@MACsecPi:~ $ sudo wpa_supplicant -i eth0 -D wired -c dot1X.conf -ddd
 +# Funktioniert, bis es nicht mehr funktioniert ...
 +Fehler: EAPOL type 5 will be handled by MKA
 +
 +pi@MACsecPi:~ $ sudo wpa_supplicant -i eth0 -D macsec_linux -c dot1X.conf –ddd
 +
 +pi@MACsecPi:~ $ sudo dhcpcd macsec0
 +</code>
 +
 +===== Ausgabe von "ip macsec show macsec0" =====
 +
 +<code>
 +pi@MACsecPi:~ $ ip macsec show macsec0 
 +4: macsec0: protect on validate strict sc off sa off encrypt on send_sci on end_station off scb off replay off 
 +    cipher suite: GCM-AES-128, using ICV length 16
 +    TXSC: 2ccf67b441497530 on SA 0
 +        0: PN 71, state on, key cddd869e518389d333cc45e601000000
 +    RXSC: 9424e16b34650001, state on
 +        0: PN 484, state on, key cddd869e518389d333cc45e601000000
 +    offload: off 
 +</code>
 +
 +===== Ausgaben vom Switch =====
 +
 +==== show unp user ====
 +<code>
 +-> show unp user
 +                                                User                                                                           
 + Port    Username             Mac address       IP (V4/V6)                               Vlan Profile                          Type         Status      
 +--------+--------------------+-----------------+----------------------------------------+----+--------------------------------+------------+-----------
 +1/1/3    MACsecPi             2c:cf:67:b4:41:49 192.168.15.155                           15   vlan15                           Bridge       Active      
 +
 +Total users : 1
 +</code>
 +
 +==== show unp user details ====
 +<code>
 +-> show unp user details 
 +Port: 1/1/3
 +    MAC-Address: 2c:cf:67:b4:41:49
 +      SAP                             = -,
 +      Service ID                      = -,
 +      VNID                            = -,
 +      VPNID                           = -,
 +      ISID                            = -,
 +      VPLSID                          = -,
 +      Access Timestamp                = 11/10/2025 17:40:30,
 +      User Name                       = MACsecPi,
 +      IP-Address                      = 192.168.15.155,
 +      Vlan                            = 15,
 +      Authentication Type             = 802.1x,
 +      Authentication Status           = Authenticated,
 +      Authentication Failure Reason   = -,
 +      Authentication Retry Count      = 0,
 +      Authentication Server IP Used   = 143.209.0.2,
 +      Authentication Server Used      = UPAMRadiusServer,
 +      Server Reply-Message            = -,
 +      Profile                         = vlan15,
 +      Profile Source                  = Auth - Pass - Default UNP,
 +      Profile From Auth Server        = -,
 +      Implict Trust-Tag Source        = -,
 +      RADIUS Alcatel-trust-tag-vlans  = -,
 +      Session Timeout                 = 0,
 +      Classification Profile Rule     = -,
 +      Role                            = -,
 +      Role Source                     = -,
 +      User Role Rule                  = -,
 +      Restricted Access               = No,
 +      Location Policy Status          = -,
 +      Time Policy Status              = -,
 +      QMR Status                      = Passed,
 +      Redirect Url                    = -,
 +      SIP Call Type                   = Not in a call,
 +      SIP Media Type                  = None,
 +      Applications                    = None,
 +      Encap Value                     = -,
 +      Rule ID                         = -,
 +
 +Total users : 1
 +</code>
 +
 +==== show interfaces macsec dynamic ====
 +
 +<code>
 +-> show interfaces macsec dynamic 
 +                                                                   Server     Transmit        Key      Operation
 + Chas/Slot/Port   Admin-State   Mode       Keychain   Encryption   Priority   Interval(Sec)   Server   Status   
 +----------------+-------------+----------+----------+------------+----------+---------------+--------+--------------
 + 1/1/           Enabled       radius      NA        Enabled       15          2             YES      UP       
 + 1/1/           Enabled       radius      NA        Enabled       15          2             YES      DOWN     
 +</code>
 +
 +==== show interfaces macsec 1/1/3 ====
 +
 +<code>
 +-> show interfaces macsec 1/1/3 
 + Chas/Slot/Port  Admin-State   Mode       Encryption     Exchange Data         Session Time (Min)      Cipher Suite    
 +---------------+-------------+----------+--------------+---------------------+-----------------------+-----------------
 + 1/1/          Enabled       Radius     Enabled        -                                           gcm-aes-128              
 +
 +</code>
 +
 +==== show interfaces macsec statistics 1/1/3 ====
 +<code>
 +-> show interfaces macsec statistics 1/1/3
 +Chassis/Slot/Port 1/1/3
 +  Byte Transmitted     :          11085688,     Untagged TX Pkts     :                 0,
 +  Too Long TX Pkts     :                 0,     Byte Received        :        3619771305,
 +  Untagged RX Pkts     :                 0,     No Tagged RX Pkts    :              1466,
 +  Bad Tagged RX Pkts   :                 0,     Unknown SCI RX Pkts  :                 0,
 +  No SCI RX Pkts       :                 0,     Overrun RX Pkts      :                 0,
 +  SCI-TX: 0x9424e16b34650001
 +    TX Protected Pkts      :                 0,    TX Encrypted Pkts      :               207,
 +    TX Octets Protected    :                 0,    TX Octets Encrypted    :          10865928,
 +      SA: 0
 +        TX Protected Pkts      :         0,    TX Encrypted Pkts      :         0,
 +  SCI-RX: 0x2ccf67b441497530
 +    RX Unused SA Pkts      :                 0,    RX No Using SA Pkts    :                 0,
 +    RX Late Pkts           :                 0,    RX Not Valid Pkts      :                 0,
 +    RX Invalid Pkts        :                 0,    RX Delayed Pkts        :                 0,
 +    RX Unchecked Pkts      :                 0,    RX OK Pkts             :                62,
 +    RX Octets Validated    :                 0,    RX Octets Decrypted    :        3619541905,
 +      SA: 0
 +        RX Unused SA Pkts      :         0,    RX No Using SA Pkts     :         0,
 +        RX Not Valid Pkts      :         0,    RX Invalid Pkts         :         0,
 +        RX OK Pkts             :         0,
 +</code>
 +
 +===== Performance =====
 +
 +==== iPerf3 mit MACsec ====
 +
 +<code>
 +-----------------------------------------------------------
 +Server listening on 5201 (test #1)
 +-----------------------------------------------------------
 +Accepted connection from 192.168.15.155, port 39398
 +[  5] local 192.168.2.1 port 5201 connected to 192.168.15.155 port 39414
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-1.00   sec   110 MBytes   920 Mbits/sec                  
 +[  5]   1.00-2.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   2.00-3.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   3.00-4.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   4.00-5.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   5.00-6.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   6.00-7.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   7.00-8.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   8.00-9.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   9.00-10.00  sec   110 MBytes   921 Mbits/sec                  
 +[  5]  10.00-10.01  sec   718 KBytes   915 Mbits/sec                  
 +- - - - - - - - - - - - - - - - - - - - - - - - -
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-10.01  sec  1.07 GBytes   921 Mbits/sec                  receiver
 +-----------------------------------------------------------
 +Server listening on 5201 (test #2)
 +-----------------------------------------------------------
 +Accepted connection from 192.168.15.155, port 56352
 +[  5] local 192.168.2.1 port 5201 connected to 192.168.15.155 port 56362
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-1.00   sec   110 MBytes   920 Mbits/sec                  
 +[  5]   1.00-2.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   2.00-3.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   3.00-4.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   4.00-5.00   sec   109 MBytes   915 Mbits/sec                  
 +[  5]   5.00-6.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   6.00-7.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   7.00-8.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   8.00-9.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   9.00-10.00  sec   110 MBytes   921 Mbits/sec                  
 +[  5]  10.00-10.01  sec   635 KBytes   908 Mbits/sec                  
 +- - - - - - - - - - - - - - - - - - - - - - - - -
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-10.01  sec  1.07 GBytes   920 Mbits/sec                  receiver
 +-----------------------------------------------------------
 +Server listening on 5201 (test #3)
 +-----------------------------------------------------------
 +Accepted connection from 192.168.15.155, port 57584
 +[  5] local 192.168.2.1 port 5201 connected to 192.168.15.155 port 57596
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-1.00   sec   110 MBytes   920 Mbits/sec                  
 +[  5]   1.00-2.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   2.00-3.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   3.00-4.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   4.00-5.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   5.00-6.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   6.00-7.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   7.00-8.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   8.00-9.00   sec   110 MBytes   921 Mbits/sec                  
 +[  5]   9.00-10.00  sec   110 MBytes   921 Mbits/sec                  
 +[  5]  10.00-10.01  sec   783 KBytes   919 Mbits/sec                  
 +- - - - - - - - - - - - - - - - - - - - - - - - -
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-10.01  sec  1.07 GBytes   921 Mbits/sec                  receiver
 +</code>
 +
 +==== iPerf3 ohne MACsec ====
 +
 +<code>
 +-----------------------------------------------------------
 +Server listening on 5201 (test #1)
 +-----------------------------------------------------------
 +Accepted connection from 192.168.15.154, port 52334
 +[  5] local 192.168.2.1 port 5201 connected to 192.168.15.154 port 52336
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-1.00   sec   111 MBytes   933 Mbits/sec                  
 +[  5]   1.00-2.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   2.00-3.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   3.00-4.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   4.00-5.00   sec   111 MBytes   933 Mbits/sec                  
 +[  5]   5.00-6.00   sec   111 MBytes   935 Mbits/sec                  
 +[  5]   6.00-7.00   sec   111 MBytes   933 Mbits/sec                  
 +[  5]   7.00-8.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   8.00-9.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   9.00-10.00  sec   111 MBytes   934 Mbits/sec                  
 +[  5]  10.00-10.00  sec   364 KBytes   933 Mbits/sec                  
 +- - - - - - - - - - - - - - - - - - - - - - - - -
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-10.00  sec  1.09 GBytes   934 Mbits/sec                  receiver
 +-----------------------------------------------------------
 +Server listening on 5201 (test #2)
 +-----------------------------------------------------------
 +Accepted connection from 192.168.15.154, port 57170
 +[  5] local 192.168.2.1 port 5201 connected to 192.168.15.154 port 57186
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-1.00   sec   111 MBytes   933 Mbits/sec                  
 +[  5]   1.00-2.00   sec   111 MBytes   932 Mbits/sec                  
 +[  5]   2.00-3.00   sec   111 MBytes   935 Mbits/sec                  
 +[  5]   3.00-4.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   4.00-5.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   5.00-6.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   6.00-7.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   7.00-8.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   8.00-9.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   9.00-10.00  sec   111 MBytes   934 Mbits/sec                  
 +[  5]  10.00-10.00  sec   128 KBytes   434 Mbits/sec                  
 +- - - - - - - - - - - - - - - - - - - - - - - - -
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-10.00  sec  1.09 GBytes   934 Mbits/sec                  receiver
 +-----------------------------------------------------------
 +Server listening on 5201 (test #3)
 +-----------------------------------------------------------
 +Accepted connection from 192.168.15.154, port 58078
 +[  5] local 192.168.2.1 port 5201 connected to 192.168.15.154 port 58090
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-1.00   sec   111 MBytes   933 Mbits/sec                  
 +[  5]   1.00-2.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   2.00-3.00   sec   111 MBytes   933 Mbits/sec                  
 +[  5]   3.00-4.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   4.00-5.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   5.00-6.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   6.00-7.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   7.00-8.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   8.00-9.00   sec   111 MBytes   934 Mbits/sec                  
 +[  5]   9.00-10.00  sec   111 MBytes   934 Mbits/sec                  
 +[  5]  10.00-10.00  sec   344 KBytes   911 Mbits/sec                  
 +- - - - - - - - - - - - - - - - - - - - - - - - -
 +[ ID] Interval           Transfer     Bitrate
 +[  5]   0.00-10.00  sec  1.09 GBytes   934 Mbits/sec                  receiver
 +</code>
 +
 +==== Raspberry Pi bietet AES-Beschleunigung in Hardware ====
 +
 +Der hohe Durchsatz trotz MACsec ist auf die AES-Beschleunigung in Hardware auf dem Pi zurückzuführen:
 +<code>
 +pi@MACsecPi:~ $ cat /proc/cpuinfo 
 +processor : 0
 +BogoMIPS : 108.00
 +Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
 +CPU implementer : 0x41
 +CPU architecture: 8
 +CPU variant : 0x4
 +CPU part : 0xd0b
 +CPU revision : 1
 +
 +processor : 1
 +BogoMIPS : 108.00
 +Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
 +CPU implementer : 0x41
 +CPU architecture: 8
 +CPU variant : 0x4
 +CPU part : 0xd0b
 +CPU revision : 1
 +
 +processor : 2
 +BogoMIPS : 108.00
 +Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
 +CPU implementer : 0x41
 +CPU architecture: 8
 +CPU variant : 0x4
 +CPU part : 0xd0b
 +CPU revision : 1
 +
 +processor : 3
 +BogoMIPS : 108.00
 +Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp
 +CPU implementer : 0x41
 +CPU architecture: 8
 +CPU variant : 0x4
 +CPU part : 0xd0b
 +CPU revision : 1
 +
 +Revision : c04180
 +Serial : b889764a77c11e15
 +Model : Raspberry Pi Compute Module 5 Rev 1.0
 +</code>
  
raspberry-pi-macsec.1759603064.txt.gz · Zuletzt geändert: von benny

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki