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.
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
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.