Hi all,
I (new to openwrt, but a network professional) tried to use a GL-B1300 for home networking. I wanted to span more than one network internal (e.g. dmz, interal,...) and wanted to use a trunk (on port 3) up to my switch and split the networks there. After long tries I found out that neither editing /etc/config/network nor luci worked.
My network file (port 3 of a GL-B1300 is the one on the opposite side of the power supply):
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option vid '1'
option ports '0 4'
config switch_vlan
option device 'switch0'
option vid '3'
option vlan '200'
option vid '200'
option ports '0t 3t'
list comment 'vlan 200: DMZ'
config interface 'dmz'
option ifname 'eth0.200'
option proto 'static'
option ipaddr '10.0.3.1'
option netmask '255.255.255.0'
If you do a service network restart: no effect.
If you do the configuration by swconfig everything works as desired:
swconfig dev switch0 vlan 3 set vid 200
swconfig dev switch0 vlan 3 set ports '0t 3t'
swconfig dev switch0 vlan 4 set vid 500
swconfig dev switch0 vlan 4 set ports '0t 3t'
swconfig dev switch0 set apply
After the configuration this is the result of a swconfig dev switch0 show
:
VLAN 1:
vid: 1
ports: 0 4
VLAN 2:
vid: 2
ports: 0t 5
VLAN 3:
vid: 200
ports: 0t 3t
VLAN 4:
vid: 500
ports: 0t 3t
I placed the commands in a shell-script (setVLANs.sh)
The problem is, if you do a 'service network restart
' afterwards (I suppose that is what luci does, when you hit 'apply') the VLAN configuration is lost.
From now on I do a service network restart && ./setVLANs.sh
and I have the VLANs on my switch working over the trunk port.
Is this a bug or a feature or am I doing something fundamentally wrong?
Regards Alex