Switch to privileged mode
enable
Switch from privileged to user mode
disable
Enter global configuration mode
configure terminal
Exit global configuration mode
exit
Enter line sub-configuration mode
line console 0
# line LINE_TYPE NUMBER_OR_RANGE
-
LINE TYPE: Defines the type of access you want to configure. Common values are:
console
: For direct access via the console port.aux
: For access via the auxiliary port.vty
: For remote access via SSH or Telnet.
-
LINE NUMBER | RANGE: Specifies the line number or range of lines you want to configure.
- For example,
console 0
,aux 0
, orvty 0 4
.
- For example,
Return to enable mode
end
Access contextual help
?
View the clock
show clock
Set the clock
clock set 16:20:00 22 Feb 2030
Assign a hostname
hostname NAME
Set a Console User Password
line console 0
password PASSWORD
login
line vty 0 15
password PASSWORD
login
Set a Privileged Console Password
enable secret PASSWORD
enable secret
stores the password in hashed form, offering more security than enable password
, which stores it in plain text.
Tip
The startup-config
and running-config
files display stored passwords in plain text, which is a security risk. To encrypt them, use the command service password-encryption
.
Set a warning message
configure terminal
banner motd #Authorized Access Only#
There are two system files that store device configuration:
Startup-config
: configuration saved in NVRAM used at startup.Running-config
: active configuration in RAM, lost upon power-off.
To save the current configuration to the startup file, run copy running-config startup-config
in privileged mode.
Restart the router or switch.
reload
Erase the saved configuration to start with the default settings.
erase startup-config
View the status of interfaces
Router# show ip interface brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 192.168.1.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0 10.1.1.1 YES manual up up
Serial0/1 unassigned YES unset down down
Loopback0 192.168.0.1 YES manual up up
configure terminal
interface vlan 1
ip address 192.168.1.20 255.255.255.0
no shutdown
exit
ip default-gateway 192.168.1.1