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-viewvlan batch 2 20 30Step 2: Configure VLANIF interfaces with their respective IP addresses.
interface Vlanif 2ip address 10.2.1.2 24quitinterface Vlanif 20ip address 20.2.1.1 24quitinterface Vlanif 30ip address 30.3.1.1 24quitStep 3: Configure the PC access ports (GE0/0/1 and GE0/0/2) and assign them to the appropriate VLANs.
interface GigabitEthernet 0/0/1port link-type accessport default vlan 20quitinterface GigabitEthernet 0/0/2port link-type accessport default vlan 30quitStep 4: Configure the trunk port (GE0/0/3) that connects to the router and allow VLAN 2.
interface GigabitEthernet 0/0/3port link-type trunkport trunk allow-pass vlan 2quitStep 5: Add a default static route on the switch.
ip route-static 0.0.0.0 0.0.0.0 10.2.1.1Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
