0%
Profi 75 Minuten Enterprise Security

802.1x mit PacketFence - Teil 2: Dynamische VLAN-Zuweisung & Profiling

Fortgeschrittene 802.1x-Konfiguration mit dynamischer VLAN-Zuweisung, MAC Authentication Bypass und gerätebasierter Zugriffssteuerung.

802.1x mit PacketFence - Teil 2: Dynamische VLAN-Zuweisung & Profiling
Profi
🐧 Debian 12 💻 PacketFence

🎯 Was du lernst

Dynamische VLAN-Zuweisung konfigurieren
MAC Authentication Bypass (MAB) einrichten
Geräte-Profiling mit Fingerbank
Compliance-Checks implementieren
Gast-Zugang mit Sponsor-Funktion

🛒 Empfohlene Produkte

📑 Inhaltsverzeichnis

Anleitung

1. Einleitung

🔐 802.1x mit PacketFence - Teil 2

Fortgeschrittene NAC-Features: VLANs, Profiling & Compliance!

2. 📋 Übersicht

EigenschaftDetails
Zeitaufwand~75 Minuten
Schwierigkeit⭐⭐⭐ Profi
VoraussetzungTeil 1 abgeschlossen
AnwendungsfallEnterprise-Netzwerke

3. 🎯 Was du lernst

4. 📦 Voraussetzungen

5. 🚀 Dynamische VLAN-Zuweisung

6. VLANs pro Rolle konfigurieren

Configuration > Policies and Access Control > Roles:

Rollen definieren:

RolleVLANBeschreibung
employee30Vollzugriff auf Corporate-Netz
guest40Nur Internet, isoliert
iot50IoT-Geräte, eingeschränkt
voip60Telefone, Priorität
quarantine20Isolation bei Problemen

VLAN-Zuweisung:

  1. Edit Role (z.B. “employee”)
  2. VLAN Pool: 30
  3. Max Nodes per PID: 5 (max. 5 Geräte pro User)
  4. Save

7. Role-based Zuweisung testen

Test-Szenario:

  1. Mitarbeiter verbindet Laptop
  2. Authentifiziert sich mit 802.1x
  3. PacketFence weist Rolle “employee” zu
  4. VLAN 30 wird automatisch zugewiesen

Prüfen auf dem Client:

ipconfig /all
# Sollte zeigen: VLAN 30 (192.168.30.x)

8. 🔌 MAC Authentication Bypass (MAB)

9. Was ist MAB?

Für Geräte ohne 802.1x-Support:

10. MAB für Geräte aktivieren

Configuration > Policies and Access Control > Connection Profiles:

  1. wired_mac_auth bearbeiten:

    • Connection Type: Ethernet-NoEAP
    • Sources: Local-RADIUS
    • Filter: mac::normal
  2. Filter-Regel hinzufügen:

# In advanced filter:
connection_type == "Ethernet-NoEAP"

11. Geräte registrieren

Option A: Manuelle Registrierung

Configuration > Nodes:

  1. Add Node
  2. MAC: aa:bb:cc:dd:ee:ff
  3. Status: Registered
  4. Role: iot
  5. Save

Option B: Self-Registration Portal

Configuration > Self Registration:

  1. Enable: Guest self registration
  2. Authentication: SMS oder Email
  3. Access Duration: 1 day (für Gäste)

12. MAC-Auth mit VLAN testen

Drucker anschließen:

  1. Drucker an 802.1x-Port
  2. Keine Benutzer-Authentifizierung
  3. PacketFence erkennt MAC
  4. VLAN 50 (iot) wird zugewiesen

Prüfen:

# Auf PacketFence
/usr/local/pf/bin/pfcmd node view aa:bb:cc:dd:ee:ff

13. 🕵️ Geräte-Profiling

14. Profiling aktivieren

Configuration > Network > Device Profiling:

Fingerprinting aktivieren:

  1. DHCP Fingerprinting:
  2. HTTP User-Agent:
  3. MAC Vendor Lookup:
  4. SNMP OID:

15. Profiling-Regeln

Standard-Profile:

ProfilErkennungAktion
Windows-PCDHCP + User-AgentRolle: employee
iPhoneMAC Vendor (Apple)Rolle: employee
PrinterSNMP OIDRolle: iot
CameraMAC VendorRolle: iot, VLAN 50

Eigenes Profil erstellen:

  1. Configuration > Network > Device Profiling > Add Profile
  2. Name: Company-Printers
  3. Matchers:
    • DHCP Fingerprint: HP Printer
    • MAC Vendor: Hewlett Packard
  4. Action:
    • Role: iot
    • VLAN: 50
  5. Save

16. Unbekannte Geräte behandeln

Configuration > Connection Profiles:

Unknown-Devices Profil:

17. 🛡️ Compliance-Checks

18. Fingerbank Integration

Was ist Fingerbank?

Aktivieren:

  1. Configuration > Fingerbank > General
  2. Enable Fingerbank:
  3. API Key: (kostenlos bei fingerbank.org)
  4. Save

19. Compliance-Profile

Configuration > Compliance > Device Compliance:

Windows-Compliance:

  1. Profile Name: Windows-Update-Check
  2. OS: Windows 10, Windows 11
  3. Checks:
    • ✅ Windows Updates (nicht älter als 30 Tage)
    • ✅ Antivirus aktiv
    • ✅ Firewall aktiv
  4. Nicht konform: VLAN 20 (Quarantäne)

Implementierung:

# Compliance-Regel
if ($os == "Windows 10") {
    if ($windows_update > 30_days) {
        return "non_compliant";
        $vlan = 20;
    }
}

20. Remediation Portal

Nicht-konforme Geräte:

  1. Werden in VLAN 20 (Quarantäne) gesperrt
  2. Sehen ein Remediation Portal
  3. Anweisungen zur Behebung
  4. Nach Fix: Automatische Freigabe

Portal anpassen: Configuration > Connection Profiles > Quarantine:

21. 👥 Gast-Zugang mit Sponsor

22. Sponsor-Funktion aktivieren

Configuration > Self Registration > Sponsors:

  1. Enable Sponsorship:
  2. Sponsor Email Domain: @company.de
  3. Access Duration: 1 day
  4. Max Devices: 2

23. Gast-Workflow

Ablauf:

  1. Gast verbindet sich
  2. Öffnet Browser → Sponsor-Portal
  3. Trägt eigenen Namen + Email ein
  4. Trägt Sponsor-Email ein (Mitarbeiter)
  5. Mitarbeiter bekommt Email → Bestätigt
  6. Gast hat Zugriff für 24h

Portal-Text anpassen:

<h1>Willkommen bei Company Guest WiFi</h1>
<p>Bitte geben Sie Ihre Daten und die Email eines Mitarbeiters ein.</p>

24. 📊 Reporting & Monitoring

25. Dashboard anpassen

Status > Dashboard:

Widgets hinzufügen:

26. Reports erstellen

Reports > Standard Reports:

Benutzerdefinierter Report:

  1. Name: “Monthly Device Audit”
  2. Query:
SELECT 
    pid as username,
    COUNT(*) as device_count,
    role,
    DATE(last_seen) as last_seen
FROM node
WHERE status = 'registered'
GROUP BY pid
ORDER BY device_count DESC;
  1. Schedule: Monthly
  2. Email: admin@company.de

27. Alerts konfigurieren

Configuration > Alerting:

Security-Alerts:

28. 🔧 Troubleshooting

29. Gerät landet immer in Quarantäne

# Fingerbank-Daten prüfen
/usr/local/pf/bin/pfcmd fingerbank lookup aa:bb:cc:dd:ee:ff

# Device-Profil zuweisen
/usr/local/pf/bin/pfcmd node edit aa:bb:cc:dd:ee:ff category=iot

30. VLAN wird nicht zugewiesen

# RADIUS-Debug aktivieren
tail -f /usr/local/pf/logs/radius.log | grep VLAN

31. Compliance-Check funktioniert nicht

32. 🎓 Best Practices

  1. MAC-Auth nur für IoT (nicht für Laptops)
  2. Rolle “guest” stark einschränken (nur Internet)
  3. Compliance-Checks regelmäßig reviewen
  4. Monitoring auf Unauthorized Devices
  5. Backup der PacketFence-Config (automatisieren)

33. 🔗 Integrationen

Weitere Features:


Das war’s! Dein Enterprise-NAC ist jetzt vollständig. 🎉

Fragen? Schreib uns auf Instagram!

Das könnte dich auch interessieren

✅ Geschafft!

Du hast dieses Tutorial abgeschlossen. Hast du Fragen oder Probleme?

Schreib uns auf Instagram

Alle Tutorials ansehen