Linksys wrt3200acm, third ethernet, DSA port mirroring?

@anomeome
Do you know if the third ethernet interface can be used? I was able to enable eth1, through .dts and set a MAC, but I'm not getting any communication. In LuCI Network, Switch, it shows as not connected.

With DSA one can port-mirror

How?

I'm happy to see people are working towards performance. I personally find the old switch style to better suit my needs.

Contrary to the 385 DTS labelling scheme I believe there are only the 2, see post but iirc there is another thread with mirror change due to FW4, if playing with performance tweaking MQPrio thread may be of interest.

2 Likes

How about like that?

2 Likes

@Brillie

Thanks for the info. I’m just regular user. I can only apply patches. Making changes to dts files is something I never have done.
Is it possible thad you can make a patch for the wrt32x?

Luckily for you, WRT3200 and WRT32x share armada-385-linksys.dtsi which is already patched, so it should work.

git clone https://github.com/httpstorm/openwrt.git
cd openwrt
git checkout gvalkov

Important: interfaces are renamed to lan and wan. Add them to /etc/config/network before upgrade. Should anything go wrong, you can access the router over Wi-Fi or power cycle 3 times with 10 seconds delay to boot the old firmware.

I do not understand why anybody would want to go back to that proprietary swconfig stuff. DSA really allows everything and more and it's fully upstream. Of course, one may need to learn a few new concepts but once you master that it is really much more powerful.

2 Likes

@sumo
Bad timing: when DSA was pushed, some features were either missing or required complex command line. For me the lack of GUI for some of the features under Network, Switch configuration page in LuCI e.g. port mirroring was what made me revert. Past that point, while I am periodically checking about it, I am less motivated because I already have an environment that gives me everything I need. It might help if someone can outline the benefits.

I can understand why advanced use cases can benefit from DSA, yet personally I don't see any advantage when the basic LAN+WAN setup is used… Apart from the naming: I really like lan1-4 + wan, so I renamed the interfaces to lan + wan in my patch.
Performance wise until multi-port DSA becomes the default we cripple the performance. Once fully supported we might benefit if it is possible to aggregate the bandwidth of multiple ports. Is it?

Question:
What happens when lan1 and lan2 are bridged? Will this configuration use the CPU when two machines try to communicate with each other? Or is the switch going to handle this in hardware? What will happen if we bridge lan1 and lan2.2 instead?

Please note that ultimately, this depends on what your particular switch supports in hardware.

No, most any switch chip can do this in hardware.

Yes.

That is more complicated. Depending on how hardware bridging is implemented this may or may not be easily achievable in hardware. E.g. a rather poor switch that must rely on regular VLAN tags for bridging might not be able to do this. A more advanced switch that relies on truly VLAN independent tagging may be able to do this. Please find more information in the following article:

https://01.org/linuxgraphics/gfx-docs/drm/networking/dsa/configuration.html

1 Like

thnks for the reply. First test i added the patch to my build. I did an sysupgrade en also tried factory image. Both times i did nog get a ip adress from the router.
Do you have example of a working /etc/config/network (lan wan interfaces)?
Next test is to build a image from you repo. See if that works.

@Brillie

You should still have access to the router over Wi-Fi. The sysupgrade image is used to upgrade OpenWRT, while factory should be installed when running the Linksys firmware, in which case the old configuration is lost the OpenWRT should generate a working /etc/config/network file, unless you integrated your own at build time.

# /etc/config/network
config device
	option name 'br-lan'
	option type 'bridge'
	option stp '1'
	list ports 'lan'

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

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option metric '0'
	option force_link '1'
	option netmask '255.255.255.0'
	option broadcast '192.168.1.255'
	option dns '8.8.8.8 8.8.4.4 1.1.1.1'
	option ipaddr '192.168.1.1'

config interface 'wan'
	option device 'wan'
	option metric '4'
	option proto 'dhcp'

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

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

config switch_vlan
	option description 'LAN'
	option device 'switch0'
	option vlan '1'
	option ports '0 1 2 3 5'

config switch_vlan
	option description 'WAN'
	option device 'switch0'
	option vlan '2'
	option ports '4 6'

What do you see when you run ifconfig?

@Brillie
We need ifconfig with the patch applied and the configuration I sent you.

Me current setup is that i have a separate AP connected to the wrt32x.
When i do the sysupgrade with the patch, i have no acces to the main router. Also no wifi.
I could setup a basic wifi interface on the wrt32x and then do a sysupgrade to see if the wifi will come up.

1 Like

Yes, you want both 2.4 and 5 Ghz radios bridged to LAN, and nothing else. In the worst case, Ethernet interfaces get missing, misconfigured or routed to the wrong switch ports. For example, your LAN network might be accessible over the WAN port, while ports LAN1-4 could become the WAN network. The reason I recommend using Wi-Fi, is because it should not be affected, though I recommend connecting directly. As an alternative, using a static IP for WAN might help if you also forward ports 80 and 22 to the router, and then use a static IP on a computer. Use Wireshark to see if the router is generating any traffic on LAN/WAN ports. This will help identify what network is connected to each port, if any. The final goal is to get access over SSH, then ifconfig and swconfig dev switch0 show will help us create a working configuration. Have you tried unchecking the option to preserve configuration, while upgrading the firmware? This should allow the router to create a proper network config.

This is what i did. I added list ports 'lan' to network config just to be sure.
Wifi came up en could acces the router. Look like the switch package did not build.
This is stil a build from master with your patch. Not a build from your repo.

ifconfig

br-lan    Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:C8
          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:1314 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1117 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:169515 (165.5 KiB)  TX bytes:823247 (803.9 KiB)

lan       Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:C8
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:161 errors:0 dropped:0 overruns:0 frame:0
          TX packets:111 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1024
          RX bytes:15878 (15.5 KiB)  TX bytes:15945 (15.5 KiB)
          Interrupt:46

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:129 errors:0 dropped:0 overruns:0 frame:0
          TX packets:129 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10572 (10.3 KiB)  TX bytes:10572 (10.3 KiB)

wan       Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:C8
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:276 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1024
          RX bytes:52795 (51.5 KiB)  TX bytes:19498 (19.0 KiB)
          Interrupt:45

wlan1     Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:C9
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1298 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1531 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:188661 (184.2 KiB)  TX bytes:885446 (864.6 KiB)

swconfig dev switch0 show

root@lt11:~# swconfig dev switch0 show
-ash: swconfig: not found

i also have tried that .. no ip adress was given.

@Brillie
Good, I see interfaces lan and wan are present. The remaining part of the puzzle is to enable swconfig, so OpenWRT can configure the switch. One possible reason for swconfig not being selected is if you used your existing .config, since it is enabled by default, but is set to optional.

Run make menuconfig, and make sure the following are selected:

  • Base system, swconfig - this alone should be sufficient, if not, add the following:
  • Kernel modules, Network devices, kmod-swconfig
  • Kernel modules, Network devices, kmod-switch-mvsw61xx

You should also see some Kernel logs

[    2.093083] mvsw61xx 10.mvsw61xx: Found MV88E6352 at f1072004.mdio-mii:10
[    2.099909] mvsw61xx 10.mvsw61xx: Using direct addressing
1 Like

Thnks for the reply. I will look at it tomorrow. Will keep you posted.

It worked. I did a sysupgrade and unchecking the option to preserve configuration.
It booted up with lan and wan. Big thnks for your help.

I'm glad we made it! Cheers! :clinking_glasses: