Swap eth0 and eth1 ports with new DSA syntax - WAN IP issue on TP-Link Archer A6 v3

Hi all

On my TP-Link Archer A6 v3 I had the issue of not getting a WAN IP address as described here (partially solved):

In order to fully solve the issue, I am trying to port from swconfig to DSA configuration (Archer A6 v3 is runing OpenWrt 21.02) the swapping of eth0 and eth1 as described in:

https://dev.archive.openwrt.org/ticket/18680

I've read the "New network configuration syntax" at:

And, I've read the "DSA Mini-Tutorial" and the "Converting to DSA", respectively at:

I, however, can't realize how to swap eth0 and eth1 (CPU ports 0 and 1) as shown here for a similar router:
https://openwrt.org/_detail/media/tplink/tl-wr1043/tl-wr1043nd-v2_schematics.png?id=toh%3Atp-link%3Atl-wr1043nd

My network config is as follows:

root@Archer_A6:~# 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 packet_steering '1'
        option ula_prefix 'fdb5:4035:3c75::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

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

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'
        option hostname '*'

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

Any help would be highly appreciated, so that I can get rid of the switch between my modem and my router, which is not very reliable (unattended switch which usually hangs).

Thanks

Bump. Any suggestions?

I believe that current DSA always runs all traffic through a single link from the switch chip to the CPU, even if the hardware has two. There is no user configuration of this internal link, you would have to modify the source code.

I would try reassigning the WAN to a different physical port (one of the LAN ports) in case there is a hardware problem with that port.

Thanks, Mike, for your reply and time. I will try that out.

However, the router is brand new, so I doubt there might be any problem with the port. I believe it is more of a configuration or hardcoding issue in OpenWRT, especially considering this has happened in similar routers with former versions of OpenWRT too.

hi,

see here https://forum.openwrt.org/t/mapping-ethernet-ports-to-lan-vs-wan/33536/10

That's so OLD, DSA wasn't even thought of

The similarity with the TL1043ND is limited to the manufacturer - no DSA on that device (I know, I have 3 of them)

I imagine it would be as easy as removing

list ports 'lan4'

from br-lan; and change

option device 'wan'

to

option device 'lan4'

In both wan and wan6 interfaces

and? are you sure those scripts/functions mentioned in the post are not used since? because strangely I can find those in release 21.02 as well.

with DSA you can configure each port to participate in any logical network construct indeed, but still the physical ports get their default names somehow. as I see there are various naming conventions used per platform/board it looks to me that convention is hw/platform specific (e.g. lanX or ethX names i've seen). thus if the question is that which physical port should be called "wan" then i think the post may still stand. but of course i can be wrong, if you know how it is exactly working please tell.

if question is only which port to be used for a construct in DSA it is easy: use list ports or option device directive with port you wish. but it will not change the name of the device, the one physical port called lan1 will be the same port regardless if you add to bridgeA or bridgeB.

and of course you can rename your ports with ip command too.

You're right, I shouldn't jump to conclusions like that, my apologies