tgoop.com/MuhammadAlush0997/1285
Last Update:
◾️لو جهاز حاول يوصَّل نفسه على بورت والسويتش شايف إن الـ MAC Address بتاعه مش موجود في الـ Allowed List أو زيادة عن المسموح بيه، وقتها بيحصل Security Violation.
--
▪️Cisco موفّرة 3 أوضاع (modes) ممكن تختار بينهم:
1. Protect
▪️البورت بيعمل Drop لأي ترافيك جاي من الـ MAC الغير مسموح.
▪️مفيش Log ولا Error Counters ولا تنبيه.
▪️البورت يفضل شغال عادي مع الأجهزة المسموح لها.
2. Restrict
▪️زي Protect بالضبط (Drop للترافيك الغير مسموح).
▪️لكن هنا بيظهر Log (syslog/snmp trap) ويتعدّ Security Violation Counter.
▪️مفيد لو عايز تبقى عارف إن في محاولة اختراق حصلت.
3. Shutdown (الافتراضي)
▪️البورت بيخش في حالة Err-disabled ويتقفل تمامًا.
▪️الترافيك كله (حتى من MACات مسموح بيها) بيتوقف.
▪️محتاج تدخل يدوي (shutdown → no shutdown) أو إعداد auto-recovery علشان البورت يفتح تاني.
--
🔸️عامل Port Security على بورت بـ maximum 1 MAC Address (يعني جهاز واحد فقط).
🔸️لو جهاز تاني اتوصل:
▪️في Mode Shutdown → البورت هيقفل.
▪️في Mode Restrict → هيتم Drop للترافيك وهيجيلك Log.
▪️في Mode Protect → هيتم Drop من غير ما تحس.
--------
Switch(config)# interface fa0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 1
Switch(config-if)# switchport port-security violation shutdown
Switch(config-if)# switchport port-security mac-address sticky
▪️mode access → البورت Access عادي.
▪️port-security → تفعيل الميزة.
▪️maximum 1 → جهاز واحد بس مسموح.
▪️violation shutdown → لو حصل Violation → البورت يتقفل Err-disabled.
▪️mac-address sticky → الجهاز الأول اللي يتوصل بيتسجّل أوتوماتيك كـ allowed.
--
Switch(config)# interface fa0/1
Switch(config-if)# switchport port-security violation protect
أي MAC مش مسموح → الترافيك بيتعمله Drop من غير Logs.
--
Switch(config)# interface fa0/1
Switch(config-if)# switchport port-security violation restrict
▪️Drop للترافيك الغير مسموح.
▪️يظهر Log + يتعدّ Counter (تقدر تشوفه بـ show port-security).
--
4️⃣ وضع Shutdown (الافتراضي)
Switch(config)# interface fa0/1
Switch(config-if)# switchport port-security violation shutdown
▪️البورت يدخل Err-disabled ويتقفل.
▪️محتاج shutdown / no shutdown علشان تفتحه يدويًا.
▪️أو تستخدم Auto-recovery:
Switch(config)# errdisable recovery cause psecure-violation
Switch(config)# errdisable recovery interval 60
---
▪️عرض حالة Port Security للبورت:
▪️Switch# show port-security interface fa0/1
▪️عرض كل الإحصائيات:
Switch# show port-security
www.tgoop.com/MuhammadAlush0997
تابعني على :
Telegram | instagram | facebook | Twitter | YouTube