Cannot configure VLAN on version 22.03.2 x64

I could configure a connection not using VLAN.

However, when I follow the instructions from the documentation to configure a VLAN it does not get an IP from DHCP, nor it works with static IP.

The VLAN is configured correctly on the downstream device, and I have tested it with a different Linux machine connected.

Can someone share a basic configuration to get a VLAN on eth0?

Assign/configure/enumerate each Interface as eth0.x

x == vlan_number

(This is standard Linux config.)

1 Like

@ulmwind the documentation you had mentioned is exactly the one I am following, but I am facing the issues I described.

@lleachii can you elaborate your answer with a working example of /etc/config/network? The examples from the documentation are not working for me, and I am sure the VLAN ID is correct.

Sure - e.g. x86_64 with VLAN 1 (LAN) and VLAN 3 (setup a 2nd LAN):

config interface 'lan'
	option proto 'static'
	option ipaddr '192.168.y.1'
	option netmask '255.255.255.0'
	option ip6assign '64'
	option device 'eth0.1'

config interface 'network2'
	option proto 'static'
	option ipaddr '192.168.x.1'
	option netmask '255.255.255.0'
	option ip6assign '64'
	option device 'eth0.3'
2 Likes

@lleachii I see you did not declare the devices nor the vid. Are they missing?
It seems in one of my tests I could get it to work, but it was using IPv6 on the VLAN device I had declared. Once I added option ipv6 '0' it was not working. Is IPv6 mandatory for to get the VLAN work internally? I have dhcpv6 disabled on the downstream device, so this IP is not coming from there.

Nope, that's all I have in my network config to have eth0 tag frames.

No it isn't - OK, then:

config interface 'lan'
	option proto 'static'
	option ipaddr '192.168.y.1'
	option netmask '255.255.255.0'
	option delegate '0'
	option device 'eth0.1'

config interface 'network2'
	option proto 'static'
	option ipaddr '192.168.x.1'
	option netmask '255.255.255.0'
	option delegate '0'
	option device 'eth0.3'

What are you referring to?

I've never used that setting; in any case, I have no clue how it relates to your VLAN inquiry.

1 Like

@lleachii Thank you! I will test again probably on the weekend.

Give default /etc/config/network

1 Like