Skip to content
Tech Master Tech Master

OneStopTechnical Forum

  • Books
  • AI
  • Networking
  • Windows
  • Linux
  • Cloud
  • Mac
  • Active Directory
  • Azure
  • Cloud
  • Exchange
  • M365
  • Server 2025
  • Storage
  • Vsphere
  • Website
  • Database
  • Security
  • Knowledge Base
  • VPN
Tech Master
Tech Master

OneStopTechnical Forum

Configuring VLANs on a Layer 2 & Layer 3 Switch (L2, L3)

blog.payperitem.com, March 31, 2025April 2, 2025

1. Configuring VLANs on a Layer 2 Switch (L2)

A Layer 2 switch forwards traffic based on MAC addresses and requires an external router (or an L3 switch) for inter-VLAN routing.

Step 1: Create VLANs

bashenable
configure terminal
vlan 10
name HR
vlan 20
name IT
exit

Step 2: Assign VLANs to Ports

  • Access Mode (for end devices)
bashinterface GigabitEthernet0/1
switchport mode access
switchport access vlan 10
exit
interface GigabitEthernet0/2
switchport mode access
switchport access vlan 20
exit
  • Trunk Mode (for uplinks between switches or to routers)
bashinterface GigabitEthernet0/24
switchport mode trunk
switchport trunk allowed vlan 10,20
exit

Step 3: Verify Configuration

bash
show vlan brief
show interfaces trunk

2. Configuring VLANs on a Layer 3 Switch (L3)

A Layer 3 switch can perform inter-VLAN routing without needing an external router.

Step 1: Enable IP Routing

bash
enable
configure terminal
ip routing

Step 2: Create VLANs and Assign IP Addresses

bashvlan 10
name HR
vlan 20
name IT
exit

interface Vlan10
ip address 192.168.10.1 255.255.255.0
no shutdown

interface Vlan20
ip address 192.168.20.1 255.255.255.0
no shutdown

Step 3: Assign Physical Ports to VLANs

bashinterface GigabitEthernet0/1
switchport mode access
switchport access vlan 10
exit
interface GigabitEthernet0/2
switchport mode access
switchport access vlan 20
exit

Step 4: Configure a Default Route (Optional)

If this switch needs to communicate with other networks:

bashCopyEditip route 0.0.0.0 0.0.0.0 192.168.1.1

Step 5: Verify Configuration

bashCopyEditshow ip interface brief
show vlan brief
show ip route

Summary

  • L2 switch VLANs: Only provide network segmentation, requiring a router (or L3 switch) for inter-VLAN communication.
  • L3 switch VLANs: Can route between VLANs directly.

Networking Windows #Azure#BSOD#CentOS#CloudComputing#CloudHosting#Colocation#CyberSecurity#CyberSecurity #WindowsSecurity #PrivacyMatters #Firewall #EndpointSecurity#DataCenter#DDoSProtection#DebianServer#DedicatedServer#DirectX#ESXi#FibreChannel#Firewall#GameOptimization#HyperV#IntrusionDetection#iSCSI#ITInfrastructure#ITPro#KVM#LinuxServer#ManagedHosting#NASStorage#Networking#NVMe#PCGaming#PCIssues#PowerShell#Proxmox#RAID#RedHat#SANStorage#Server#ServerRoom#ServerSecurity#SIEM#SSDServers#SysAdmin#SysAdminLife#TaskScheduler#TechSupport#UbuntuServer#VMware#VPSHosting#vSAN#vSphere#WindowsAutomation#WindowsDebugging#WindowsFix#WindowsGaming#WindowsServerEnterprise & HostingSecurity & MonitoringStorage & Performance

Post navigation

Previous post
Next post

Related Posts

Active Directory replication troubleshooting

April 3, 2025

🔍 Step 1: Identify the Replication Issue ⚠️ Step 2: Common Causes and Fixes 1️⃣ Network Connectivity Issues 2️⃣ DNS Misconfiguration 3️⃣ Time Sync Issues 4️⃣ USN Rollback / Tombstoned DC 5️⃣ Global Catalog (GC) & FSMO Role Issues 🔄 Step 3: Force Replication & Reset Services 🛠 Step 4:…

Read More

Download Professional Windows Desktop and Server Hardening PDF

April 9, 2025April 9, 2025

​”Professional Windows Desktop and Server Hardening” is a comprehensive guide that offers practical advice on enhancing the security of Microsoft Windows desktops and servers. The book emphasizes configuring default security settings before deploying additional security products, providing readers with a solid foundation in understanding significant security threats and implementing effective…

Read More

Outlook keeps popping up asking for a password and not accepting it

April 9, 2025April 9, 2025

🔧 Basic Troubleshooting 🧹 Clear Cached Credentials Windows Mac 🔁 Remove & Re-add the Account If clearing credentials doesn’t work: 🧪 Safe Mode Test Run Outlook in safe mode to rule out add-ins: bashCopyEditPress `Win + R` → type `outlook /safe` → Enter If it works fine here, disable add-ins…

Read More

Recent Posts

  • List of AD Schema Versions
  • OldNewExplorer Free Download For Windows 11, 10, 8 and 7 [Latest Version]
  • How to Get the Classic (old) Context Menu on Windows 11
  • BitLocker Recovery Keys
  • Active Directory and Server hardening

Recent Comments

No comments to show.
June 2025
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« May    
Log in
©2025 Tech Master | WordPress Theme by SuperbThemes
  • Login
  • Sign Up
Forgot Password?
Lost your password? Please enter your username or email address. You will receive a link to create a new password via email.
body::-webkit-scrollbar { width: 7px; } body::-webkit-scrollbar-track { border-radius: 10px; background: #f0f0f0; } body::-webkit-scrollbar-thumb { border-radius: 50px; background: #dfdbdb }