OpenWrt Forum Archive

Topic: TP-Link WR841N V7 802.1q VLAN support

The content of this topic has been archived on 30 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Is there any experts on this forum who get added support for 802.1q VLAN for Tp-Link WR841N?
Can someone provide this firmware?
Мay be for the current version of the firmware patch is needed?
I need tagged VLAN on the uplink interface for my multicast.

My network config:

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

config 'interface' 'lan'
    option 'ifname' 'eth1'
    option 'type' 'bridge'
    option 'proto' 'static'
    option 'netmask' '255.255.255.0'
    option 'ipaddr' '192.168.111.1'

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

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

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

config 'interface' 'public'
    option '_orig_ifname' 'wlan0'
    option '_orig_bridge' 'false'
    option 'proto' 'static'
    option 'ipaddr' '172.22.22.1'
    option 'netmask' '255.255.255.0'

(Last edited by a.gromovs on 19 Feb 2013, 13:54)

As I realised you need to configure additional VLAN on the same port wich used by WAN-interface, right? I have no deal with WR841N at all, but if it has built-in AR7240 switch it may be easier to configure WAN interface on one of switches ports.

IIRC ar7240 has fully isolated eth1 (uplink or WAN interface) from internal switch eth0 (LAN interface). So you can try

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

config 'interface' 'lan'
    option 'ifname' 'eth0'
    option 'type' 'bridge'
    option 'proto' 'static'
    option 'netmask' '255.255.255.0'
    option 'ipaddr' '192.168.111.1'

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

config 'interface' 'mcast'
    option 'ifname' 'eth1.100'
    option 'proto' 'static'
    option 'netmask' '255.255.255.0'
    option 'ipaddr' '10.10.1.1'

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

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

Don't foget to change vlan tag 100 to your value and possibly fake ipaddres 10.10.1.1 (or remove it if not needed). You need change firewall config for mcast interface too.

123serge123 wrote:

IIRC ar7240 has fully isolated eth1 (uplink or WAN interface) from internal switch eth0 (LAN interface).
Don't foget to change vlan tag 100 to your value and possibly fake ipaddres 10.10.1.1 (or remove it if not needed). You need change firewall config for mcast interface too.

123serge123, there is no luck. sad

At the moment I use the following configuration.
Unfortunately for eth0.10 and can`t get settings with DHCP.

This means that VLAN 10 is not working. sad

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

config interface 'lan'
        option ifname 'eth0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'

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

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

config switch_vlan
        option device 'eth0'
        option vlan '1'
        option vid '1'
        option ports '0t 1 2 3'

config interface 'iptv'
        option proto 'dhcp'
        option ifname 'eth0.10'

config switch_vlan
        option device 'eth0'
        option vlan '2'
        option ports '0t 4'
        option vid '10' 
root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr B0:48:7A:CE:89:9B
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20073 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16363 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3030113 (2.8 MiB)  TX bytes:7519749 (7.1 MiB)

eth0      Link encap:Ethernet  HWaddr B0:48:7A:CE:89:9B
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20173 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16611 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3327115 (3.1 MiB)  TX bytes:7617197 (7.2 MiB)
          Interrupt:5

eth0.10   Link encap:Ethernet  HWaddr B0:48:7A:CE:89:9B
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:234 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:94068 (91.8 KiB)

eth1      Link encap:Ethernet  HWaddr B0:48:7A:CE:89:9D
          inet addr:192.168.10.178  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:176839 errors:0 dropped:1187 overruns:8 frame:0
          TX packets:15086 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:15289255 (14.5 MiB)  TX bytes:2584209 (2.4 MiB)
          Interrupt:4

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:116 errors:0 dropped:0 overruns:0 frame:0
          TX packets:116 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10490 (10.2 KiB)  TX bytes:10490 (10.2 KiB)

Do you get internet and iptv (with vlan vid=10) through the same WAN port (eth1 device)? Then why do you configure eth0.10? It's internal LAN interface. And in your LAN there isn't dhcp-server in valn10 so no dhcp-response.
If you use 2 cables and iptv-cable is connected to port 4 then just change "ports '0t 4t'" in your config.

(Last edited by 123serge123 on 21 Feb 2013, 14:00)

123serge123 wrote:

Do you get internet and iptv (with vlan vid=10) through the same WAN port (eth1 device)? Then why do you configure eth0.10? It's internal LAN interface. And in your LAN there isn't dhcp-server in valn10 so no dhcp-response.

At the moment I use a clean firmware of OpenWrt from trunk.
And just trying to add VLAN 10 on port 4, or to get IP over DHCP on 'iptv' interface.
For VLAN test I have a Mikrotik routerboard with VLAN#10 with DHCP server in it.
VLAN working without problems on my Ubuntu PC.

(Last edited by a.gromovs on 21 Feb 2013, 14:07)

So 2 cables test config? Then set switch to keep vlan tag for outgoing through port 4 packets: change '0t 4' to '0t 4t'

123serge123 wrote:

So 2 cables test config? Then set switch to keep vlan tag for outgoing through port 4 packets: change '0t 4' to '0t 4t'

With these settings, I get the internet on the 4-port.

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

config interface 'lan'
        option ifname 'eth0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'

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

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 1 2 3'

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

I don't understand. It's good or bad smile. BTW in your config there is no eth0.4 interface

123serge123 wrote:

I don't understand. It's good or bad smile. BTW in your config there is no eth0.4 interface

Internet is working with 4 port tagged and only.
I was experimented and  interface eth 0.10 was temporarily removed.
VLAN #10 still not working.  No DHCP sad
I've created a small ticket https://dev.openwrt.org/ticket/13037
May be problem is in kernel?

May be the problem in switch. Not all switch supports tagged and untagged packets on the same port. You can use eth1 interface to test this case. As i wrote before eth1 is fully separated from switch and may support these mixed packets

123serge123 wrote:

May be the problem in switch. Not all switch supports tagged and untagged packets on the same port. You can use eth1 interface to test this case. As i wrote before eth1 is fully separated from switch and may support these mixed packets

I also think that VLAN should work on WAN port but how?
I tried to add this config and no effect:

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

config interface 'lan'
        option ifname 'eth0'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'

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

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

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

config interface 'mcast'
        option proto 'dhcp'
        option ifname 'eth1.10'
 ifconfig
br-lan    Link encap:Ethernet  HWaddr B0:48:7A:CE:89:9B
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4501 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3235 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:802257 (783.4 KiB)  TX bytes:1441510 (1.3 MiB)

eth0      Link encap:Ethernet  HWaddr B0:48:7A:CE:89:9B
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4612 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3239 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:876113 (855.5 KiB)  TX bytes:1441694 (1.3 MiB)
          Interrupt:5

eth1      Link encap:Ethernet  HWaddr B0:48:7A:CE:89:9D
          inet addr:192.168.10.178  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:76969 errors:0 dropped:391 overruns:0 frame:0
          TX packets:4119 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5840834 (5.5 MiB)  TX bytes:821067 (801.8 KiB)
          Interrupt:4

eth1.10   Link encap:Ethernet  HWaddr B0:48:7A:CE:89:9D
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:55 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:22110 (21.5 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:20 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3853 (3.7 KiB)  TX bytes:3853 (3.7 KiB)

Use tcpdump to see what happens in eth1? MAC filtering?
In any case you can remove eth1 from config and try to reproduce working config from PC Ubuntu by hand.

(Last edited by 123serge123 on 21 Feb 2013, 16:52)

The discussion might have continued from here.