Dokumentation · Netzwerk

FreeRADIUS Konfigurationsguide

802.1X NAC EAP-TLS · PEAP-MSCHAPv2 · TTLS-PAP · MAB Aruba AOS-CX · FS PicOS
Inhalt
  1. Grundlegende Struktur
  2. EAP-TLS
  3. EAP-TTLS-PAP
  4. EAP-PEAP-MSCHAPv2
  5. MAB
  6. Zertifikatserstellung
  7. Nutzerkonfiguration
  8. VLAN Policy (AD)
  9. Switch-Konfiguration
  10. Troubleshooting

Der FreeRADIUS Server verarbeitet Anfragen sequenziell in den Phasen: Authorize → Authenticate → Post-Auth → Accounting.

Die meisten Module sind standardmäßig per Symlink aktiviert. Konfigurationen in Dateien werden von oben nach unten abgearbeitet.

Datei / OrdnerBeschreibung
radiusd.confHauptkonfigurationsdatei des RADIUS-Servers
clients.confRegistrierung der Authenticatoren (Switche)
sites-enabled/defaultVerarbeitung von Auth- und Accounting-Anfragen, EAP-TLS-Tunnelaufbau
sites-enabled/inner-tunnelAustausch der Authentifizierungsdaten im TLS-Tunnel
mods-available/filesAuthentifizierung gegen lokale Nutzerdatei (kein LDAP/SQL)
certs/Speicherort für TLS-Zertifikate
policy.d/Policy-Skripte (z.B. VLAN-Zuweisung per OU)

EAP-TLS Konfiguration

EAP-TLS verwendet clientseitige Zertifikate zur Authentifizierung. Zertifikate müssen vorab unter certs/ abgelegt werden.

sites-enabled/default

server default {
    listen {
        type = auth
        ipaddr = *
        port = 1812
    }
    authorize {
        files
        eap
    }
    authenticate {
        eap
    }
}

mods-enabled/eap

eap {
    default_eap_type = tls
    tls-config tls-common {
        private_key_file = ${certdir}/server.key
        certificate_file = ${certdir}/server.pem
        ca_file          = ${certdir}/ca.pem
        fragment_size    = 1024
        include_length   = yes
    }
    tls { tls = tls-common }
}

clients.conf

client aruba {
    ipaddr = 10.0.10.1
    secret = testing123
}

Supplicant - wpa_supplicant (EAP-TLS)

ctrl_interface=/var/run/wpa_supplicant
ap_scan=0
network={
    key_mgmt=IEEE8021X
    eap=TLS
    identity="radiustest"
    anonymous_identity="anonymous@domain"
    ca_cert="/etc/wpa_supplicant/ca.pem"
    client_cert="/etc/wpa_supplicant/radiustest.pem"
    private_key="/etc/wpa_supplicant/radiustest.key"
    eapol_flags=0
}

EAP-TTLS-PAP Konfiguration

EAP-TTLS-PAP baut einen TLS-Tunnel auf und überträgt Zugangsdaten via PAP. Erfordert den inner-tunnel virtuellen Server.

ttls {
    tls = tls-common
    default_eap_type = pap
    virtual_server = "inner-tunnel"
}
# inner-tunnel
server inner-tunnel {
    authorize { files; pap }
    authenticate {
        Auth-Type PAP { pap }
    }
}

EAP-PEAP-MSCHAPv2 Konfiguration

EAP-PEAP-MSCHAPv2 authentifiziert gegen Active Directory via winbind. MSCHAPv2 läuft im inner-tunnel.

In AD-Umgebungen immer zuerst die Zeitsynchronisation sicherstellen!

peap {
    tls = tls-common
    default_eap_type = mschapv2
    virtual_server = "inner-tunnel"
}
mschapv2 {}

# mschap module
mschap {
    winbind_username = "%{mschap:User-Name}"
    winbind_domain   = "%{mschap:NT-Domain}"
}

MAC Authentication Bypass (MAB)

MAB erlaubt Geräten ohne 802.1X-Supplicant den Netzwerkzugang über ihre MAC-Adresse als Identifier.

authorize {
    if (!EAP-Message) {
        update request {
            User-Name := "%{User-Name}"
        }
    }
    files
    eap
}

Zertifikatserstellung

Alle Zertifikate werden mit ECDSA P-256 erstellt. Der CN des Client-Zertifikats wird bei EAP-TLS als Identifier verwendet.

Root CA

openssl ecparam -name prime256v1 -genkey -noout -out ca.key
openssl req -x509 -new -nodes -key ca.key -sha256 -days 3650 -out ca.pem \
  -subj "/C=DE/ST=State/L=City/O=Org/OU=CA/CN=Org-CA"

Server

openssl ecparam -name prime256v1 -genkey -noout -out server.key
openssl req -new -key server.key -out server.csr \
  -subj "/C=DE/ST=State/L=City/O=Org/OU=RADIUS/CN=radius.org"
openssl x509 -req -in server.csr -CA ca.pem -CAkey ca.key \
  -CAcreateserial -out server.pem -days 1095 -sha256

Client

openssl ecparam -name prime256v1 -genkey -noout -out client.key
openssl req -new -key client.key -out client.csr \
  -subj "/C=DE/ST=State/L=City/O=Org/OU=Users/CN=radiustest"
openssl x509 -req -in client.csr -CA ca.pem -CAkey ca.key \
  -CAcreateserial -out client.pem -days 1095 -sha256

Nutzerkonfiguration

Nutzerdaten, VLAN-Zuweisungen und Firewall-Regeln werden in mods-config/files/authorize definiert.

VLAN-Zuweisung

# EAP-TTLS-PAP (SHA256 password)
radiustest SHA2-Password := 469fa782...
        Tunnel-Type := VLAN,
        Tunnel-Medium-Type := IEEE-802,
        Tunnel-Private-Group-Id := 10

# EAP-TLS (CN matching)
radiustest TLS-Client-Cert-Common-Name := "radiustest@EXAMPLE.CORP"
        Tunnel-Type := VLAN,
        Tunnel-Medium-Type := IEEE-802,
        Tunnel-Private-Group-Id := 10

# MAB
d481d7b536ce Auth-Type := Accept
        Tunnel-Type := VLAN,
        Tunnel-Medium-Type := IEEE-802,
        Tunnel-Private-Group-Id := 10

Firewalling - Aruba AOS-CX

# dictionary
ATTRIBUTE  NAS-Filter-Rule  92  string

# authorize file
radiustest Cleartext-Password := "#radius1!"
        Tunnel-Type := VLAN,
        Tunnel-Medium-Type := IEEE-802,
        Tunnel-Private-Group-Id := 10,
        NAS-Filter-Rule := "permit in tcp from any to any 23",
        NAS-Filter-Rule += "permit in ip from any to 10.10.10.1/24",
        NAS-Filter-Rule += "deny in ip from any to any"

Firewalling - FS PicOS

# dictionary
ATTRIBUTE  Pica8-IP-Downloadable-ACL-Name  3  string
ATTRIBUTE  Pica8-IP-Downloadable-ACL-Rule  2  string

radiustest Cleartext-Password := "#radius1!"
        Tunnel-Type := VLAN,
        Tunnel-Medium-Type := IEEE-802,
        Tunnel-Private-Group-Id := 10,
        Pica8-IP-Downloadable-ACL-Name := "DENY_ICMP",
        Pica8-IP-Downloadable-ACL-Rule := "sequence 10 from protocol icmp ... then action discard",
        Pica8-IP-Downloadable-ACL-Rule += "sequence 20 then action forward"

VLAN Policy für AD

Um VLAN und Nutzerrollen über Active Directory zuzuweisen, wird in policy.d ein Policy-Block eingerichtet und in der jeweiligen post-auth Sektion von default und inner-tunnel angegeben. Die Zuweisung erfolgt dynamisch anhand der Organization Unit (OU), in der ein Nutzer zugeordnet ist.

Beispiel DN:

CN=radiustest,OU=VLAN100,OU=Users,DC=example,DC=org

policy.d/vlan_from_ou

vlan_from_ou {
    if (&control:LDAP-UserDN) {
        update control { Tmp-String-0 := "%{control:LDAP-UserDN}" }
    }
    else {
        ok
        return
    }

    if (&control:Tmp-String-0 =~ /OU=VLAN\s*([0-9]+)/i) {
        update control {
            Tmp-Integer-0 := "%{1}"
        }
    }

    if (&control:Tmp-Integer-0) {
        update reply {
            Tunnel-Type := VLAN
            Tunnel-Medium-Type := IEEE-802
            Tunnel-Private-Group-Id := "%{control:Tmp-Integer-0}"
        }

        update control {
            Tmp-Integer-0 := 0
            Tmp-String-0  := ""
        }
    }
}

Referenzierung in default und inner-tunnel:

post-auth {
    vlan_from_ou
}

Switch-Konfiguration

Aruba AOS-CX

aaa authentication port-access dot1x authenticator enable
aaa authentication port-access mac-auth enable
radius-server host [HOST_IP]
radius-server key [SHARED SECRET]

interface [INTERFACE]
  vlan access [VLAN-ID]
  aaa authentication port-access auth-mode device-mode
  aaa authentication port-access auth-precedence dot1x mac-auth
  aaa authentication port-access dot1x authenticator enable

FS PicOS

set protocols dot1x aaa radius authentication server-ip [IP] port [PORT]
set protocols dot1x aaa radius authentication server-ip [IP] shared-key [KEY]
set protocols dot1x interface ge-1/1/1 auth-mode 802.1x
set protocols dot1x interface ge-1/1/1 auth-mode mac-radius
set protocols dot1x interface ge-1/1/1 host-mode single

Troubleshooting

Bei Access-Reject werden VLAN-Attribute manchmal nicht zurückgesetzt. Dies verhindert man durch explizites Löschen in der post-auth Sektion.

post-auth {
    if (reject) {
        update reply {
            Tunnel-Type !* ANY
            Tunnel-Medium-Type !* ANY
            Tunnel-Private-Group-Id !* ANY
        }
    }
}

Debug-Modus

freeradius -X