Unable to add new VLAN

I feel like I'm going insane. When I add a new VLAN in the Switch page no VLAN interface (eth0.x) gets created.

I'm using a WD n750 and by default there are two already 2 vlans With IDs 1 and 2. My understanding is that when when you add a new VLAN in the switch page of luci and apply that a new eth0.x interface is created. And you shoud be able to go to an interface then click on the physical settings tab and tick eth0.x (where X is the VLAN tag ID of the new VLAN) in the interface field. But that doesn’t happen for me! I’ve factory reset the router to make sure it’s not some weird config I have but still no luck! I'm running 18.06.4 so pretty recent. Any suggestions for things I can try? Thanks :blush:

/etc/config/network (factory reset state)

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fda7:6099:2701::/48'

config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'

config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'

config device 'wan_dev'
option name 'eth0.2'
option macaddr '00:90:a9:ad:68:8a'

config interface 'wan6'
option ifname 'eth0.2'
option proto 'dhcpv6'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '1 2 3 4 0t'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '5 0t'

/etc/config/network (factory reset state + VLAN added in switch page)

config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'
option ula_prefix 'fda7:6099:2701::/48'

config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'

config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'

config device 'wan_dev'
option name 'eth0.2'
option macaddr '00:90:a9:ad:68:8a'

config interface 'wan6'
option ifname 'eth0.2'
option proto 'dhcpv6'

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 '0t 2 3 4'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t 5'
option vid '2'

config switch_vlan
option device 'switch0'
option vlan '3'
option vid '3'
option ports '1'

ls -l /sys/class/net (factory reset state + VLAN added in switch page)

root@OpenWrt:~# ls -l /sys/class/net
lrwxrwxrwx 1 root root 0 Jun 27 12:25 br-lan -> ../../devices/virtual/net/br-lan
lrwxrwxrwx 1 root root 0 Jan 1 1970 eth0 -> ../../devices/platform/ag71xx.0/net/eth0
lrwxrwxrwx 1 root root 0 Jun 27 12:25 eth0.1 -> ../../devices/virtual/net/eth0.1
lrwxrwxrwx 1 root root 0 Jun 27 12:25 eth0.2 -> ../../devices/virtual/net/eth0.2
lrwxrwxrwx 1 root root 0 Jan 1 1970 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx 1 root root 0 Jun 27 12:20 wlan0 -> ../../devices/platform/ar934x_wmac/net/wlan0
lrwxrwxrwx 1 root root 0 Jun 27 12:20 wlan1 -> ../../devices/pci0000:00/0000:00:00.0/net/wlan1

First you need to add the new vlan to the CPU port as tagged,
option ports '0t 1'
Then you need to manually create the interface, either in Luci add new interface and use the manual input box at the bottom eth0.3 or add it directly in the /etc/config/network file:

config interface 'lan2'
option ifname 'eth0.3'
option proto 'static'
option ipaddr '192.168.2.1'
option netmask '255.255.255.0'
option ip6assign '60'
1 Like

Thank you so much! :heart:
Not also tagging the CPU was exactly what was stopping OpenWRT from creating a VLAN interface automatically :tada:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.