LaBlog

Cisco Switch Simple Installation

10/2/2024
Cisco Switch Simple Installation

Console Connection

The first thing we need to do is to plug our Rollover (console) cable into the console port of the Switch. We open our terminal emulator program on our computer. For example, we can use the Putty emulator program.

Switch> Promptu and Switching to Privileged Mode

The “Switch>” prompt will appear immediately after the console connection is made. By giving the "enable" command on this screen, we switch to Privileged (Administrator) mode.

Initial Configuration and Simple Commands

To proceed to the configuration section after the ''enable'' command; We use the ''conf t'' command. We can enter the name of our Switch using the Switch(config)# hostname Switch01 --> command. We can create our vlans on the Switch using the Switch01(config)# vlan 10,20,30,40 --> command. We can exit the configuration section using the switch01(config)# end --> command. We can see the vlans we created by using the switch01(config)# show vlan --> command. Switch01# wri mem --> command is very important! It allows the operations we perform in the configuration section to be recorded.

Assigning IP to VLANs

Switch01(config)# interface vlan 10 --> We log in to the interface to configure the vlan 10 we created with the command. Switch01(config-if)# ip address 10.196.10.1 255.255.255.0 --> with this command we enter our ip address for vlan 10. We turn this interface up (active) with the Switch01(config-if)# no shutdown --> command. We exit the configuration mode with Switch01(config-if)# end -->. We save our configuration with the Switch01# wri mem --> command. We can perform the ip assignment process for our other VLANs by using the above commands.

VLAN Routing Process on Layer3 Switches

Switch01(config)# ip routing --> We activate routing to ensure communication between VLANs on a Switch with Layer 3 feature. We exit the configuration mode with Switch01(config)# end -->. We save our configuration with the Switch01# wri mem --> command.

Assigning ports to VLANs

Switch01(config)# interface gigabitEthernet 0/1 Switch01(config-if)# switchport mode access --> Makes this port a member of only one VLAN. Switch01(config-if)# switchport access vlan 10 --> Assigns this port to VLAN 10. All traffic coming and going from this port will belong to VLAN 10. This port, which is in access mode, will only be associated with VLAN 10.

Switch Default Gateway

To expose more than one VLAN to the internet through a single gateway, a default route must be entered. Switch01(config)# ip route 0.0.0.0 0.0.0.0 10.192.100.254 --> With this command, we enter the IP address of our Firewall as the default route. Switch01(config)# show ip route --> This command will show us the routing table of the switch. The default route we entered in this table should appear at the top.

VLAN Deletion

Switch01>enable Switch01# conf t Switch01(config)# no vlan 10

TRUNK What is it?

First of all, what is Trunk? While Access Ports can only carry traffic belonging to a single VLAN, this is not sufficient in large networks containing more than one VLAN. In this case, Trunk Ports are used to carry traffic belonging to more than one VLAN between switches at the same time. In trunked connections, VLAN information is encapsulated with 802.1Q or ISL protocols before being added to traffic. Where is trunk used? While Access Ports can only carry traffic belonging to a single VLAN, this is not sufficient in large networks containing more than one VLAN. In this case, Trunk Ports are used to carry traffic belonging to more than one VLAN between switches at the same time. In trunked connections, VLAN information is encapsulated with 802.1Q or ISL protocols before being added to traffic.

How to Trunk?

Switch01>enable Switch01# conf t Switch01(config)# interface gigabitEthernet 0/1 Switch01(config-if)# switchport trunk encapsulation dot1q --> Generally, it is necessary to set the encapsulation mode before trunking on a Cisco Layer 3 switch. This mode, in short, is a standard encapsulation protocol that adds VLAN information to the Ethernet frame, allowing data belonging to different VLANs to be transmitted securely over a single trunk port. Switch01(config-if)# switchport mode trunk --> After this command, this port can now carry traffic from more than one VLAN. After completing our configuration with end and saving it with the wri mem command, the following command is used to view the defined trunk ports; show interfaces trunk