Vlans on tl-wr841n

I have trouble configuring the switch (AR8229) of a tl-wr841n v11. eth0.4 somehow doesn't show up. Here is how I tried to configure the switch:

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 0t'           
                                        
config switch_vlan                          
        option device 'switch0'             
        option vlan '4'                     
        option ports '3t 4t 0t'    

Then I configure batman advanced with a different mac on eth0.4 like so:

config device 'eth0_4_batadv_dev'
       option type 'macvlan'     
       option name 'eth0.4_bat'  
       option ifname 'eth0.4'  
       option macaddr 'ba:3e:0a:ae:86:82'
                                          
config interface 'eth0_4_batadv_if'      
       option auto '1'             
       option device 'eth0.4_bat'  
       option proto 'batadv_hardif'
       option master 'bat0' 

swconfig dev switch0 show gives me

Port 0:
        mib: MIB counters
RxGoodByte  : 1448921209 (1.3 GiB)
TxByte      : 8596770122 (8.0 GiB)

        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
Port 1:
        mib: MIB counters
RxGoodByte  : 4021713474 (3.7 GiB)
TxByte      : 29978034960 (27.9 GiB)

        pvid: 1
        link: port:1 link:up speed:100baseT full-duplex auto
Port 2:
        mib: No MIB data
        pvid: 1
        link: port:2 link:down
Port 3:
        mib: No MIB data
        pvid: 0
        link: port:3 link:down
Port 4:
        mib: MIB counters
RxGoodByte  : 35405460665 (32.9 GiB)
TxByte      : 4708934573 (4.3 GiB)

        pvid: 0
        link: port:4 link:up speed:100baseT full-duplex auto
VLAN 1:
        vid: 1
        ports: 0t 1 2 
VLAN 4:
        vid: 4
        ports: 0t 3t 4t 

It looks like it is working, however, when I run ip l, eth0.4 is not present. A similiar config works fine on other devices. It does work however if vlan 4 is untagged, like so:

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

Then, eth0.4 is created and has connectivity. Why isn't eth0.4 created when I configure the switch to tag vlan 4 on ports 3 and 4? OpenWrt version is 19.07.3.

I figured it out. It has nothing to do with the switch. I wrote

option device 'eth0.4_bat' 

It has to be

option ifname 'eth0.4_bat' 

for OpenWrt-version <= 19. Oups.

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