Basic Cisco Switch Configuration Commands
Basic Cisco Switch Configuration Commands
First of all, we can say that Cisco switches are the best because they possess many features such as,
- Versatile
- flexible
- reliable
- powerful
- Parallel Performance by Cisco switch product line.
Now we are going to learn about the Cisco switch. We can say that it is a simpler network device when comparing with other devices(examples include firewalls and routers). The configuration of a Cisco Catalyst Switch may be a difficult thing for some users.
To enable features such as security, management, and some other important features, the Cisco switch needs some basic initial configuration. But other lower-class switch vendors don’t need this initial configuration, unlike the Cisco Switches.
Steps for the Cisco Switch configuration and setup :
Step 1: The very first step is to connect to the device through the console.
Here we use a terminal emulation software then the switch’s console is get connected. Now we get a command prompt. Now we type “enable” and then press the enter key. When typing this keyword, we will get into privileged EXEC mode. By typing “configure terminal” in the next line of the command prompt, we enter into a global configuration.
Step 2: We have to provide a particular hostname for each one to distinguish them in the network. This is done by using the following commands:
Hostname access-switch1
Step 3: Create a secret administration password. This password can be created by using the following command:
enable secret somestrongpass
We can enter into the Privileged EXEC mode as we already told in step 1 by using this password.
Step 4: After creating the administration password, we have to create a password for the telnet and console access.
For security purposes, it is a good thing to lock-down all access lines of a switch with a password. Configuring an external AAA server is also used for security reasons. Each access lines( in this example, VTY lines for telnet and console line) can be configured with the password by the following commands:
Configuring password for VTY lines:
#line vty 0 15
#password strongtelnetpass
#login
#exit
Configuring password for console line:
# line console 0
#password strongconsolepass
# login
# exit
Step 5: Now we are going to define the IP addresses which are allowed to access the switch through the Telnet.
This can be done by using the following lines commands:
# ip access-list standard TELNET-ACCESS
# permit 10.1.1.100
# permit 10.1.1.101
# exit
# line vty 0 15
# line vty 0 15
# exit
Step 6: Now, for switch management, we assign the IP address to the switch.
By default, the management IP is assigned to VLAN 1. This IP address assigning can be done by using the following commands:
# interface vlan 1
# ip address 10.1.1.200 255.255.255.0
# exit
Step 7: The seventh step is to assign the default gateway to the switch. The default gateway can be assigned by the following code:
# ip default-gateway 10.1.1.254
Step 8: Then we need to disable all the unneeded ports that occurred on the switch.
This step is not mandatory(that is, this step is optional), but this can be used for enhancing security. Consider an example, we have a 48-port switch, but we only need first 24 ports and the remaining ports, that is, port 25-48 are not needed, then it can be disabled by using the following commands:
# interface range fe 0/25-48
# shutdown
# exit
Step 9: In ninth step Layer 2 VLANs are configured and assign ports to each of them.
All the physical ports of the switch belong to VLAN 1, by default. The network can be segmented into multiple Layer 2 VLANs by the use of Ethernet Switch. For this segmentation followings, things need to perform
- We have to create additional VLANs from the default VLAN 1
- Assign physical ports to these new VLANs.
Consider an example, We are going to create two new VLANs namely VLAN2 and VLAN3, and then assign ports for each of them,
Creating the Layer 2 VLAN
# vlan 2
# name TEACHERS
# exit
# vlan 3
# name STUDENTS
# exit
Assigning ports: Ports 1-2 are assigned for VLAN 2 and ports 3-4 are assigned for VLAN 3
For VLAN 2,
# interface range fe 0/1-2
# switchport mode access
# switchport access vlan 2
# exit
For VLAN 2,
# interface range fe 0/3-4
# switchport mode access
# switchport access vlan 3
# exit
Step 10: The last and final step is to save the configuration.
This is done by the following command:
# exit
# wr
Some “Show” commands
- show run – Display current running configuration
- show interfaces –Display the configuration of all interface and their status
- show VLAN – Display all VLAN numbers, ports, names, etc
- show interface status - Display status of the interface, duplex, etc
- show mac - address-table- Display current MAC address table.
Comments
No comments yet.