{
    "id": "215da1cf-6cd7-465e-9112-2d8209688f43",
    "name": "Port-Security",
    "slug": "port-security",
    "status": "published",
    "lab_type": "pta",
    "is_sample": false,
    "duration_in_seconds": 1800,
    "metadata": {
        "courses": [
            "efd8a55d-28c5-4fcd-8b42-cfdafb1f085f",
            "ea7137a5-4449-4861-8061-5c9e054d79ab",
            "f6ac45c3-fa73-49e5-a56a-0be38f64aee5"
        ],
        "pta_sdn": "294",
        "collections": [],
        "pta_namespace": "my.ine",
        "learning_paths": [],
        "has_published_parent": true
    },
    "session": null,
    "company": "a491bc32-c056-4946-9169-cc053387bada",
    "created": "2022-08-02T16:01:36.180609Z",
    "modified": "2024-05-17T14:46:02.411512Z",
    "is_beta": false,
    "lab_objectives": [],
    "main_learning_area": "e73fd5a8-2ead-4159-9a25-38b50ad4ab20",
    "learning_areas": [
        {
            "id": "e73fd5a8-2ead-4159-9a25-38b50ad4ab20",
            "name": "Networking",
            "slug": "networking"
        }
    ],
    "categories": [],
    "tags": [],
    "difficulty": null,
    "is_web_access": false,
    "is_lab_experience": false,
    "is_featured": false,
    "cve": null,
    "severity": null,
    "year": null,
    "external_url": "",
    "solution_video": null,
    "explanation_video": null,
    "description": "The lab teaches how to restrict network access using port security on a switch. It includes steps to allow only authorized MAC addresses and shut down unauthorized ones.",
    "description_html": "<p>The lab teaches how to restrict network access using port security on a switch. It includes steps to allow only authorized MAC addresses and shut down unauthorized ones.</p>",
    "tasks": "![description](https://assets.ine.com/content/labs/networking-labs/Task1-9/diagram.png)\n\n\n**Helpful Hints about INE\u2019s virtual lab environment:**\n\n- Save your configuration changes frequently in the event that you get locked out of a device or lose connectivity\n- If you are suddenly logged out of the GNS3 lab environment and log back in again, you may see the prompt, \u201cAnother GNS3 instance is running, continue? (Y/N)\u201d.  Select \u201cYes\u201d\n- If you ever lose console access to one (or more) of your devices you will need to reboot the Ubuntu Virtual Machine that is hosting your GNS3 lab environment.  To do this,\n    - Minimize your GNS3 window\n    - Open the \u201cTerminal\u201d app within the Ubuntu device\n\n    ![description](https://assets.ine.com/content/labs/networking-labs/Task1-9/terminal.png)\n\n    - Type \u201creboot\u201d within the Terminal window\n    - Wait 20-30 seconds and then click the \u201cReconnect\u201d option to log back in.\n\n\n**Task: Limiting Network Access With Port Security**\n\n1. Configure Sw2 to allow only one MAC address on its interfaces connected to R2 and R4.\n\n2. Use a command on router R2 to determine the MAC address of its Gig0/1 interface and then configure Port Security to pre-authorize that MAC address on Sw2's Gig0/1 interface.\n\n3. Ensure that interfaces Gig0/1 on R2 and R4 are administratively up.\n\n4. Configure Port Security on Sw2 such that dynamically learned MAC addresses on its Gig0/0 interface, look like a static MAC entries in the output of the command \"show running-config\".\n\n5. Configure Port Security on Sw2 to shut down its port if an unauthorized MAC is learned on a secure port.\n\n6. Test your Port Security configuration by manually changing the MAC addresses of interface Gig0/1 on routers R2 and R4 to see how Sw2 responds.",
    "tasks_html": "<p><img alt=\"description\" src=\"https://assets.ine.com/content/labs/networking-labs/Task1-9/diagram.png\" /></p>\n<p><strong>Helpful Hints about INE\u2019s virtual lab environment:</strong></p>\n<ul>\n<li>Save your configuration changes frequently in the event that you get locked out of a device or lose connectivity</li>\n<li>If you are suddenly logged out of the GNS3 lab environment and log back in again, you may see the prompt, \u201cAnother GNS3 instance is running, continue? (Y/N)\u201d.  Select \u201cYes\u201d</li>\n<li>\n<p>If you ever lose console access to one (or more) of your devices you will need to reboot the Ubuntu Virtual Machine that is hosting your GNS3 lab environment.  To do this,</p>\n<ul>\n<li>Minimize your GNS3 window</li>\n<li>Open the \u201cTerminal\u201d app within the Ubuntu device</li>\n</ul>\n<p><img alt=\"description\" src=\"https://assets.ine.com/content/labs/networking-labs/Task1-9/terminal.png\" /></p>\n<ul>\n<li>Type \u201creboot\u201d within the Terminal window</li>\n<li>Wait 20-30 seconds and then click the \u201cReconnect\u201d option to log back in.</li>\n</ul>\n</li>\n</ul>\n<p><strong>Task: Limiting Network Access With Port Security</strong></p>\n<ol>\n<li>\n<p>Configure Sw2 to allow only one MAC address on its interfaces connected to R2 and R4.</p>\n</li>\n<li>\n<p>Use a command on router R2 to determine the MAC address of its Gig0/1 interface and then configure Port Security to pre-authorize that MAC address on Sw2's Gig0/1 interface.</p>\n</li>\n<li>\n<p>Ensure that interfaces Gig0/1 on R2 and R4 are administratively up.</p>\n</li>\n<li>\n<p>Configure Port Security on Sw2 such that dynamically learned MAC addresses on its Gig0/0 interface, look like a static MAC entries in the output of the command \"show running-config\".</p>\n</li>\n<li>\n<p>Configure Port Security on Sw2 to shut down its port if an unauthorized MAC is learned on a secure port.</p>\n</li>\n<li>\n<p>Test your Port Security configuration by manually changing the MAC addresses of interface Gig0/1 on routers R2 and R4 to see how Sw2 responds.</p>\n</li>\n</ol>",
    "published_date": "2019-10-15T18:00:00Z",
    "solutions": "**Solutions:**\n\nTo limit number of MAC addresses on a Cisco switchport, we can apply a port security mechanism that prevents any unauthorized host from connecting to the switch. In this particular task, we are asked to perform two types of port security configuration. The first task asks us to configure a static MAC entry for port security, and the second task asks us to configure **sticky MAC address** configuration. A sticky MAC entry can be considered as a static MAC address binding by the switch, which converts the dynamically learned MAC address to a static mac configuration.\n\nFirst we need to discover the mac address of interface Gig0/1 on router R2.  This can be done using a couple of methods but what we'll do is log into this router and issue the command, \"***show interface***\". Below is an example of this:\n\n<pre><code>\n    Router#<b>show interface gig0/1</b>        \n    GigabitEthernet0/1 is administratively down, line protocol is down\n      Hardware is iGbE, address is <b>0c1e.d91b.0001</b> (bia 0c1e.d91b.0001)\n</pre></code>\n\nNow we'll configure Switch-2 for Port Security:\n\n<pre><code>\nSw2:\ninterface Gig0/1\n switchport port-security\n switchport port-security maximum 1 --> <b>This is the default value so technically you don't have to configure it.</b>\n switchport port-security violation shutdown\n <b>switchport port-security mac-address 0c1e.d91b.0001</b>\n!\ninterface Gig0/0\n switchport port-security\n switchport port-security maximum 1\n switchport port-security violation shutdown\n <b>switchport port-security mac-address sticky</b>\n</pre></code>\n\n***Verification***\n\nFirst, verify port-security in the interface.\n\n<pre><code>\n    Sw2#<b>show port-security interface gig0/1</b>\n    <b>Port Security              : Enabled</b>\n    Port Status                : Secure-up\n    Violation Mode             : Shutdown\n    Aging Time                 : 0 mins\n    Aging Type                 : Absolute\n    SecureStatic Address Aging : Disabled\n    Maximum MAC Addresses      : 1\n    Total MAC Addresses        : 1\n    <b>Configured MAC Addresses   : 1</b>\n    Sticky MAC Addresses       : 0\n    <b>Last Source Address:Vlan   : 0c1e.d91b.0001:100</b>\n    Security Violation Count   : 0\n\n    Sw2#\n    Sw2#<b>show port-security interface gig0/0</b>\n    <b>Port Security              : Enabled</b>\n    Port Status                : Secure-up\n    Violation Mode             : Shutdown\n    Aging Time                 : 0 mins\n    Aging Type                 : Absolute\n    SecureStatic Address Aging : Disabled\n    Maximum MAC Addresses      : 1\n    Total MAC Addresses        : 1\n    Configured MAC Addresses   : 0\n    <b>Sticky MAC Addresses       : 1</b>\n    <b>Last Source Address:Vlan   : 0cfd.7d9b.0001:300</b>\n    Security Violation Count   : 0\n\n    !\n    Sw2#show port-security\n    Secure Port  MaxSecureAddr  CurrentAddr  SecurityViolation  Security Action\n                    (Count)       (Count)          (Count)\n    ---------------------------------------------------------------------------\n          Gig0/1              1            1                  0         Shutdown\n          Gig0/0              1            1                  0         Shutdown\n    ---------------------------------------------------------------------------\n    Total Addresses in System (excluding one mac per port)     : 0\n    Max Addresses limit in System (excluding one mac per port) : 5120\n</pre></code>\n\nIn the above output, we can see the configured parameters of port security. The violation mode is \"shutdown\" and the Maximum MAC address is up to 1 by default.\n\nNow configure the Gig0/1 interfaces of R1 and R4 with some different MAC address.\n\n<pre><code>\n    R2:\n    interface Gig0/1\n     <b>mac-address 1234.1234.1234</b>\n    !\n    R4\n    interface Gig0/1\n     <b>mac-address 1234.1234.1234</b>\n</pre></code>\n\nThe Gig0/1 and Gig0/0 interfaces on Sw2 have gone to the \"err-disable\" state because of port security violation. Take a look at the log messages.\n\n<pre><code>\n    Sw2#\n    *Mar  8 15:16:55.346: %PM-4-ERR_DISABLE: <b>psecure-violation error detected on Gig0/1,     putting Gig0/1 in err-disable state</b>\n    *Mar  8 15:16:55.354: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred,     caused by MAC address 1234.1234.1234 on port GigabitEthernet0/1.\n    *Mar  8 15:16:56.346: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1,     changed state to down\n    *Mar  8 15:16:57.354: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to down\n    !\n    *Mar  8 15:19:01.894: %PM-4-ERR_DISABLE: <b>psecure-violation error detected on Gig0/0,     putting Gig0/0 in err-disable state</b>\n    *Mar  8 15:19:01.898: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred,     caused by MAC address 1234.1234.1234 on port GigabitEthernet0/0.\n    *Mar  8 15:19:02.894: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0,     changed state to down\n    *Mar  8 15:19:03.898: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to down\n\n    Sw2#<b>show port-security interface Gig0/1</b>\n    Port Security              : Enabled\n    <b>Port Status                : Secure-shutdown</b>\n    Violation Mode             : Shutdown\n    Aging Time                 : 0 mins\n    Aging Type                 : Absolute\n    SecureStatic Address Aging : Disabled\n    Maximum MAC Addresses      : 1\n    Total MAC Addresses        : 1\n    Configured MAC Addresses   : 1\n    Sticky MAC Addresses       : 0\n    Last Source Address:Vlan   : 1234.1234.1234:100\n    Security Violation Count   : 1\n    !\n    Sw2#<b>show port-security interface Gig0/0</b>\n    Port Security              : Enabled\n    <b>Port Status                : Secure-shutdown</b>\n    Violation Mode             : Shutdown\n    Aging Time                 : 0 mins\n    Aging Type                 : Absolute\n    SecureStatic Address Aging : Disabled\n    Maximum MAC Addresses      : 1\n    Total MAC Addresses        : 1\n    Configured MAC Addresses   : 0\n    Sticky MAC Addresses       : 1\n    Last Source Address:Vlan   : 1234.1234.1234:300\n    Security Violation Count   : 1\n    !\n    Sw2#<b>show port-security</b>\n    Secure Port  MaxSecureAddr  CurrentAddr  SecurityViolation  Security Action\n                    (Count)       (Count)          (Count)\n    ---------------------------------------------------------------------------\n          Gig0/1              1            1                 <b>1</b>         Shutdown\n          Gig0/0              1            1                  <b>1</b>         Shutdown\n    ---------------------------------------------------------------------------\n    Total Addresses in System (excluding one mac per port)     : 0\n    Max Addresses limit in System (excluding one mac per port) : 5120\n</pre></code>\n\nOptionally, we can tell the switchport not to shut the ports down, but rather, just restrict or protect the ports which prevents unauthorized access without shutting the ports down. The restrict mode also sends an SNMP trap if an unauthorized MAC address is seen on the secure port.",
    "solutions_html": "<p><strong>Solutions:</strong></p>\n<p>To limit number of MAC addresses on a Cisco switchport, we can apply a port security mechanism that prevents any unauthorized host from connecting to the switch. In this particular task, we are asked to perform two types of port security configuration. The first task asks us to configure a static MAC entry for port security, and the second task asks us to configure <strong>sticky MAC address</strong> configuration. A sticky MAC entry can be considered as a static MAC address binding by the switch, which converts the dynamically learned MAC address to a static mac configuration.</p>\n<p>First we need to discover the mac address of interface Gig0/1 on router R2.  This can be done using a couple of methods but what we'll do is log into this router and issue the command, \"<strong><em>show interface</em></strong>\". Below is an example of this:</p>\n<pre><code>\n    Router#<b>show interface gig0/1</b>        \n    GigabitEthernet0/1 is administratively down, line protocol is down\n      Hardware is iGbE, address is <b>0c1e.d91b.0001</b> (bia 0c1e.d91b.0001)\n</pre>\n\n<p></code></p>\n<p>Now we'll configure Switch-2 for Port Security:</p>\n<pre><code>\nSw2:\ninterface Gig0/1\n switchport port-security\n switchport port-security maximum 1 --> <b>This is the default value so technically you don't have to configure it.</b>\n switchport port-security violation shutdown\n <b>switchport port-security mac-address 0c1e.d91b.0001</b>\n!\ninterface Gig0/0\n switchport port-security\n switchport port-security maximum 1\n switchport port-security violation shutdown\n <b>switchport port-security mac-address sticky</b>\n</pre>\n\n<p></code></p>\n<p><strong><em>Verification</em></strong></p>\n<p>First, verify port-security in the interface.</p>\n<pre><code>\n    Sw2#<b>show port-security interface gig0/1</b>\n    <b>Port Security              : Enabled</b>\n    Port Status                : Secure-up\n    Violation Mode             : Shutdown\n    Aging Time                 : 0 mins\n    Aging Type                 : Absolute\n    SecureStatic Address Aging : Disabled\n    Maximum MAC Addresses      : 1\n    Total MAC Addresses        : 1\n    <b>Configured MAC Addresses   : 1</b>\n    Sticky MAC Addresses       : 0\n    <b>Last Source Address:Vlan   : 0c1e.d91b.0001:100</b>\n    Security Violation Count   : 0\n\n    Sw2#\n    Sw2#<b>show port-security interface gig0/0</b>\n    <b>Port Security              : Enabled</b>\n    Port Status                : Secure-up\n    Violation Mode             : Shutdown\n    Aging Time                 : 0 mins\n    Aging Type                 : Absolute\n    SecureStatic Address Aging : Disabled\n    Maximum MAC Addresses      : 1\n    Total MAC Addresses        : 1\n    Configured MAC Addresses   : 0\n    <b>Sticky MAC Addresses       : 1</b>\n    <b>Last Source Address:Vlan   : 0cfd.7d9b.0001:300</b>\n    Security Violation Count   : 0\n\n    !\n    Sw2#show port-security\n    Secure Port  MaxSecureAddr  CurrentAddr  SecurityViolation  Security Action\n                    (Count)       (Count)          (Count)\n    ---------------------------------------------------------------------------\n          Gig0/1              1            1                  0         Shutdown\n          Gig0/0              1            1                  0         Shutdown\n    ---------------------------------------------------------------------------\n    Total Addresses in System (excluding one mac per port)     : 0\n    Max Addresses limit in System (excluding one mac per port) : 5120\n</pre>\n\n<p></code></p>\n<p>In the above output, we can see the configured parameters of port security. The violation mode is \"shutdown\" and the Maximum MAC address is up to 1 by default.</p>\n<p>Now configure the Gig0/1 interfaces of R1 and R4 with some different MAC address.</p>\n<pre><code>\n    R2:\n    interface Gig0/1\n     <b>mac-address 1234.1234.1234</b>\n    !\n    R4\n    interface Gig0/1\n     <b>mac-address 1234.1234.1234</b>\n</pre>\n\n<p></code></p>\n<p>The Gig0/1 and Gig0/0 interfaces on Sw2 have gone to the \"err-disable\" state because of port security violation. Take a look at the log messages.</p>\n<pre><code>\n    Sw2#\n    *Mar  8 15:16:55.346: %PM-4-ERR_DISABLE: <b>psecure-violation error detected on Gig0/1,     putting Gig0/1 in err-disable state</b>\n    *Mar  8 15:16:55.354: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred,     caused by MAC address 1234.1234.1234 on port GigabitEthernet0/1.\n    *Mar  8 15:16:56.346: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1,     changed state to down\n    *Mar  8 15:16:57.354: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to down\n    !\n    *Mar  8 15:19:01.894: %PM-4-ERR_DISABLE: <b>psecure-violation error detected on Gig0/0,     putting Gig0/0 in err-disable state</b>\n    *Mar  8 15:19:01.898: %PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred,     caused by MAC address 1234.1234.1234 on port GigabitEthernet0/0.\n    *Mar  8 15:19:02.894: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0,     changed state to down\n    *Mar  8 15:19:03.898: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to down\n\n    Sw2#<b>show port-security interface Gig0/1</b>\n    Port Security              : Enabled\n    <b>Port Status                : Secure-shutdown</b>\n    Violation Mode             : Shutdown\n    Aging Time                 : 0 mins\n    Aging Type                 : Absolute\n    SecureStatic Address Aging : Disabled\n    Maximum MAC Addresses      : 1\n    Total MAC Addresses        : 1\n    Configured MAC Addresses   : 1\n    Sticky MAC Addresses       : 0\n    Last Source Address:Vlan   : 1234.1234.1234:100\n    Security Violation Count   : 1\n    !\n    Sw2#<b>show port-security interface Gig0/0</b>\n    Port Security              : Enabled\n    <b>Port Status                : Secure-shutdown</b>\n    Violation Mode             : Shutdown\n    Aging Time                 : 0 mins\n    Aging Type                 : Absolute\n    SecureStatic Address Aging : Disabled\n    Maximum MAC Addresses      : 1\n    Total MAC Addresses        : 1\n    Configured MAC Addresses   : 0\n    Sticky MAC Addresses       : 1\n    Last Source Address:Vlan   : 1234.1234.1234:300\n    Security Violation Count   : 1\n    !\n    Sw2#<b>show port-security</b>\n    Secure Port  MaxSecureAddr  CurrentAddr  SecurityViolation  Security Action\n                    (Count)       (Count)          (Count)\n    ---------------------------------------------------------------------------\n          Gig0/1              1            1                 <b>1</b>         Shutdown\n          Gig0/0              1            1                  <b>1</b>         Shutdown\n    ---------------------------------------------------------------------------\n    Total Addresses in System (excluding one mac per port)     : 0\n    Max Addresses limit in System (excluding one mac per port) : 5120\n</pre>\n\n<p></code></p>\n<p>Optionally, we can tell the switchport not to shut the ports down, but rather, just restrict or protect the ports which prevents unauthorized access without shutting the ports down. The restrict mode also sends an SNMP trap if an unauthorized MAC address is seen on the secure port.</p>",
    "flags": [],
    "min_points_to_pass": null,
    "access_type": "default",
    "user_status": "unstarted",
    "user_lab_status": null,
    "user_status_modified": null,
    "user_flags": [],
    "global_running_session": null
}