

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)
- Log in to OpenWRT LuCI
- Navigate to Network > Interfaces
- Click “Add new interface”
- Name:
VLAN3
- Protocol: Static (or DHCP depending on your setup)
- Cover the device: Select
eth0.3
(replaceeth0
with your actual WAN/LAN device)
- Name:
- Assign:
- IP address:
10.10.3.1/24
(for example)
- IP address:
- Save but don’t apply yet.
Create VLAN in Network > Devices
- Go to Network > Devices
- Click Add device configuration
- Name:
eth0.3
- Type: VLAN (802.1q)
- Base device:
eth0
(or your LAN device) - VLAN ID: 3
- Base device:
- Save and apply.
Add Interface to Firewall
- Go to Network > Firewall
- Add a new zone or include
VLAN3
in theLAN
zone, depending on access rules.
Option B: OpenWRT CLI (/etc/config/network
)
Edit /etc/config/network
like so:
bash
CopyEditconfig 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:
- Login to the switch’s web GUI (usually
192.168.2.1
or similar) - Go to the VLAN or 802.1Q VLAN configuration section.
- Add VLAN 3
- VLAN ID:
3
- VLAN Name:
VLAN3
- VLAN ID:
- Assign ports:
- Port 1 (to OpenWRT): Tagged
- Ports 3–5 (end devices): Untagged or tagged depending on your devices
- 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:
Port | VLAN 1 | VLAN 3 | PVID | Tagged/Untagged |
---|---|---|---|---|
1 | ✓ | ✓ | 1 | Tagged |
3 | ✓ | 3 | Untagged | |
4 | ✓ | 3 | Untagged | |
5 | ✓ | 3 | Untagged |
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.