How to configure a Cisco Switch (Basic configuration)

This article is all about how to configure a Cisco switch. In this tutorial, we will learn about basic cisco switch configuration. Switches have two types one is manageable and another is non-manageable. We can only configure manageable switches because non-manageable switches do not provide the facility to configure. So now here we will learn some basic configuration on switches like how to assign the hostname to a switch, how to setup MOTD (message of the day) on a switch, and also learn how to enable DNS lookup on the switch.

In this tutorial, we also learn that how to enable synchronous logging on switches, assign a local name to an IP address, and how to configure an inactivity time-out for automatic log-off on a cisco switch. This tutorial is to help you with the CCNA certification exam. So let’s start here how to configure a switch.

Switches can only work in the same network but you want to dig deeper and want to connect two different networks then use routers. Here is our guide on how to configure a router to connect two different networks.

how to configure a cisco switch

1. How to set hostname on a Cisco switch

Now use given below command to set a hostname on a cisco switch

Switch>enable

Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#hostname peanut

peanut(config)#exit

peanut(config)#

This command is used for setting a hostname on the switch if you want to set your name on switch write your name in the command instead of peanut. After that switch shows your name instead of peanut on it.

Talking off the topic: Linux there are many different ways by which you can edit a text file in Linux graphically as well as from the command line. Want to know more then click here

2. How to set a banner on the switch or configure MOTD (message of the day) on a Cisco switch

This message will be displayed every time on the user’s screen when they attempt a connection via the console port, auxiliary port, SSH, or telnet session to the cisco switch.

Use the following below-given command to set a MOTD on switch

peanut>enable

peanut#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

peanut(config)#banner motd # Peanut is not just a name it is an emotion#

peanut(config)#exit

Note: – Here ‘#’ character is known as a delimiting character

Always remember that the banner message should be surrounded by delimiting characters and the message should not contain the delimiting character in it.

3. How to set an inactivity time-out for automatic log-off

Sets a time limit on a Cisco switch at which console automatically log off if the user is inactive on that port. By given below commands you can set inactivity time-out for automatic log-off

peanut>enable

peanut#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

peanut(config)#line console 0

peanut(config-line)#exec-timeout 3 0

peanut(config-line)#exit

peanut(config)#exit

If you want to set console never log off then type 0 0 (minute second) in the above command instead of 3 0 to set console on never log off

4. How to turn on synchronous logging on a switch

Sometimes cisco switch IOS sends a message to the console while you are entering a command in it, by default the switch will interrupt your work to show the message. If you want to stop these messages from interrupting your work and want an uninterrupted console on your switch then turn on synchronous logging on your switch.

Now to turn on synchronous logging on a switch use given below commands

peanut>enable

peanut#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

peanut(config)#line console 0

peanut(config-line)#logging synchronous

peanut(config-line)#exit

peanut(config)#exit

5. How to assign a local name to an IP address on a Cisco switch

Now use given below command to assign a local name to an IP address.

peanut>enable

peanut#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

peanut(config)#ip host peanut 1.0.0.1

peanut(config)#exit

By this command, you can assign a name to an IP address. when this is completed, we can use the configured hostname for telnet and ping on a switch instead of an IP address.

Ever find an interesting video on Facebook and want to save it offline on your device for later. Then here is our guide on how to download any video from Facebook directly?

6. How to enable DNS lookup on cisco switch 

peanut>enable

peanut#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

peanut(config)#ip name-server 1.0.0.1

peanut(config)#exit

Now we learn how to turn off the automatic name resolution for a cisco switch

The Cisco switch is set by default to try to resolve any word that is not a command to a DNS server at address 255.255.255.255. We can turn off this by using the following command.

peanut>enable

Enter configuration commands, one per line. End with CNTL/Z.

peanut(config)#no ip domain-lookup

peanut(config)#exit

THAT’S IT

Now your switch is configured as you desired, practice this lab to want to more perfection in cisco switch configuration. These are the basic cisco switch configurations that are used in daily life. Comment your thoughts.

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: