How to configure VLAN on WAN(eth1) port

Hi everyone, I've been having trouble setting up VLAN configuration on WAN(eth1) port on a Access Point running OpenWrt 22.03.0, r19685-512e76967f. My goal is to setup VLAN 24 for my AP on WAN port.

please anyone share the VLAN configuration for WAN interface.

thanks in advance

In wan interface settings, replace eth1 with eth1.24.

2 Likes

Hi, i tried this below VLAN configuration but I was not able to make it working, yet!!
Interface eth1.24 is created but ip on this interface is not found

/etc/config/network:

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

config switch_vlan
option device 'switch0'
option vlan '1'
option vid '24'
option ports '1t'

config interface 'wan24'
option device 'eth1.24'
option proto 'dhcp'

/etc/config/dhcp:

config dhcp 'wan24'
option interface 'wan24'
option ignore '1'

No any ip is found on vlan interface eth1.24, so please guys help me with this problem.. below is output of ifconfig command -

eth1.24 Link encap:Ethernet HWaddr 00:11:22:33:44:55
inet6 addr: fe80::5731:71bf:fe00:41b0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:19767 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:6758666 (6.4 MiB)

This is most certainly not going to work as there appears to be no connection to the CPU.

Let's see the default network config file.... from there, we can make this work.

1 Like

Hi psherman ...Below is my default configuration for network file

root@OpenWrt:/# cat /etc/config/network 

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

config globals 'globals'
        option ula_prefix 'fd45:9588:f572::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option device 'eth1'
        option proto 'dhcp'

config interface 'wan6'
        option device 'eth1'
        option proto 'dhcpv6'

Its working fine and connection is successful with this default configuration..

please help me to create VLAN on WAN interface !!

thanks in advance

What is the make / model and chipset? This looks like one of the Atheros 10/100 chips (AR92xx, AR93xx etc) which have eth1 a dedicated CPU port to the external wan port. On those the wan connection does not involve the switch.

1 Like

Assuming that you have shared the complete default configuration of your device, it should be really simple. To setup VLAN 24 on the wan (this requires that the upstream connection is already using tagged VLAN 24), just use simple dotted notation like this:

config interface 'wan'
        option device 'eth1.24'
        option proto 'dhcp'

Then restart and your wan will listen on VLAN 24 (tagged) for the connection.

3 Likes

@sujeetkumar Reading your first post again, I noticed that you mention "AP". If this device is actually a dumb AP, then I'm wondeirng if the question isn't actually about setting up the WAN port so that it untags VLAN 24 and is bridged with the WiFi network. If I'm correct, then:

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'
        list ports 'eth1.24'

Next steps:

  • Remove interfaces wan and wan6.
  • Disable DHCP on lan interface.
  • Don't add any switch configs.
1 Like

Hii @mk24 ,

Chipset: ipq40xx
Model : AP-DK01.1-C1
OpenWRT Release: OpenWrt 22.03.0 r19685-512e76967

Upgrade to 23.05.3 first, which gives you a functional DSA environment, instead of the rather quirky (and outright broken) swconfig drivers present in older releases.

3 Likes

Yes, VLANs really did not work on ipq4019 before version 23.

1 Like

Hii, @slh @mk24 @frollic

ipq40xx: remove DK01 and DK04 boards

we could not build firmware to version v23.05.0 or above OpenWrt 23.05.3 image building error

we know, you were given that link by us ...

1 Like

Hi

Below is my default /etc/config/network configuration and when we connect SSID with lan interface in /etc/config/wireless, it works fine and wifi connectivity is also successful.

/etc/config/network

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

config globals 'globals'
        option ula_prefix 'fd56:d0b2:9d02::/48'

config device 'device1'
        option name 'br-lan'
        list ports 'eth0'
        option type 'bridge'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option device 'eth1'
        option proto 'dhcp'

config interface 'wan6'
        option device 'eth1'
        option proto 'dhcpv6'

And when we try to add some lines in the bottom of above /etc/config/network to create VLAN as mentioned below..

We are only able to connect my phone with SSID whose network is connected to the 'vlan2' interface.. But not connecting SSID whose network is connected to the 'lan' interface

config bridge-vlan 'bridge_vlan_1'
        option device 'br-lan'
        list ports 'eth0:t'
        option vlan '2'

config interface 'vlan2'
        option device 'br-lan.2'
        option ifname 'vlan2'
        option ipaddr '10.20.30.40'
        option netmask '255.255.255.0'
        option proto 'static'

/etc/config/wireless

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

config wifi-iface 'default_radio2'
        option device 'radio1'
        option network 'vlan2'
        option mode 'ap'
        option ssid 'test-vlan'
        option encryption 'none'

And i want both SSID should be work with lan and vlan2 interfaces, so What should we change in our configuration?

please help..

thanks in advance