↪️
ccie.nyquist.eu
  • Table of Contents
  • Layer 2 Technologies
    • Ethernet Switching
      • L2 Switch Operations
      • Spanning Tree
        • 802.1d – STP
        • 802.1w – RSTP
        • 802.1s – MSTP
      • VTP 101
      • Private VLANs
      • VLANs
      • EtherChannel 101
    • Layer 2 WAN Protocols
      • HDLC
        • HDLC 101
      • PPP
        • PPP 101
        • PPP Authentication - PAP
        • PPP Authentication – CHAP
        • PPP Authentication – EAP
        • PPP Multilink
        • PPPoFR – PPP over Frame Relay
        • PPPoE – PPP over Ethernet
      • Frame Relay
        • Frame Relay 101
        • Frame Relay 102
        • Frame Relay Encapsulations – IETF vs Cisco
        • Multilink Frame Relay
        • Frame Relay Switching
        • Routing over Frame Relay
      • Bridging
        • Bridging on a router
        • MTU 101
    • Wireless
      • Wireless Principles
      • Wireless Implementations
      • Wireless Roaming
      • Wireless Authentication
        • WPA2 PSK
        • WPA2 802.1X
  • IPv4
    • IPv4 Addressing
      • Backup Interfaces
      • FHRP 101
      • DHCP 101
      • DNS 101
      • ARP 101
      • IPv4 101
      • Tunnel Interfaces
        • GRE Tunnels
      • BFD – Bidirectional Forwarding Detection
    • IPv4 Routing
      • How the routing table is built
        • How CEF works
        • Routing Order of Operations
        • NSF – Non Stop Forwarding
      • RIP
        • RIP 101
      • EIGRP
        • EIGRP 101
        • EIGRP Metric
        • More EIGRP Features
      • OSPF
        • OSPF 101
        • OSPF Areas
        • OSPF LSAs
        • OSPF Mechanics
      • IS-IS
        • IS-IS 101
        • IS-IS Mechanics – CLNP
      • BGP
        • BGP 101
        • BGP Attributes
        • More BGP
      • Route Redistribution
      • Policy based Routing
      • PfR 101 – Perfromance Routing
      • ODR
  • IPv6
    • IPv6-101
    • IPv6 Routing
    • Interconnecting IPv6 and IPv4
  • MPLS
    • MPLS 101
    • MPLS L3 VPN
  • Multicast
    • Multicast 101
    • PIM 101
    • IGMP 101
    • Inter Domain Multicast
    • IPv6 Multicast
    • Multicast features on switches
  • Security
    • NAT 101
    • NAT for Overlapping Networks
    • ACLs 101
    • ACLs 102
    • Cisco IOS Firewall
    • Zone Based Firewall
    • AAA 101
    • Controlling CLI Access
    • Control Plane
    • Switch Security
      • Switchport Traffic Control
      • Switchport Port Security
      • DHCP Snooping and DAI
      • 802.1x
      • Switch ACLs
    • IPSec VPN 101
      • IKE / ISAKMP 101
      • IPSEC Crypto Maps 101
      • IPSEC VTI 101
      • DMVPN 101
    • EAP 101
  • Network Services
    • NTP 101
    • HTTP 101
    • File Transfer 101 – TFTP & FTP
    • WCCP 101
  • QoS
    • QoS 101
    • Classification and Marking
    • Congestion Management
      • Legacy Congestion Management
      • SPD – Selective Packet Discard
      • CBWFQ
      • IP RTP Priority
    • Congestion Avoidance – WRED
    • Policing and Shaping
      • CAR 101
    • Compression and LFI
      • Header and Payload Compression
      • LFI for MultiLink PPP
    • Frame Relay QoS
      • Per VC Frame Relay QoS
    • RSVP 101
    • Switching QoS
  • Network Optimization
    • NetFlow 101 – TNF – Traditional NetFlow
    • NetFlow 102 – FNF – Flexible NetFlow
    • IP SLA 101
    • IP Accounting 101
    • Logging 101
    • SNMP and RMON 101
    • Cisco CLI Tips and Tricks
    • AutoInstall
    • Enhanced Object Tracking
    • Troubleshooting 101
    • SPAN, RSPAN, ERSPAN
  • Network Architecture
    • Hierarchical Network Architecture
    • SD Access
    • SD WAN
Powered by GitBook
On this page
  • CLI Modes
  • Custom Privilege Levels
  • Role Based CLI Access
  • CLI Sessions
  • Local or Remote CLI
  • Protecting line access
  • Password Encryption
  • SSH
  • SSH Server
  • SSH Client
  • SCP Server

Was this helpful?

  1. Security

Controlling CLI Access

CLI Modes

  • User EXEC Mode

    R>
    ! To enter the Privileged Exec Mode
    R> enable
  • Privileged EXEC Mode

    R#
    ! To go back to the User Exec Mode
    R# disable
  • Configuration Mode

    ! To enter config mode
    R# config terminal
    ! To exit config mode:
    R(config)# end

To protect access to the Privileged EXEC mode, use:

R(config)# enable {password PASS | secret SECRET}
! secret uses a better encryption algorithm than password encryption

Custom Privilege Levels

  • Level 0 = no rights

  • Level 1 = User EXEC Mode

  • Level 15 = Privileged EXEC Mode

You can define new privilege levels and assign commands to them, so they can be ran by lower level users:

R(config)# enable level LEVEL {password PASS | secret SECRET}
! set a password for the specific level
R(config)# privilege COMMAND [all] level LEVEL STRING
! All commands starting with STRING will be allowed at the specified level
! all - all suboptions will be allowed at the specified level
! COMMAND - is the parent command of the STRING command.
!        You shoud start building a tree from exec

Role Based CLI Access

R# enable view

To access the view, you can use the enable secret or password configured on the router. Then, go into the configuration mode and create a view, and specify a secret for it:

R(config)# parser view VIEW-NAME
R(config-view)# secret STRING

Then, start adding commands to the view, using a similar approach as with Custom Privilege Levels:

R(config-view)# commands COMMAND {include|exclude|include-exclusive} [all] STRING
! All commands starting with STRING will be allowed at the specified level
! all - all suboptions will be allowed at the specified level
! include - adds the command to this view
! exclude - removes the command from this view
! include-exclusive - adds the command to this view and removes it from other views
! COMMAND - is the parent command of the STRING command.
!        You shoud start building a tree from exec

There’s also the option of configuring a super view. This view can only be a collection of other views:

R(config)# parser view SUPER-VIEW superview
R(config-view)# secret SECRET
R(config-view)# view VIEW-NAME

You can move from one view to another using the command:

R# enable view [VIEW-NAME]

an AAA attribute (cli-view-name) can be passed from an AAA server to enable users automatic access to a view.

CLI Sessions

Local or Remote CLI

For Local access to the device you must use the Console or AUX port. To configure Local CLI access, use:

! Console:
R(config)# line console 0
! AUX:
R(config)# line aux 0

For remote CLI acces you must use Telnet or SSH to connect to the device. To configure remote CLI sessions, configure the Virtual Terminal Interfaces using:

R(config)# line vty LINE-START [LINE-END]
! Usually, LINE-START=0, LINE-END=4

Protecting line access

By default, the console and AUX ports allow access without asking for credentials. To enable the router to ask for credentials, use the command:

R(config-line)# login [local|tacacs]
! no params: use line password (default on vty)
! local: use locally defined users
! tacacs: use tacacs authentication

If line password is used but not defined, login will fail. To set the line password, use:

R(config-line)# password PASS

When using line password, you can also set the default privilege level of authenticated users:

R(config-line)# privilege level [0-15]

When using locally defined users, you must first set a username:

R(config)# username USER [privilege LEVEL] {password PASS | secret SECRET}
! default LEVEL: 1

The privilege level of the USER will be used when connecting on the line.

A VTY line can be used for both incoming and outgoing connections. You can define the protocols allowed on each line, using:

R(config-line)# transport {input|output} PROTOCOL
! PROTOCL = usually telnet or ssh
! input = incoming connections
! output = outgoing connections

Protocols defined with the input keyword are allowed for connections to the terminal line, while protocols defined with the output keyword are protocols that can be used to connect from that line to another host.

Password Encryption

By default, when a configuration file is saved, passwords are saved in clear text. You can enable automatic encryption of passwords in the config files, using:

R(config)# service password-encryption

When the configuration files are saved remotely, the passwords are still sent in clear text. For better encryption, use secret instead of password when available

SSH

Before using SSH, a key must be generated, but to generate a key, you need a hostname and domain name.

R(config)# hostname HOST
HOST(config)# ip domain-name DOMAIN
HOST(config)# crypto key generate rsa
! You will be asked for the key size.

SSH Server

R(config)# ip ssh {timeout SEC|authentication-retries RETRIES}
R(config)# ip ssh version {1|2}
! By default both v1 and v2 users are allowed
! You can chose only one version by selecting it in this command

SSH Client

R# ssh -l USER SERVER-IP

SCP Server

R(config)# ip scp server enable

The users must pass an aaa login authentication and an aaa exec authorization to use scp.

PreviousAAA 101NextControl Plane

Last updated 2 years ago

Was this helpful?

These commands are not compatible with mode of operation. By default, there are only 3 privilege levels:

This feature is similar to the Custom Privilege levels, but it requires With this feature you can create custome views with different access to the CLI commands. First you need to be in the root view in order to create other views. To move to the root view, use:

must be enabled for SCP. To enable the SCP server, use:

AAA
aaa new-model
AAA authentication