Configuring Routers and Switches
Posted on June 1, 2024 (Last modified on June 26, 2024) • 1 min read • 187 wordsLearn how to configure routers and switches, including basic setup, routing protocols, and VLAN configuration.
Configure basic settings on a router. This includes setting the hostname, configuring interfaces, and enabling routing.
# Example: Basic router setup
hostname Router1
interface GigabitEthernet0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
Routing protocols like OSPF (Open Shortest Path First) and EIGRP (Enhanced Interior Gateway Routing Protocol) are used to determine the best path for data to travel through a network.
# Example: OSPF configuration
router ospf 1
network 192.168.1.0 0.0.0.255 area 0
Routing protocols dynamically exchange routing information to build and maintain routing tables.
VLANs (Virtual Local Area Networks) are used to segment network traffic. They improve network performance and security by separating different types of traffic.
# Example: VLAN configuration
vlan 10
name Sales
interface GigabitEthernet0/1
switchport mode access
switchport access vlan 10
Trunk ports are used to carry multiple VLANs across a single link between switches. This is essential for maintaining VLAN separation across the network.
# Example: Configuring a trunk port
interface GigabitEthernet0/1
switchport mode trunk
switchport trunk allowed vlan 10,20