raspberry-pi-macsec
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| raspberry-pi-macsec [2025/10/04 16:11] – angelegt benny | raspberry-pi-macsec [2025/12/21 14:18] (aktuell) – benny | ||
|---|---|---|---|
| Zeile 26: | Zeile 26: | ||
| Updating files: 100% (87559/ | Updating files: 100% (87559/ | ||
| benny@debian: | benny@debian: | ||
| + | benny@debian: | ||
| benny@debian: | benny@debian: | ||
| HOSTCC | HOSTCC | ||
| Zeile 82: | Zeile 83: | ||
| </ | </ | ||
| + | ===== Neuen Kernel auf dem Pi nutzen ===== | ||
| + | [[https:// | ||
| + | < | ||
| + | pi@MACsecPi: | ||
| + | kernel-macsec.tar.gz | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | </ | ||
| + | |||
| + | ===== PKI mit OpenSSL erzeugen ===== | ||
| + | |||
| + | Passwort: demoDEMOdemoOnly | ||
| + | |||
| + | my-openssl.cnf | ||
| + | < | ||
| + | [ ca ] | ||
| + | default_ca = CA_default | ||
| + | |||
| + | [ CA_default ] | ||
| + | dir = ./demoCA | ||
| + | certs = $dir/certs | ||
| + | new_certs_dir | ||
| + | database | ||
| + | serial | ||
| + | private_key | ||
| + | certificate | ||
| + | default_days | ||
| + | default_md | ||
| + | policy | ||
| + | x509_extensions | ||
| + | |||
| + | [ policy_strict ] | ||
| + | commonName | ||
| + | countryName | ||
| + | stateOrProvinceName | ||
| + | organizationName | ||
| + | organizationalUnitName | ||
| + | |||
| + | [ req ] | ||
| + | default_bits | ||
| + | distinguished_name | ||
| + | string_mask | ||
| + | default_md | ||
| + | x509_extensions | ||
| + | |||
| + | [ req_distinguished_name ] | ||
| + | commonName | ||
| + | |||
| + | [ v3_ca ] | ||
| + | subjectKeyIdentifier=hash | ||
| + | authorityKeyIdentifier=keyid: | ||
| + | basicConstraints = critical, | ||
| + | keyUsage = critical, | ||
| + | |||
| + | [ v3_server ] | ||
| + | basicConstraints = CA:FALSE | ||
| + | keyUsage = critical, | ||
| + | extendedKeyUsage = serverAuth | ||
| + | subjectKeyIdentifier=hash | ||
| + | authorityKeyIdentifier=keyid, | ||
| + | |||
| + | [ v3_client ] | ||
| + | basicConstraints = CA:FALSE | ||
| + | keyUsage = critical, | ||
| + | extendedKeyUsage = clientAuth | ||
| + | subjectKeyIdentifier=hash | ||
| + | authorityKeyIdentifier=keyid, | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % ls | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % touch my-openssl.cnf | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % vi my-openssl.cnf | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % mkdir -p demoCA/ | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % touch demoCA/ | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % echo 1000 > demoCA/ | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % openssl req -new -x509 -days 3650 -extensions v3_ca \ | ||
| + | -keyout demoCA/ | ||
| + | -config my-openssl.cnf -subj "/ | ||
| + | Generating a 4096 bit RSA private key | ||
| + | ...................................................++++ | ||
| + | ...................................++++ | ||
| + | writing new private key to ' | ||
| + | Enter PEM pass phrase: | ||
| + | Verifying - Enter PEM pass phrase: | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % openssl req -new -nodes -out server.csr -newkey rsa:4096 -keyout server.key \ | ||
| + | -subj "/ | ||
| + | Generating a 4096 bit RSA private key | ||
| + | ................++++ | ||
| + | ...........................++++ | ||
| + | writing new private key to ' | ||
| + | ----- | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % openssl ca -config my-openssl.cnf -extensions v3_server \ | ||
| + | -in server.csr -out server.crt -days 1825 | ||
| + | Using configuration from my-openssl.cnf | ||
| + | Enter pass phrase for ./ | ||
| + | Check that the request matches the signature | ||
| + | Signature ok | ||
| + | The Subject' | ||
| + | commonName | ||
| + | Certificate is to be certified until Oct 3 18:02:51 2030 GMT (1825 days) | ||
| + | Sign the certificate? | ||
| + | |||
| + | |||
| + | 1 out of 1 certificate requests certified, commit? [y/n]y | ||
| + | Write out database with 1 new entries | ||
| + | Data Base Updated | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % openssl req -new -nodes -out client.csr -newkey rsa:4096 -keyout client.key \ | ||
| + | -subj "/ | ||
| + | Generating a 4096 bit RSA private key | ||
| + | .................................++++ | ||
| + | ......++++ | ||
| + | writing new private key to ' | ||
| + | ----- | ||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % openssl ca -config my-openssl.cnf -extensions v3_client \ | ||
| + | -in client.csr -out client.crt -days 730 | ||
| + | Using configuration from my-openssl.cnf | ||
| + | Enter pass phrase for ./ | ||
| + | Check that the request matches the signature | ||
| + | Signature ok | ||
| + | The Subject' | ||
| + | commonName | ||
| + | Certificate is to be certified until Oct 4 18:04:46 2027 GMT (730 days) | ||
| + | Sign the certificate? | ||
| + | |||
| + | |||
| + | 1 out of 1 certificate requests certified, commit? [y/n]y | ||
| + | Write out database with 1 new entries | ||
| + | Data Base Updated | ||
| + | |||
| + | benny@Bennys-MacBook-Pro-8 MACsecCA % openssl rsa -aes256 -in server.key -out server-enc.key | ||
| + | writing RSA key | ||
| + | Enter PEM pass phrase: | ||
| + | Verifying - Enter PEM pass phrase: | ||
| + | </ | ||
| + | |||
| + | ===== 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" | ||
| + | |||
| + | < | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | pi@MACsecPi: | ||
| + | </ | ||
| + | |||
| + | ===== Konfiguration für 802.1X mit MACsec (802.1AE) ===== | ||
| + | < | ||
| + | pi@MACsecPi: | ||
| + | eapol_version=3 | ||
| + | ap_scan=0 | ||
| + | network={ | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Befehl für Verbindungsaufbau ===== | ||
| + | |||
| + | <WRAP center round tip 60%> | ||
| + | Es ist elementar wichtig hier " | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | pi@MACsecPi: | ||
| + | # Funktioniert, | ||
| + | Fehler: EAPOL type 5 will be handled by MKA | ||
| + | |||
| + | pi@MACsecPi: | ||
| + | |||
| + | pi@MACsecPi: | ||
| + | </ | ||
| + | |||
| + | ===== Ausgabe von "ip macsec show macsec0" | ||
| + | |||
| + | < | ||
| + | pi@MACsecPi: | ||
| + | 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, | ||
| + | TXSC: 2ccf67b441497530 on SA 0 | ||
| + | 0: PN 71, state on, key cddd869e518389d333cc45e601000000 | ||
| + | RXSC: 9424e16b34650001, | ||
| + | 0: PN 484, state on, key cddd869e518389d333cc45e601000000 | ||
| + | offload: off | ||
| + | </ | ||
| + | |||
| + | ===== Ausgaben vom Switch ===== | ||
| + | |||
| + | ==== show unp user ==== | ||
| + | < | ||
| + | -> show unp user | ||
| + | User | ||
| + | | ||
| + | --------+--------------------+-----------------+----------------------------------------+----+--------------------------------+------------+----------- | ||
| + | 1/1/3 MACsecPi | ||
| + | |||
| + | Total users : 1 | ||
| + | </ | ||
| + | |||
| + | ==== show unp user details ==== | ||
| + | < | ||
| + | -> show unp user details | ||
| + | Port: 1/1/3 | ||
| + | MAC-Address: | ||
| + | SAP = -, | ||
| + | Service ID = -, | ||
| + | VNID = -, | ||
| + | VPNID = -, | ||
| + | ISID = -, | ||
| + | VPLSID | ||
| + | Access Timestamp | ||
| + | User Name = MACsecPi, | ||
| + | IP-Address | ||
| + | Vlan = 15, | ||
| + | Authentication Type = 802.1x, | ||
| + | Authentication Status | ||
| + | Authentication Failure Reason | ||
| + | Authentication Retry Count = 0, | ||
| + | Authentication Server IP Used = 143.209.0.2, | ||
| + | Authentication Server Used = UPAMRadiusServer, | ||
| + | Server Reply-Message | ||
| + | Profile | ||
| + | Profile Source | ||
| + | Profile From Auth Server | ||
| + | Implict Trust-Tag Source | ||
| + | RADIUS Alcatel-trust-tag-vlans | ||
| + | Session Timeout | ||
| + | Classification Profile Rule = -, | ||
| + | Role = -, | ||
| + | Role Source | ||
| + | User Role Rule = -, | ||
| + | Restricted Access | ||
| + | Location Policy Status | ||
| + | Time Policy Status | ||
| + | QMR Status | ||
| + | Redirect Url = -, | ||
| + | SIP Call Type = Not in a call, | ||
| + | SIP Media Type = None, | ||
| + | Applications | ||
| + | Encap Value = -, | ||
| + | Rule ID = -, | ||
| + | |||
| + | Total users : 1 | ||
| + | </ | ||
| + | |||
| + | ==== show interfaces macsec dynamic ==== | ||
| + | |||
| + | < | ||
| + | -> show interfaces macsec dynamic | ||
| + | | ||
| + | | ||
| + | ----------------+-------------+----------+----------+------------+----------+---------------+--------+-------------- | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | ==== show interfaces macsec 1/1/3 ==== | ||
| + | |||
| + | < | ||
| + | -> show interfaces macsec 1/1/3 | ||
| + | | ||
| + | ---------------+-------------+----------+--------------+---------------------+-----------------------+----------------- | ||
| + | | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== show interfaces macsec statistics 1/1/3 ==== | ||
| + | < | ||
| + | -> show interfaces macsec statistics 1/1/3 | ||
| + | Chassis/ | ||
| + | Byte Transmitted | ||
| + | Too Long TX Pkts : | ||
| + | Untagged RX Pkts : | ||
| + | Bad Tagged RX Pkts : | ||
| + | No SCI RX Pkts : | ||
| + | SCI-TX: 0x9424e16b34650001 | ||
| + | TX Protected Pkts : | ||
| + | TX Octets Protected | ||
| + | SA: 0 | ||
| + | TX Protected Pkts : | ||
| + | SCI-RX: 0x2ccf67b441497530 | ||
| + | RX Unused SA Pkts : | ||
| + | RX Late Pkts : | ||
| + | RX Invalid Pkts : | ||
| + | RX Unchecked Pkts : | ||
| + | RX Octets Validated | ||
| + | SA: 0 | ||
| + | RX Unused SA Pkts : | ||
| + | RX Not Valid Pkts : | ||
| + | RX OK Pkts : | ||
| + | </ | ||
| + | |||
| + | ===== Performance ===== | ||
| + | |||
| + | ==== iPerf3 mit MACsec ==== | ||
| + | |||
| + | < | ||
| + | ----------------------------------------------------------- | ||
| + | Server listening on 5201 (test #1) | ||
| + | ----------------------------------------------------------- | ||
| + | Accepted connection from 192.168.15.155, | ||
| + | [ 5] local 192.168.2.1 port 5201 connected to 192.168.15.155 port 39414 | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] 10.00-10.01 | ||
| + | - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | ----------------------------------------------------------- | ||
| + | Server listening on 5201 (test #2) | ||
| + | ----------------------------------------------------------- | ||
| + | Accepted connection from 192.168.15.155, | ||
| + | [ 5] local 192.168.2.1 port 5201 connected to 192.168.15.155 port 56362 | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] 10.00-10.01 | ||
| + | - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | ----------------------------------------------------------- | ||
| + | Server listening on 5201 (test #3) | ||
| + | ----------------------------------------------------------- | ||
| + | Accepted connection from 192.168.15.155, | ||
| + | [ 5] local 192.168.2.1 port 5201 connected to 192.168.15.155 port 57596 | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] 10.00-10.01 | ||
| + | - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | </ | ||
| + | |||
| + | ==== iPerf3 ohne MACsec ==== | ||
| + | |||
| + | < | ||
| + | ----------------------------------------------------------- | ||
| + | Server listening on 5201 (test #1) | ||
| + | ----------------------------------------------------------- | ||
| + | Accepted connection from 192.168.15.154, | ||
| + | [ 5] local 192.168.2.1 port 5201 connected to 192.168.15.154 port 52336 | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] 10.00-10.00 | ||
| + | - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | ----------------------------------------------------------- | ||
| + | Server listening on 5201 (test #2) | ||
| + | ----------------------------------------------------------- | ||
| + | Accepted connection from 192.168.15.154, | ||
| + | [ 5] local 192.168.2.1 port 5201 connected to 192.168.15.154 port 57186 | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] 10.00-10.00 | ||
| + | - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | ----------------------------------------------------------- | ||
| + | Server listening on 5201 (test #3) | ||
| + | ----------------------------------------------------------- | ||
| + | Accepted connection from 192.168.15.154, | ||
| + | [ 5] local 192.168.2.1 port 5201 connected to 192.168.15.154 port 58090 | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] | ||
| + | [ 5] 10.00-10.00 | ||
| + | - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| + | [ ID] Interval | ||
| + | [ 5] | ||
| + | </ | ||
| + | |||
| + | ==== 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: | ||
| + | < | ||
| + | pi@MACsecPi: | ||
| + | processor : 0 | ||
| + | BogoMIPS : 108.00 | ||
| + | Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp | ||
| + | CPU implementer : | ||
| + | CPU architecture: | ||
| + | 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 : | ||
| + | CPU architecture: | ||
| + | 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 : | ||
| + | CPU architecture: | ||
| + | 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 : | ||
| + | CPU architecture: | ||
| + | CPU variant : 0x4 | ||
| + | CPU part : 0xd0b | ||
| + | CPU revision : 1 | ||
| + | |||
| + | Revision : c04180 | ||
| + | Serial : b889764a77c11e15 | ||
| + | Model : Raspberry Pi Compute Module 5 Rev 1.0 | ||
| + | </ | ||
raspberry-pi-macsec.1759594272.txt.gz · Zuletzt geändert: von benny
