========================
Cisco Catalyst C1000
========================

--------------------
Overview
--------------------


Device model: C1000-8T-2G-L

Tested: November 2025

Software: IOS 15.2 [#]_

Software: :abbr:`IOS 15.2 ((Cisco IOS Software, C1000 Software (C1000-UNIVERSALK9-M), Version 15.2(7)E1, RELEASE SOFTWARE (fc4)))`

.. Tu są do wyboru dwie wersje przedstawienia dokładnej wersji systemu - przypis albo tooltip

.. .. _docs_link: https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst1000/software/releases/15_2_7_e/configuration_guides/sec/b_1527e_security_c1000_cg.html

`Security guide, IOS 15.2 <https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst1000/software/releases/15_2_7_e/configuration_guides/sec/b_1527e_security_c1000_cg.html>`_

Definitions of terms used are given :doc:`here <../glossary>` in the glossary.

:term:`RADIUS_KEY <RADIUS secret key>`

:abbr:`RADIUS_KEY (RADIUS secret key for communication with NACVIEW.)`


----------------------------
RADIUS client
----------------------------


..      .. code-block:: bash

         C1000#configure terminal
         C1000(config)#aaa new-model
         C1000(config)#radius-server vsa send authentication
         C1000(config)#radius-server vsa send accounting
         C1000(config)#aaa group server radius 'RADIUS_GROUP'
         C1000(config-sg-radius)#server-private NACVIEW_SER auth-port 1812 acct-port 1813 key RADIUS_KEY
         C1000(config-sg-radius)#ip radius source-interface MGMT_INT
         C1000(config-sg-radius)#exit
         C1000(config)#aaa authentication dot1x default group RADIUS_GROUP
         C1000(config)#aaa accounting dot1x default start-stop group RADIUS_GROUP
         C1000(config)#aaa authorization network default group RADIUS_GROUP
         C1000(config)#dot1x system-auth-control


.. md-tab-set::
   :name: c1000-radius

   .. md-tab-item:: CLI

      .. code-block:: bash

         C1000#configure terminal
         C1000(config)#aaa new-model
         C1000(config)#radius-server vsa send authentication
         C1000(config)#radius-server vsa send accounting
         C1000(config)#aaa group server radius 'RADIUS_GROUP'
         C1000(config-sg-radius)#server-private NACVIEW_SER auth-port 1812 acct-port 1813 key RADIUS_KEY
         C1000(config-sg-radius)#ip radius source-interface MGMT_INT
         C1000(config-sg-radius)#exit
         C1000(config)#aaa authentication dot1x default group RADIUS_GROUP
         C1000(config)#aaa accounting dot1x default start-stop group RADIUS_GROUP
         C1000(config)#aaa authorization network default group RADIUS_GROUP
         C1000(config)#dot1x system-auth-control
   
   .. md-tab-item:: Commands
     
     .. code-block:: bash
       
         configure terminal
         aaa new-model
         radius-server vsa send authentication
         radius-server vsa send accounting
         aaa group server radius RADIUS_GROUP
         server-private NACVIEW_SER auth-port 1812 acct-port 1813 key RADIUS_KEY
         ip radius source-interface MGMT_INT
         exit
         aaa authentication dot1x default group RADIUS_GROUP
         aaa accounting dot1x default start-stop group RADIUS_GROUP
         aaa authorization network default group RADIUS_GROUP
         dot1x system-auth-control


Change of Authority (CoA)
========================================

Configuration on the device
----------------------------

.. md-tab-set::
   :name: c1000-coa

   .. md-tab-item:: CLI

      .. code-block:: bash

        C1000#configure terminal
        C1000(config)#aaa server radius dynamic-author
        C1000(config-locsvr-da-radius)#client NACVIEW_SERV server-key COA_SECRET
        C1000(config-locsvr-da-radius)#port 3799

   .. md-tab-item:: Commands

      .. code-block::

        configure terminal
        aaa server radius dynamic-author
        client NACVIEW_SERV server-key COA_SECRET
        port 3799

Configuration in the NACVIEW
-----------------------------

--------------
Authorisation
--------------

802.1x
==============

.. md-tab-set::
   :name: c1000-8021x

   .. md-tab-item:: CLI

      .. code-block:: bash

        C1000#configure terminal
        C1000(config)#interface gigabitEthernet 1/0/1
        C1000(config-if)#spanning-tree portfast edge
        C1000(config-if)#switchport mode access
        C1000(config-if)#dot1x pae authenticator
        C1000(config-if)#authentication port-control auto
        C1000(config-if)#authentication host-mode single-host
        C1000(config-if)#authentication periodic
        C1000(config-if)#authentication violation replace
        C1000(config-if)#authentication order dot1x
        C1000(config-if)#authentication priority dot1x

   .. md-tab-item:: Commands

      .. code-block:: bash

        configure terminal
        interface gigabitEthernet 1/0/1
        spanning-tree portfast edge
        switchport mode access
        dot1x pae authenticator
        authentication port-control auto
        authentication host-mode single-host
        authentication periodic
        authentication violation replace
        authentication order dot1x
        authentication priority dot1x

Dot1x and MAB as fallback
==========================

.. warning::
   Remeber that enabling MAB on the interface with 802.1x enabled significally lowers overall security.

.. md-tab-set::
   :name: c1000-8021x-mab

   .. md-tab-item:: CLI

      .. code-block:: bash

        C1000#configure terminal
        C1000(config)#interface gigabitEthernet 1/0/1
        C1000(config-if)#spanning-tree portfast edge
        C1000(config-if)#switchport mode access
        C1000(config-if)#dot1x pae authenticator
        C1000(config-if)#authentication port-control auto
        C1000(config-if)#authentication host-mode single-host
        C1000(config-if)#authentication periodic
        C1000(config-if)#authentication violation replace
        C1000(config-if)#mab eap
        C1000(config-if)#authentication order dot1x mab
        C1000(config-if)authentication priority dot1x mab

   .. md-tab-item:: Commands

      .. code-block:: bash

        configure terminal
        interface gigabitEthernet 1/0/1
        spanning-tree portfast edge
        switchport mode access
        dot1x pae authenticator
        authentication port-control auto
        authentication host-mode single-host
        authentication periodic
        authentication violation replace
        mab eap
        authentication order dot1x mab
        authentication priority dot1x mab


.. tip::
   To change authorisation order and preference, one should change `authentication order` and `authentication priority` to desired values.


.. Autoryzacja adresem MAC + fallback do 802.1x

.. C1000#configure terminal
    C1000(config)#interface gigabitEthernet 1/0/1
    C1000(config-if)#spanning-tree portfast edge
    C1000(config-if)#switchport mode access
    C1000(config-if)#dot1x pae authenticator
    C1000(config-if)#authentication port-control auto
    C1000(config-if)#authentication host-mode single-host
    C1000(config-if)#authentication periodic
    C1000(config-if)#authentication violation replace
    C1000(config-if)#mab eap
    C1000(config-if)#authentication order mab dot1x
    C1000(config-if)authentication priority mab dot1x

MAB
====

.. danger::
   Unless required by devices that do not support 802.1x protocol, MAB-only operation is strongly discouraged. It provides no authentication whatsoever, as MAC spoofing is trivial. MAB-only  authorisation on any interface is extremly dangerous! The only scenario when MAB's desirable is captive portal.

.. md-tab-set::
   :name: c1000-mab

   .. md-tab-item:: CLI

      .. code-block:: bash

        C1000#configure terminal
        C1000(config)#interface gigabitEthernet 1/0/1
        C1000(config-if)#spanning-tree portfast edge
        C1000(config-if)#switchport mode access
        C1000(config-if)#authentication port-control auto
        C1000(config-if)#authentication host-mode single-host
        C1000(config-if)#authentication periodic
        C1000(config-if)#authentication violation shutdown
        C1000(config-if)#mab eap
        C1000(config-if)#authentication order mab
        C1000(config-if)authentication priority mab

   .. md-tab-item:: Commands

      .. code-block:: bash
        
        configure terminal
        interface gigabitEthernet 1/0/1
        spanning-tree portfast edge
        switchport mode access
        authentication port-control auto
        authentication host-mode single-host
        authentication periodic
        authentication violation shutdown
        mab eap
        authentication order mab
        authentication priority mab


### 802.1x + fall-back do autoryzacji adresem MAC - tryb multi-domain

C1000#configure terminal
C1000(config)#interface gigabitEthernet 1/0/1
C1000(config-if)#spanning-tree portfast edge
C1000(config-if)#switchport mode access
C1000(config-if)#dot1x pae authenticator
C1000(config-if)#authentication port-control auto
C1000(config-if)#authentication host-mode multi-domain
C1000(config-if)#authentication periodic
C1000(config-if)#authentication violation replace
C1000(config-if)#mab eap
C1000(config-if)#authentication order dot1x mab
C1000(config-if)authentication priority dot1x mab

### 802.1x + fall-back do autoryzacji adresem MAC - tryb multi-host

C1000#configure terminal
C1000(config)#interface gigabitEthernet 1/0/1
C1000(config-if)#spanning-tree portfast edge
C1000(config-if)#switchport mode access
C1000(config-if)#dot1x pae authenticator
C1000(config-if)#authentication port-control auto
C1000(config-if)#authentication host-mode multi-host
C1000(config-if)#authentication periodic
C1000(config-if)#authentication violation replace
C1000(config-if)#mab eap
C1000(config-if)#authentication order dot1x mab
C1000(config-if)authentication priority dot1x mab

### 802.1x + fall-back do autoryzacji adresem MAC - tryb multi-auth

C1000#configure terminal
C1000(config)#interface gigabitEthernet 1/0/1
C1000(config-if)#spanning-tree portfast edge
C1000(config-if)#switchport mode access
C1000(config-if)#dot1x pae authenticator
C1000(config-if)#authentication port-control auto
C1000(config-if)#authentication host-mode multi-auth
C1000(config-if)#authentication periodic
C1000(config-if)#authentication violation replace
C1000(config-if)#mab eap
C1000(config-if)#authentication order dot1x mab
C1000(config-if)authentication priority dot1x mab

## Konfiguracja TACACS+

aaa group server tacacs+ TAC+_GROUP
server-private NACVIEW_SERV key TAC+_KEY
accounting acknowledge broadcast
ip tacacs source-interface MGMT_INT
exit
aaa authentication login default group TAC+_GROUP local
aaa authentication enable default group TAC+_GROUP none
aaa authorization exec default group TAC+_GROUP if-authenticated
aaa authorization commands 0 default group TAC+_GROUP none
aaa authorization commands 1 default group TAC+_GROUP none
aaa authorization commands 15 default group TAC+_GROUP none
aaa accounting exec default start-stop group TAC+_GROUP



## SNMP

### Wersja 3 - zalecana

C1000#configure terminal
C1000(config)#snmp-server enable traps
C1000(config)#snmp-server group SNMP_GROUP v3 priv context vlan- match prefix
C1000(config)#snmp-server ifindex persist
C1000(config)#snmp-server trap-source MGMT_INT
C1000(config)#snmp-server source-interface informs MGMT_INT
C1000(config)#snmp-server source-interface traps MGMT_INT
C1000(config)#snmp-server user SNMP_USER SNMP_GROUP v3 auth sha SNMP_AUTH priv des SNMP_PRIV
C1000(config)#snmp-server host NACVIEW_SERV inform version 3 priv SNMP_USER
C1000(config)#snmp-server host NACVIEW_SERV traps version 3 priv SNMP_USER

### Wersja 2c - nie zalecana, zapewniająca minimalny poziom bezpieczeństwa

C1000#configure terminal
C1000(config)#snmp-server enable traps
C1000(config)#snmp-server ifindex persist
C1000(config)#snmp-server community SNMP_SECRET ro
C1000(config)#snmp-server trap-source MGMT_INT
C1000(config)#snmp-server source-interface informs MGMT_INT
C1000(config)#snmp-server source-interface traps MGMT_INT
C1000(config)#snmp-server host NACVIEW_SERV inform version 2c SNMP_SECRET
C1000(config)#snmp-server host NACVIEW_SERV traps version 2c SNMP_SECRET

## Przekierowanie logów systemowych na serwer NACVIEW

C1000#configure terminal
C1000(config)#logging host NACVIEW_SERV
C1000(config)#logging source-interface MGMT_INT
C1000(config)#logging on

## Zabezpieczenia MAC

Polecania `switchport port-security` można używać tylko na porcie w statycznie ustawionym trybie `access` bądź `trunk`

C1000(config-if)#switchport port-security - polecenie włącza tryb `port-security` (domyślnie dynamiczne zapamiętywanie adresów MAC)
C1000(config-if)#switchport port-security mac-address H.H.H - polecenie dodaje do konfiguracji adres statyczny MAC
C1000(config-ir)#switchport port-security mac-address sticky - polecenie konfiguruje dodawanie dynamicznych adresów MAC w trybie `sticky`
C1000(config-if)#switchport port-security mac-address forbidden H.H.H - polecenie konfiguruje adres zabroniony na danym porcie

Tryb domyślny (dynamiczny) - jest to tryb, w którym przełącznik dynamicznie uczy się adresów MAC na porcie, są one usuwane z tablicy adresów po wystąpienie każdego `link-down` na porcie
Tryb statyczny - jest to tryb, w którym administrator statycznie konfiguruje do 4096 adresów, są one zapisywane w bieżącej konfiguracji urządzenia. Jeśli zostanie określona ilość adresów mniejsza niż ustawiona wartość maksymalna, to reszta adresów jest rejestrowana w trybie dynamicznym bądź `sticky`
Tryb `sticky` - jest to tryb, w którym przełącznik dynamicznie uczy się adresów MAC na porcie, natomiast są one zapisywane jak adresy statyczne

C1000(config-if)#switchport port-security violation [protect | restrict | shutdown] - polecenia konfiguruje tryb naruszenia portu (wykrycie niezarejstrowanego adresu MAC w trybie statycznym bądź przekroczenie maksymalnej ilości adresów w trybie dynamicznym bądź wykrycie zarejestrowanego adresu MAC na innym porcie)

Tryb `protect` - pakiety są odrzucane do momentu, kiedy przestaną obowiązywać naruszenie portu
Tryb `restrict` - j.w., powoduje zwiększenie licznika `SecurityViolation`
Tryb `shutdown` - ustawia port w tryb `error-disabled`

**Ważne: powyższe tryby działąją również z poleceniem 'authentication violation'**

C1000(config-if)#switchport port-security maximum X - polecenie konfiguruje maksymalną ilość adresów na porcie, gdzie X jest od 1 do 4097
C1000(config-if)#switchport port-security agisssssssssssssssssssssssssng time X - polecenia konfiguruje maksymalny czas życia adresów dynamicznych, gdzie X jest od 1 do 1440 (w minutach)
C1000(config-if)#switchport port-security aging type [ absolute | inactivity] - typ starzenia się adresów MAC (absolutny, od momentu dodanie do tablicy bądź bazujący na nieaktywności danego adresu)
C1000(config-if)#switchport port-security aging static - włączenie starzenia portów dla adresów dodanych statycznie

## Utility

C1000#show running-config - akualna konfiguracja urządzenia
C1000#show startup-config - startowa konfiguracja urządzenia
C1000#show dot1x - konfiguracja 802.1x
C1000#show dot1x interface gigabitEthernet X/x details - konfiguracja 802.1x na interfejsie X
C1000#show radius server-group all - konfiguracja serwera RADIUS
C1000#show dot1x interface gigabitEthernet X/x statistics - statystyki 802.1x na interfejsie X
C1000#show authentication sessions - pokazuje sesje autoryzacji obecne w systemie
C1000#show authentication sessions int g1/1/0/1 details - pokazuje szczegóły sesji autoryzacji na danym interfejsie
C1000#show authentication sessions method {dot1x, mab, webauth} - pokazuje sesjie autoryzacji używające danej metody autoryzacji
C1000#copy running-config tftp://NACVIEW_SERV/CONF_FILE.txt - kopiowanie bieżącej konfiguracji na serwer NACVIEW
C1000#copy startup-config tftp://NACVIEW_SERV/CONF_FILE.txt - kopiowanie konfiguracji startowej na serwer NACVIEW
C1000#copy tftp://NACVIEW_SERV/CONF_FILE.txt running-config - kopiowanie konfiguracji z serwera NACVIEW do bieżącej konfigurcji
C1000#copy tftp://NACVIEW_SERV/CONF_FILE.txt startup-config - kopiowanie konfiguracji z serwera NACVIEW do startowe

.. rubric:: Footnotes

.. [#] `(Cisco IOS Software, C1000 Software (C1000-UNIVERSALK9-M), Version 15.2(7)E1, RELEASE SOFTWARE (fc4))`
 
