owned this note
owned this note
Published
Linked with GitHub
---
title: Basic Switch Configuration
tags: Cisco IOS, networking, manual, reference, switch, technical
---
<header>
<h6>Basic Switch Configuration</h6>
> [toc]
</header>
---
# SVI Configuration – Switch Management Access
<ol class="step-list">
<li>Enter global configuration mode.</li>
<li>Configure the default gateway for the switch (if it will be managed remotely from networks that are not directly connected).</li>
<li>Enter interface configuration mode for the SVI.</li>
<li>Configure the management interface IPv4 address.</li>
<li>Configure the management interface IPv6 address.</li>
<li>Enable the management interface.</li>
<li>Return to the privileged EXEC mode.</li>
<li>Save the running config to the startup config.</li>
</ol>
```pug
S1# configure terminal
S1(config)# ip default-gateway 172.17.99.1
S1(config)# interface vlan 99
S1(config-if)# ip address 172.17.99.11 255.255.255.0
S1(config-if)# ipv6 address 2001:db8:acad:99::11/64
S1(config-if)# no shutdown
S1(config-if)# end
S1# copy running-config startup-config
```
:::success
Because, it will receive its default gateway information from a router advertisement (RA) message, the switch does not require an IPv6 default gateway.
:::
# Switch Port Configuration – Layer 1 (Physical)
Switch ports can be manually configured with specific duplex and speed settings. Most 10/100/1000 ports operate in either half- or full-duplex mode when they are set to 10 or 100 Mbps and operate only in full-duplex mode when set to 1000 Mbps (1 Gbps).
:::info
The default setting for both duplex and speed for switch ports on many Cisco switches is **auto**. Autonegotiation is useful when the speed and duplex settings of the device connecting to the port are unknown or may change. When connecting to known devices such as servers, dedicated workstations, or network devices, a best practice is to manually set the speed and duplex settings.
:::
<ol class="step-list">
<li>Enter global configuration mode.</li>
<li>Enter interface configuration mode.</li>
<li>Configure the interface duplex.</li>
<li>Configure the interface speed.</li>
<li>Return to the privileged EXEC mode.</li>
<li>Save the running config to the startup config.</li>
</ol>
```pug
S1# configure terminal
S1(config)# interface FastEthernet 0/1
S1(config-if)# duplex full
S1(config-if)# speed 100
S1(config-if)# end
S1# copy running-config startup-config
```
:::warning
Mismatched settings for the duplex mode and speed of switch ports can cause connectivity issues. Autonegotiation failure creates mismatched settings.
:::
# SSH Access Configuration
<span class='refer-to'>Refer to: [Security Configuration — SSH Management](/ogED99eCQtWkhDr6O-SDRA#SSH-Management)</span>
# Switch Verification Commands
The following table summarizes some of the more useful switch verification commands:
| Task | IOS Commands |
| ---- | ------------ |
| Display interface status and configuration. | <span class='mono'>S1# **show interfaces** [*interface-id*]</span> |
| Display current startup configuration. | <span class='mono'>S1# **show startup-config**</span> |
| Display current running configuration. | <span class='mono'>S1# **show running-config**</span> |
| Display information about flash file system. | <span class='mono'>S1# **show flash**</span> |
| Display system hardware and software status. | <span class='mono'>S1# **show version**</span> |
| Display history of command entered. | <span class='mono'>S1# **show history**</span> |
| Display IP information about an interface. | <span class='mono'>S1# **show ip interface** [*interface-id*]</span><br>or<br><span class='mono'>S1# **show ipv6 interface** [*interface-id*]</span> |
| Display the MAC address table. | <span class='mono'>S1# **show mac-address-table**</span><br>or<br><span class='mono'>S1# **show mac address-table** </span> |
# Common Interface Errors
The output from the **`show interfaces`** command is useful for detecting common media issues. Based on the output of the command, possible problems can be fixed as follows:
* If the interface is **up** and the line protocol is **down**, a problem exists. There could be an encapsulation type mismatch, the interface on the other end could be error-disabled, or there could be a hardware problem.
* If the line protocol and the interface are **both down**, a cable is not attached, or some other interface problem exists. For example, in a back-to-back connection, the other end of the connection may be administratively down.
* If the interface is **administratively down**, it has been manually disabled (the shutdown command has been issued) in the active configuration.
Some media errors are not severe enough to cause the circuit to fail but do cause network performance issues. The folling sections explain some of these common errors which can be detected using the **`show interfaces`** command.
## Input Errors
“Input errors” is the sum of all errors in datagrams that were received on the interface being examined. This includes runts, giants, CRC, no buffer, frame, overrun, and ignored counts. The reported input errors from the show interfaces command include the following:
| Error Type | Description |
| :--------: | -------- |
| **Runts** | Packets that are discarded because they are smaller than the minimum packet size for the medium. For instance, any Ethernet packet that is less than 64 bytes is considered a runt. Malfunctioning NICs are the usual cause of excessive runt frames, but they can also be caused by collisions. |
| **Giants** | Packets that are discarded because they exceed the maximum packet size for the medium. For example, any Ethernet packet that is greater than 1,518 bytes is considered a giant. |
| **CRC** | CRC errors are generated when the calculated checksum is not the same as the checksum received. On Ethernet and serial interfaces, CRC errors usually indicate a media or cable error. Common causes include electrical interference, loose or damaged connections, or incorrect cabling. |
## Output Errors
“Output errors” is the sum of all errors that prevented the final transmission of datagrams out the interface that is being examined. The reported output errors from the show interfaces command include the following:
| Error Type | Description |
| :--------: | ----------- |
| **Collisions** | Number of messages retransmitted because of an Ethernet collision. Collisions in half-duplex operations are normal. However, you should never see collisions on an interface configured for full-duplex communication. |
| **Late Collisions** | A collision that occurs after 512 bits of the frame have been transmitted. Excessive cable lengths are the most common cause of late collisions. Another common cause is duplex misconfiguration. |
---
---
{%hackmd 7PGmjAHeTXak2VUM3iw5Wg %}