To configure VLAN 3 on OpenWRT to communicate with a MokerLink 2G08110GSM (an 8-port managed switch with 1 SFP+ 10G uplink), you’ll need to do the following:

Overview:

  • Our Goal: Set up VLAN 3 on OpenWRT and have the switch recognize it, allowing tagged or untagged traffic between them.
  • Devices:
    • OpenWRT router (with VLAN support)
    • MokerLink 2G08110GSM managed switch
  • Example Port Use:
    • OpenWRT to Switch connection on port 1
    • VLAN 3 used on port 3–5 of the switch (example)

Step 1: Configure VLAN 3 on OpenWRT

Option A: OpenWRT LuCI (Web Interface)

  1. Log in to OpenWRT LuCI
  2. Navigate to Network > Interfaces
  3. Click “Add new interface”
    • Name: VLAN3
    • Protocol: Static (or DHCP depending on your setup)
    • Cover the device: Select eth0.3 (replace eth0 with your actual WAN/LAN device)
  4. Assign:
    • IP address: 10.10.3.1/24 (for example)
  5. Save but don’t apply yet.

Create VLAN in Network > Devices

  1. Go to Network > Devices
  2. Click Add device configuration
  3. Name: eth0.3
  4. Type: VLAN (802.1q)
    • Base device: eth0 (or your LAN device)
    • VLAN ID: 3
  5. Save and apply.

Add Interface to Firewall

  1. Go to Network > Firewall
  2. Add a new zone or include VLAN3 in the LAN zone, depending on access rules.

Option B: OpenWRT CLI (/etc/config/network)

Edit /etc/config/network like so:

bash
CopyEdit
config device
option name 'eth0.3'
option type '8021q'
option ifname 'eth0'
option vid '3'

config interface 'vlan3'
option proto 'static'
option device 'eth0.3'
option ipaddr '10.10.3.1'
option netmask '255.255.255.0'

Then run:

bash
CopyEdit
/etc/init.d/network restart

Step 2: Configure VLAN 3 on MokerLink 2G08110GSM

The MokerLink web interface typically supports 802.1Q VLANs.

Procedure:

  1. Login to the switch’s web GUI (usually 192.168.2.1 or similar)
  2. Go to the VLAN or 802.1Q VLAN configuration section.
  3. Add VLAN 3
    • VLAN ID: 3
    • VLAN Name: VLAN3
  4. Assign ports:
    • Port 1 (to OpenWRT): Tagged
    • Ports 3–5 (end devices): Untagged or tagged depending on your devices
  5. Set PVID:
    • Ports 3–5: Set PVID to 3 (if they are untagged access ports)
    • Port 1: Leave as-is or ensure it handles tagged traffic

Example VLAN Table:

PortVLAN 1VLAN 3PVIDTagged/Untagged
11Tagged
33Untagged
43Untagged
53Untagged

Let’s Test our config:

  • Connect a device to Switch Port 3–5
  • It should get IP from OpenWRT on the 10.10.3.x network
  • Check connectivity: ping OpenWRT (10.10.3.1)

Thank you for coming by, I hope you enjoyed the article. Let me know if you need any assistance. You can email or chat with me on discord in the PiHobby Org discord channel.

By Michael Cooper

30 years in IT last 15 as a Senior Systems Engineer. GO BUCKS!

Leave a Reply

Your email address will not be published. Required fields are marked *