General Settings

This article outlines some of the most commonly run commands when first setting up a switch. It’s recommended you configure all settings within the first part of the article, however any item under CLI Comforts is completely optional.

Hostname

Set a hostname for the switch so you know what switch you’re on when running commands.

Switch (config)# hostname IN-S01-CS01

Domain Name

Configure a domain name on the switch. This is a requirement by other services such as when configuring SSH access.

Switch (config)# ip domain-name ad.twobyte.blog

Disable GUI Interface

Unless you want to access and/or use the builtin GUI interface, it’s best to immediately disable access.

Switch (config)# no ip http server
Switch (config)# no ip http secure-server

CLI Comforts

Here are a few settings that make using the cli more pleasant.

Disable Domain Lookups

Disables domain lookups. This will prevent the switch from performing DNS lookups when you accidentally mistype a command. A common and annoying problem that typically results in you waiting 5-10 seconds for the resulting DNS query to inevitably fail.

Switch (config)# no ip domain-lookup

Synchronous Logging

By default, all system messages are written directly to the prompt, befuddling any commands you were in the process of typing out. Enabling logging synchronous forces the message onto a new line.

To enable logging synchronous for the console connection:

Switch (config)# line con 0
Switch (config)# logging synchronous

To enable logging synchronous for the vty connection(s):

Switch (config)# line vty 0 15
Switch (config)# logging synchronous