In this lab, we will perform basic switch configuration in Cisco packet tracer to enable switch for the basic functionality.
A good thing about the Cisco IOS is that it works quite similarly on both the routers as well as switches, However, there is a difference in the commands that we use for each one of them. For example, some specific commands are meant only for the switches while others for routers as per the device’s functionality.
In this lab, we will assign an IP address to the Vlan1 interface and we will configure the default gateway on the switch. We will also perform some basic configurations which will prepare the router for the functional network.
Basic Switch configuration
To assign an IP address to the VLAN1 interface, we have to enter into interface configuration mode. While configuring the switch for basic functionality, we should also assign a default gateway to the switch. It is important to remember that the VLAN1 interface and default gateway IP address must be on the same network. This enables the switch to redirect traffic to other networks.
Vlan1 interface allows us to connect with the switch remotely via telnet, we can use the telnet client to remotely manage and configure the switch.
To save configuration on Cisco devices we can type the command ‘write’. It copies the running-config to the startup-config alternatively we can also use the command ‘copy running config startup config’ to save the running configuration of the device.
While configuring Cisco devices, it’s common to make typing mistakes. If we mistype a command then the Cisco device will try to resolve the name to the IP address. This makes Cisco devices freeze for about 60 seconds as it resolves IP addresses in the background. One minute is the maximum time taken by the device. Now, we have to wait until the device allows us to type something again. This can be very annoying. It happens because the domain name lookup is enabled by default in Cisco devices. Hence, to solve this problem we can disable domain lookup by entering the command ‘No IP Domain Lookup’.
Now, let us talk about the status messages received on Cisco devices. When we receive status messages on Cisco devices the message kind of mixes with the text that we type on the CLI. This can also be very confusing sometimes. So, to solve this problem we can type the command ‘logging synchronous’. This command synchronizes the status messages. Hence, the message does not interfere with our typing.
- Assign IP address of the switch – 192.168.4.2/24
- Set default gateway of the switch to 192.168.4.1
- Save configuration
- Disable domain lookup
- Synchronize switch’s status messages
Switch(config)#interface vlan 1
Switch(config-if)#ip address 192.168.4.2 255.255.255.0
Switch(config)#ip default-gateway 192.168.4.1
Router(config)#no ip domain lookup
Switch(config)#line con 0