Set initial configuration in Cisco devices
Intro
In this section learn how to set initial configuration in Cisco devices. You can also follow the video of this section on my channel on YouTube.
We have 3 modes in Cisco devices, namely:
Modes | Symbols | command |
User mode | switch> | - |
Privilege mode | switch# | enter enable in user mode |
Global mode | switch(config)# | enter config terminal or conf t to enter this mode |
In privilege mode, you can run show commands, while in global mode you can change configuration of switch.
1-1 Setting hostname
1-2 Setting password for line console
In line 4, if you forget to write login, switch will not ask any password. So, you have to write it, to enable password in line console 0.
1-3 Setting password for line vty
vty lines are using for users to connect via SSH, Telnet. In other words, to enable SSH or Telnet, you have to use these lines. By default, Cisco breaks up vty lines into two segments:
vty 0 - 4 (older devices)
vty 5- 15
New devices have more than 15 vty. Usually system administrator define 5 vty in devices.
1-4 Setting password for the privilege mode
we have two options for setting password for the privilege mode:
password which is in clear mode
secret which is encryption mode
or
1-5 Encrypt your Cisco device
if you use password instead of secret with # show running-config command you can see the clear password. To encrypt the password use this command:
now if you look at running-config , everything has become encrypted.
1-6 Setting IP address for default vlan
by default, all Cisco devices have vlan 1, so in other section will know how to make a vlan. In this code, we set IP address 192.168.1.1 with subnet mask 255.255.255.0. Then, we use command no shutdown to enable interface.
Cisco recommends all use any vlan number except vlan 1.
1-7 Setting default gateway
if you have router and you want to access your Cisco switch to router for the Internet, you have to set default gateway.
1-8 Shutdown ports
you can shutdown ports for the range of ports. For example, range of 1 to 4 is shutdown by shutdown command.
use no shutdown or no shut to enable ports
1-9 Setting banner
you can set a banner for a switch with motd command. After motd you have to use kind of character and it can be * + | or anything. The important matter is that both character should be the same as the code it is shown
1-10 Prevent mistype
Mistype translating domain server
In Cisco devices, if you enter a some command wrong, by default try to map it to domain name and it takes 30 sec to do that. To prevent mistype, we use this command:
1-11 Setting timeout
if you are working with Cisco command line, you can set session timeout with these command. In these examples, we set timeout to 10 seconds.
vty line:
line console:
1-12 save configuration
to save your configuration you can run these two commands:
or
Last updated