Fundamentals 3 min read

Router Configuration: Subinterface, VLAN, and Static Route Setup

This guide walks through creating VLANs 2, 20, and 30, configuring VLANIF interfaces with IP addresses, setting up PC access ports, establishing a trunk link to the router, and adding a default static route to complete the router configuration.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Router Configuration: Subinterface, VLAN, and Static Route Setup

Step 1: Batch create VLANs 2, 20, and 30 on the switch.

system-view
vlan batch 2 20 30

Step 2: Configure VLANIF interfaces with their respective IP addresses.

interface Vlanif 2
ip address 10.2.1.2 24
quit
interface Vlanif 20
ip address 20.2.1.1 24
quit
interface Vlanif 30
ip address 30.3.1.1 24
quit

Step 3: Configure the PC access ports (GE0/0/1 and GE0/0/2) and assign them to the appropriate VLANs.

interface GigabitEthernet 0/0/1
port link-type access
port default vlan 20
quit
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 30
quit

Step 4: Configure the trunk port (GE0/0/3) that connects to the router and allow VLAN 2.

interface GigabitEthernet 0/0/3
port link-type trunk
port trunk allow-pass vlan 2
quit

Step 5: Add a default static route on the switch.

ip route-static 0.0.0.0 0.0.0.0 10.2.1.1
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

RouterVLANstatic routesubinterface
Practical DevOps Architecture
Written by

Practical DevOps Architecture

Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.