Yes, the restrict and protect modes can be violated any number of times without shutting down the port since they are not designed to do that; they will drop packets with unknown source addresses:
See Configuring the Port Security Violation Mode on a Port on page 62-6:
- protect—Drops packets with unknown source addresses until you remove a sufficient number of secure MAC addresses to drop below the
maximum value.
- restrict—Drops packets with unknown source addresses until you remove a sufficient number of secure MAC addresses to drop below the
maximum value and causes the SecurityViolation counter to increment.
- shutdown—Puts the interface into the error-disabled state immediately and sends an SNMP trap notification.
That's a lot of questions, so let's take them one by one.
What exactly is 802.1X Port-Based Authentication?
From Wikipedia :
IEEE 802.1X is an IEEE Standard for port-based Network Access Control
(PNAC). It is part of the IEEE 802.1 group of networking protocols. It
provides an authentication mechanism to devices wishing to attach to a
LAN or WLAN.
In other words, it is a mechanism used in (mostly) switches and wireless access-points to allow or block devices to access the network (or granularly allow access to parts of it).
For example if you have a network port in a meeting room, you can enable 802.1x on the switchport and configure it in such a way that when an employee connects she has access to the entire network but if a guest connects (with a temporary password) he can only reach the Internet and if a passer-by is tempted to try his luck, he cannot access anything at all.
Doesn't it also use RADIUS as it's underlying authentication mechanism?
Yes and no. 802.1x uses Extensible Authentication Protocol (EAP), and the wikipedia article about 802.1x has this nice drawing that shows that for wired 802.1x:
- EAP over LAN (EAPoL) is used between the Supplicant (software on your laptop) and the Authenticator (switch)
- EAP is then usually tunnelled over Radius between the Authenticator and the Authentication Server, but it can also be done over Diameter (the successor to Radius)
For wireless it is similar in the sense that there is also no Radius between the supplicant and the authenticator, only between the authenticator and the auth server (to tunnel the EAP).
Now the Extensible in EAP's name is very true, there are dozens of EAP protocols that you can choose from, some will use passwords, others certificates or both, etc. etc.
What are their differences?
Well, it's a bit like comparing apples and oranges.
Dot1x is not really a protocol but more a framework in which protocols like EAPoL and Radius are used.
Simplified (maybe over-simplified?) you could say:
- Radius is typically used as a 'simple' authentication method to control who can login to a router (or other device), or who can connect using a VPN client. Sometimes also for authorization, e.g. to determine the privilege-level when you log in to a router, or to push a dynamic access-list for a vpn user.
- Dot1x is typically used to control access to switchports and wifi.
And if we can somehow compare them, which one is more secure?
I don't believe (but anyone please correct me) that there are scenarios where you can choose between one or the other. It may make miore sense to compare Radius and EAP, to some extent.
Some things to consider:
- EAP is end-to-end while Radius is only used between the Authenticator and the Authentication Server and so you need to make sure that the part between the client and the Authenticator is also secured; e.g. use SSH instead of telnet to log in to your router.
- similarly some (but not all) EAP methods can be used for mutual authentication (between the supplicant and the authentication server!), in the Radius case it depends again on what protocol is used between client and authenticator.
- EAP is as secure as the EAP method you select (e.g. LEAP or EAP-MD5 are weak)
Best Answer
The command
errdisable recovery interval 300
helps to re-enable a err-disabled port automatically.Generally, it means that a port ,which is currently in error-disable state for a specific reason (including port-security violation), will be automatically re-enabled after 300 seconds. You can choose which kind of reason/cause that will re-activate the port back with
errdisable recovery cause
command (you can check further information on this Cisco page).The command
switchport port-security aging time 2
can be used when configuring port-security feature on a switch port.If you do not choose aging type (absolute or inactivity), the default method of absolute is taken into account, meaning after 2 minutes the dynamically learned MAC address ages out. You can connect another host to a switch port.
On the other hand, if you choose the aging type as inactivity
switchport port-security aging type inactivity
, the dynamically learned MAC address ages out ONLY after 2 minutes of MAC address inactivity (no frame/packet sent from the host with this MAC address).This kind of command tells you when (after X minutes) you can connect a host to a port, once the old MAC address ages out (absolute or inactivity).