From c17e978a55fb369f9b2821c1ecf7eaeed1bebf52 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Thu, 17 Apr 2025 23:06:40 +0200 Subject: [PATCH] cisco --- .../0260-administring-a-cisco-switch.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 content/snippets/0260-administring-a-cisco-switch.md diff --git a/content/snippets/0260-administring-a-cisco-switch.md b/content/snippets/0260-administring-a-cisco-switch.md new file mode 100644 index 0000000..f40485c --- /dev/null +++ b/content/snippets/0260-administring-a-cisco-switch.md @@ -0,0 +1,96 @@ + + +# Administring a Cisco Switch - Basics for the Homelab Usage + +## Saving the Configuration + +Never forget, otherwise after reboot changes are gone! + +``` +write memory +``` + + +## Configure VLANs + +Allow VLAN-IDs greater then 1005: + +``` +configure terminal +vtp mode transparent +exit +``` + + +``` +configure terminal +vlan 1001 +name vlan1001 +exit +exit +``` + +The first `exit` leaves the interface, the second `exit` leaves the config session. + +If the VLAN should be used for management purposes it needs an IP address: + +``` +configure terminal +vlan 2000 +name vlan2000 +ip address dhcp +exit +exit +``` + + +Check your work: + +``` +show vlan +``` + + +## Configure Interfaces + +To check your work use + +``` +show interfaces status +``` + + +### Access Ports + +``` +configure terminal +interface GigabitEthernet1/0/1 +switchport mode access +switchport access vlan 1001 +spanning-tree portfast +no shutdown +exit +exit +``` + +### Trunk Ports + +``` +configure terminal +interface GigabitEthernet1/0/23 +switchport mode trunk +switchport trunk allowed vlan 1012,3001,3002,3003,3004 +switchport trunk native vlan 1012 +no shutdown +exit +exit +``` + +`allowed` connects the port to the VLAN for tagged communication. + +`native` makes the VLAN untagged on that port. + +