Modify

Opened 8 years ago

Closed 7 years ago

Last modified 4 years ago

#7696 closed defect (fixed)

r21708 broke tagged VLAN support on rtl8366rb at least (TP-Link TL-WR1043ND)

Reported by: anonymous Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

Since r21708 of trunk tagged VLAN support is broken on my TP-Link TL-WR1043ND with rtl8366rb switch. Trunk r21707 and prior work.

Symptoms

A computer configured for tagged VLAN ID 4 connected to port 4 of the router will not be able to communicate with the router (i.e. it gets no IP assigned by DHCP).
Untagged port 3 works fine in any revision.

  • r21707 (working)
    root@OpenWrt:/# swconfig dev rtl8366rb vlan 4 show
    VLAN 4:
            info: VLAN 4: Ports: 45
                     vid     prio    member          untag   fid
            MC:     4        0       0x0030          0x0000          0
            4K:     4                0x0030          0x0000          0
            ports: 4t 5t
    
  • r21708 (not working)
    root@OpenWrt:/# swconfig dev rtl8366rb vlan 4 show
    VLAN 4:
            info: VLAN 4: Ports:
                     vid     prio    member          untag   fid
            MC:     0        0       0x0030          0x0000          0
            4K:     0                0x0030          0x0000          0
            ports: 4t 5t
    

Configuration used

  • /etc/config/network
    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.1'
            option 'type' 'bridge'
            option 'proto' 'static'
            option 'ipaddr' '10.0.0.222'
            option 'netmask' '255.255.255.0'
            option 'gateway' '10.0.0.254'
            option 'dns' '10.0.0.254'
    
    config 'interface' 'vlan3'
            option 'ifname' 'eth0.3'
            option 'proto' 'static'
            option 'ipaddr' '10.0.3.254'
            option 'netmask' '255.255.255.0'
    
    config 'interface' 'vlan4'
            option 'ifname' 'eth0.4'
            option 'proto' 'static'
            option 'ipaddr' '10.0.4.254'
            option 'netmask' '255.255.255.0'
    
    config 'interface' 'wan'
            option 'ifname' 'eth0.2'
            option 'proto' 'dhcp'
    
    config 'switch'
            option 'name' 'rtl8366rb'
            option 'reset' '1'
            option 'enable_vlan' '1'
    
    config 'switch_vlan'
            option 'device' 'rtl8366rb'
            option 'vlan' '1'
            option 'ports' '1 2 5t'
    
    config 'switch_vlan'
            option 'device' 'rtl8366rb'
            option 'vlan' '2'
            option 'ports' '0 5t'
    
    config 'switch_vlan'
            option 'device' 'rtl8366rb'
            option 'vlan' '3'
            option 'ports' '3 5t'
    
    config 'switch_vlan'
            option 'device' 'rtl8366rb'
            option 'vlan' '4'
            option 'ports' '4t 5t'
    
  • /etc/config/dhcp
    config dnsmasq
            option domainneeded     1
            option boguspriv        1
            option filterwin2k      '0'  #enable for dial on demand
            option localise_queries 1
            option local    '/lan/'
            option domain   'lan'
            option expandhosts      1
            option nonegcache       0
            option authoritative    1
            option readethers       1
            option leasefile        '/tmp/dhcp.leases'
            option resolvfile       '/tmp/resolv.conf.auto'
            #list server            '/mycompany.local/1.2.3.4'
            #option nonwildcard     1
            #list interface         br-lan
            #list notinterface      lo
    
    config dhcp lan
            option ignore 1
            option interface        lan
            option start    100
            option limit    150
            option leasetime        12h
    
    config dhcp wan
            option interface        wan
            option ignore   1
    
    config dhcp vlan3
            option interface        vlan3
            option start    100
            option limit    150
            option leasetime        12h
    
    config dhcp vlan4
            option interface        vlan4
            option start    100
            option limit    150
            option leasetime        12h
    

Attachments (0)

Change History (7)

comment:1 follow-up: Changed 8 years ago by Memphis

in your config for vlan4 in /etc/config/network ... shouldn't it has to be "4 5t" instead of "4t 5t"?

and i thought one had to couple the vlan config with the network config by naming the interface as well ...

so config 'switch_vlan' could read config 'switch_vlan' 'eth0_4'

comment:2 in reply to: ↑ 1 Changed 7 years ago by anonymous

Replying to Memphis:

in your config for vlan4 in /etc/config/network ... shouldn't it has to be "4 5t" instead of "4t 5t"?

and i thought one had to couple the vlan config with the network config by naming the interface as well ...

so config 'switch_vlan' could read config 'switch_vlan' 'eth0_4'

OP here...

I want VLAN 4 to be a tagged VLAN on port 4 thus the "4t" otherwise it is untagged like VLAN 3 on port 3.
The posted config works as is on r21707 and on r22486 (patched to undo the change from 21708).

Regarding naming the interface:
on http://wiki.openwrt.org/doc/uci/network it is indeed named, but the default file that comes with kamikaze does not name it (compare vlan 1 for lan and vlan 2 for wan)
thus I just did copy&paste of those entries and changed ports and names.
Besides, when using the posted config I can get the interfaces "vlan3" and "vlan4" to work with dhcp and firewall just fine.

I want to add that when I reverse the patch from r21708 everything works as expected
even with the newest trunk (r22486 in my case).

But maybe I am missing something.

comment:3 follow-up: Changed 7 years ago by Memphis <memphis@…>

Yeah next time i read the wiki before posting dumbness ;o). I find it a bit strange ... i've running kernel and modules from todays trunk (r22562 i think) and my output is looking different to yours

#swconfig dev rtl8366rb vlan 1 show
VLAN 1:
	info: VLAN 1: Ports: '012345t', members=003f, untag=001f, fid=0
	ports: 0 1 2 3 4 5t

but my vid is set propably

#swconfig dev rtl8366rb port 1 get pvid
1

I also did a setup with 2 vlans today (for testing another bug) and there the pvids for the ports where set correctly (to 1 and 2 - i don't have the logs from that ...). But i did only tagging on cpu port 5. It's strange. Unfortunatly i don't see through the flags field which is involved in the offending revision. Don't think i can help you here. We have to wait for juhosg returning :o(.

comment:4 in reply to: ↑ 3 Changed 7 years ago by anonymous

Yes, the PVID is set correctly on ports that are marked as untagged.
It's only missing on ports marked as tagged.

I too am waiting for juhosg's return, as I'm eager to know which technical documentation he used for programming the driver.

I was looking around the net for a datasheet, but the only one I found at
http://realtek.info/pdf/rtl8366_8369_datasheet_1-1.pdf
is not the correct one according to andrewt12 (https://forum.openwrt.org/viewtopic.php?pid=99338#p99338) who wrote the initial driver for the switch.

The mentioned datasheet includes interesting capabilities such as port mirroring and I hope that the switch in the wr1043nd also supports this. If so, it should be easy to implement.

comment:5 Changed 7 years ago by eymert@…

What I am still missing, is support for MTU's higher than 1500. As I also have a NAS with relatively low CPU capacity connected to the network (not to mention the CPU of the WR1043ND itself), a rather noticeable speed benefit can be accomplished by this.

But of course, this is not really related to the topic of this ticket ;).

Here, no problems with tagging, as far as I can see. I have the following config:

  • A fiber termination unit connected with one UTP cable to the WAN port
  • The fiber connection carries 3 VLAN's (Of which I use 2).
  • One VLAN is for IPTV (vlan 4)
  • One VLAN is for Internet (vlan6) and allows the WR1043ND to connect with my ISP through PPPoE
  • I have another VLAN set up for my local LAN (VLAN 10).
  • I send VLAN 10 (LAN) and VLAN 4 (IPTV) to the living room over port 4, tagged :) (trunking)
  • In the living room, a Cisco SLM2008 splits the trunk off to the IPTV box of my fiber provider and the LAN devices there.

comment:6 Changed 7 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

fixed in r22856, r22857

comment:7 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.