Jeremy's IT Lab
Day 49 LabSecurity

Port Security

17m4 chapters44 cues5 cards1 lab
Day 49 LabYT: zZwhrxKeGj8
00:00 / 17:03

Synchronized Transcript

44 cues indexed • Click dialogue or words to jump
Jeremy

Welcome to Jeremy’s IT Lab. This is a free, complete course for the CCNA. If you like these videos, please subscribe to follow along with the series.

Jeremy

Also, please like and leave a comment, and share the video to help spread this free series of videos. Thanks for your help. If you want more labs like this, I highly recommend Boson Software’s NetSim for CCNA.

Jeremy

NetSim is a network simulator like Packet Tracer, but it’s far more powerful and contains over 100 detailed guided labs covering the CCNA exam topics.

Jeremy

If you want to get NetSim, follow the link in the description. In this video we’ll configure port security on SW1 and SW2. We’ll configure it on SW1’s interfaces connected to the PCs, and on SW2’s G0/1 interface, connected to SW1.

Jeremy

Some of the commands I introduced in the lecture video aren’t supported in packet tracer, but the most important ones are. So, first let’s configure SW1.

Jeremy

On the F0/1, 2, and 3 interfaces we’ll enable port security with the shutdown violation mode, 1 MAC address allowed, sticky learning disabled, and an aging time of 1 hour.

Jeremy

ENABLE. CONF T. The port security configuration of each interface will be the same, so let’s do INTERFACE RANGE F0/1 – 3.

Jeremy

By default, the violation mode is shutdown, and the maximum number of MAC addresses allowed is also 1. Sticky MAC address learning is also disabled by default, so we don’t have to configure any of those.

Jeremy

Let’s just set the aging time to 1 hour. With the default time of 0 minutes, secure MAC addresses will never age out. SWITCHPORT PORT-SECURITY AGING TIME, and then enter the time in minutes, 60.

Jeremy

Now, port security itself isn’t actually enabled yet, so I’ll enable it. SWITCHPORT PORT-SECURITY. But the command is rejected, a common mistake when configuring port security.

Jeremy

These interfaces have the default administrative mode of DYNAMIC AUTO. Let’s check one of them. DO SHOW INTERFACES F0/1 SWITCHPORT.

Jeremy

Up here you can see it, administrative mode dynamic auto. To enable port security, the interface must be manually configured as an access port or trunk port.

Jeremy

So, SWITCHPORT MODE ACCESS. Now let’s try again. SWITCHPORT PORT-SECURITY. Okay, it should be enabled.

Jeremy

I’ll check one of the interfaces. DO SHOW PORT-SECURITY INTERFACE F0/1. Okay, port security is enabled and the default setting of the violation mode is shutdown.

Jeremy

The aging time of 60 minutes I configured is shown here. That’s all we need to configure on SW1. So let’s move on to SW2.

Jeremy

We’ll configure port security on G0/1 with the Restrict violation mode, a maximum of 4 addresses, and sticky MAC address learning enabled.

Jeremy

Why 4 addresses, even though there are only 3 PCs in the network currently? It’s because SW2 will be receiving CDP messages from SW1, so it will learn SW1’s MAC address too.

Jeremy

Okay, let’s configure it. ENABLE. CONF T. INTERFACE G0/1. The default port security violation mode is shutdown, so let’s configure restrict mode.

Jeremy

SWITCHPORT PORT-SECURITY VIOLATION RESTRICT. And then the maximum number of addresses. SWITCHPORT PORT-SECURITY MAXIMUM 4.

Jeremy

And then enable sticky MAC address learning. SWITCHPORT PORT-SECURITY MAC-ADDRESS STICKY. Finally let’s enable port security.

Jeremy

There is only 1 VLAN in the network, VLAN 1, so I’ll just configure G0/1 as an access port, although trunk is an option too. SWITCHPORT MODE ACCESS.

Jeremy

Now I’ll enable port security. SWITCHPORT PORT-SECURITY. Okay, let’s check those settings. DO SHOW PORT-SECURITY INTERFACE G0/1.

Jeremy

Okay, port security is enabled, the violation mode is restrict, and the maximum number of addresses is 4. As for sticky learning, we’ll test that now.

Jeremy

I’ll ping from each PC to R1 so that SW1 and SW2 can learn their MAC addresses. PC1 first.

Jeremy

PING 10.0.0.254. Okay, then PC2.

Jeremy

PING 10.0.0.254. And finally PC3. PING 10.0.0.254.

Jeremy

Okay, now let’s check on SW2. DO SHOW PORT-SECURITY INTERFACE G0/1.

Jeremy

So, the total MAC addresses learned is 4, PCs 1, 2, 3, and SW1. And all 4 of those MAC addresses are sticky.

Jeremy

Let’s check the config of G0/1. DO SHOW RUN. Scroll down to G0/1, and here we can see the MAC addresses of PC1, PC2, PC3, and this one here must be SW1.

Jeremy

And let’s check the MAC address table. DO SHOW MAC ADDRESS-TABLE. Okay, there are the same 4 MAC addresses. Notice the type of STATIC, even though they were dynamically learned.

Jeremy

That’s because of sticky learning. And one more command, DO SHOW PORT-SECURITY. So, G0/1 has a maximum of 4 secure MAC addresses, it currently has learned 4, there are 0 security violations, and the security action

Jeremy

is restrict. Now let’s trigger some violations and see what happens. First, I’ll trigger a violation on SW2. To do that, I’ll go on SW1 and configure the VLAN 1 SVI.

Jeremy

INTERFACE VLAN1. IP ADDRESS 10.0.0.10 255.255.255.0. NO SHUTDOWN.

Jeremy

Okay, so if SW1 tries to ping R1, the source MAC address will be the MAC address of the VLAN 1 SVI. SW2 learned the MAC address of SW1’s G0/1 interface, but it doesn’t know the MAC address of the VLAN 1 SVI.

Jeremy

So let’s try that ping. DO PING 10.0.0.254. Okay, the ping isn’t working. That’s because SW2 is blocking the pings because of the unauthorized source MAC address.

Jeremy

Let’s check on SW2. DO SHOW PORT-SECURITY INTERFACE G0/1. Okay, notice the port status is still secure-up, but the violation counter has been incremented.

Jeremy

There haven’t been any syslog messages, that might be an issue with packet tracer. By default, a syslog message should be displayed in the console.

Jeremy

Anyway, that’s the restrict mode. Now let’s trigger a violation on SW1. To do that, I’ll change the MAC address of PC1.

Jeremy

To do that in packet tracer, go to the config tab of PC1, click on FastEthernet0, and then change the MAC address here.

Jeremy

I’ll change the last ‘1’ to an ‘A’. And let’s try to ping R1. PING 10.0.0.254. Okay, it doesn’t work this time.

Jeremy

Let’s take a look on SW1. Okay, here syslog messages have been shown for the F0/1 interface being shutdown, but no actual port security related syslog messages.

Jeremy

Anyway, let’s check the interface. DO SHOW PORT-SECURITY INTERFACE F0/1. Okay, the state is secure-shutdown, and the security violation count is 1.

Jeremy

Now, errdisable recovery isn’t available in packet tracer so if you want to re-enable the interface, you’ll need to do it manually. Anyway, in this lab we did some basic port security configurations and observed how the shutdown and restrict violation modes work.

Jeremy

That’s all for this lab. Next, let’s take a look at a bonus lab in Boson Software’s NetSim for CCNA.

Keyboard shortcuts

Shortcuts are ignored while you are typing in a search box, note field, or the scratchpad.

Playback

SpaceK
Play or pause
←→
Seek 5 seconds
JL
Seek 10 seconds
C
Toggle in-video captions

Scrubber (when focused)

←→
Seek 5 seconds
Shift←/→
Seek 10 seconds
Page UpPage Down
Seek 30 seconds
HomeEnd
Jump to start or end

Flashcards

Space
Reveal the answer
1234
Grade Again / Hard / Good / Easy

Navigation

←→
Move between study-mode tabs
HomeEnd
First or last study-mode tab
?
Open or close this sheet