How can I install and configure swconfig for my router?

Hello,
i have a wireless router with three LAN interfaces. I would like to configure these in luci as swconfig. How do I do this? I've attached some configurations:

root@rome03:~# ubus call system board
{
	"kernel": "6.6.73",
	"hostname": "rome03.intern.harnet.de",
	"system": "MediaTek MT7621 ver:1 eco:3",
	"model": "TP-Link EAP615-Wall v1",
	"board_name": "tplink,eap615-wall-v1",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "24.10.0",
		"revision": "r28427-6df0e3d02a",
		"target": "ramips/mt7621",
		"description": "OpenWrt 24.10.0 r28427-6df0e3d02a",
		"builddate": "1738624177"
	}
}
root@rome03:~# ifconfig
br-admin  Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          inet addr:192.168.200.3  Bcast:192.168.200.255  Mask:255.255.255.0
          inet6 addr: fe80::262f:d0ff:fedf:25ac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9891 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7700 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1317931 (1.2 MiB)  TX bytes:9687784 (9.2 MiB)

br-hassio Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          inet6 addr: fe80::262f:d0ff:fedf:25ac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1104 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:247776 (241.9 KiB)  TX bytes:966 (966.0 B)

br-lan    Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          inet6 addr: fe80::262f:d0ff:fedf:25ac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1999 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:343189 (335.1 KiB)  TX bytes:746 (746.0 B)

br-wlan   Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          inet6 addr: fe80::262f:d0ff:fedf:25ac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11523 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5327267 (5.0 MiB)  TX bytes:746 (746.0 B)

eth0      Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          inet6 addr: fe80::262f:d0ff:fedf:25ac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1504  Metric:1
          RX packets:1894 errors:0 dropped:0 overruns:0 frame:0
          TX packets:756 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:157886 (154.1 KiB)  TX bytes:109978 (107.4 KiB)
          Interrupt:19 

lan0      Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::262f:d0ff:fedf:25ac/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:127371 errors:0 dropped:46 overruns:0 frame:0
          TX packets:30608 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:153088371 (145.9 MiB)  TX bytes:13900013 (13.2 MiB)
          Interrupt:19 

lan0.130  Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1104 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:247776 (241.9 KiB)  TX bytes:856 (856.0 B)

lan0.150  Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          inet addr:192.168.150.3  Bcast:192.168.150.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:534 errors:0 dropped:0 overruns:0 frame:0
          TX packets:117 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:75918 (74.1 KiB)  TX bytes:21526 (21.0 KiB)

lan0.200  Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8449 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9594 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1220617 (1.1 MiB)  TX bytes:9838094 (9.3 MiB)

lan0.30   Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:53701 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15717 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:146917415 (140.1 MiB)  TX bytes:2304567 (2.1 MiB)

lan0.50   Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1999 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:343189 (335.1 KiB)  TX bytes:746 (746.0 B)

lan1      Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1894 errors:0 dropped:0 overruns:0 frame:0
          TX packets:749 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:150310 (146.7 KiB)  TX bytes:103012 (100.5 KiB)

lan2      Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan3      Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4322 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4322 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:311709 (304.4 KiB)  TX bytes:311709 (304.4 KiB)

phy0-ap0  Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AC  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11589 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:5699959 (5.4 MiB)

phy0-ap1  Link encap:Ethernet  HWaddr 26:2F:D0:DF:25:AC  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1134 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:285168 (278.4 KiB)

phy1-ap0  Link encap:Ethernet  HWaddr 24:2F:D0:DF:25:AD  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15715 errors:0 dropped:0 overruns:0 frame:0
          TX packets:112567 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2304790 (2.1 MiB)  TX bytes:150461394 (143.4 MiB)

phy1-ap1  Link encap:Ethernet  HWaddr 26:2F:D0:DF:25:AD  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1138 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:285656 (278.9 KiB)
root@rome03:~# 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 ula_prefix 'fd53:f1cc:1987::/48'
	option packet_steering '1'

config interface 'admin'
	option proto 'dhcp'
	option device 'br-admin'

config interface 'transfer'
	option device 'lan0'
	option proto 'dhcp'

config interface 'elk'
	option proto 'static'
	option device 'lan0.150'
	option ipaddr '192.168.150.3'
	option netmask '255.255.255.0'

config device
	option name 'lan0.150'
	option type '8021q'
	option ifname 'lan0'
	option vid '150'
	option ipv6 '0'

config device
	option name 'lan0.200'
	option type '8021q'
	option ifname 'lan0'
	option vid '200'
	option ipv6 '0'

config device
	option type 'bridge'
	option name 'br-lan'
	list ports 'lan0.50'
	list ports 'lan2'
	list ports 'lan3'

config device
	option type 'bridge'
	option name 'br-wlan'
	list ports 'lan0.30'

config device
	option type '8021q'
	option ifname 'lan0'
	option vid '30'
	option name 'lan0.30'

config device
	option type '8021q'
	option ifname 'lan0'
	option vid '50'
	option name 'lan0.50'

config device
	option type '8021q'
	option ifname 'lan0'
	option vid '130'
	option name 'lan0.130'

config device
	option type 'bridge'
	option name 'br-hassio'
	list ports 'lan0.130'

config interface 'wlan'
	option proto 'none'
	option device 'br-wlan'

config interface 'hassio'
	option proto 'none'
	option device 'br-hassio'

config interface 'lan'
	option proto 'none'
	option device 'br-lan'

config device
	option type 'bridge'
	option name 'br-transfer'
	list ports 'lan0'
	list ports 'lan1'

config device
	option type 'bridge'
	option name 'br-admin'
	list ports 'eth0'
	list ports 'lan0.200'
	list ports 'lan1'

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

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

I don't see any switches in the luci web frontend. There, I could always set the ports to tag or untag.

Do you have any tips for me?

Regards, Stefan Harbich

your router is already in "DSA" format so the reference guide is this:

https://openwrt.org/docs/guide-user/network/dsa/dsa-mini-tutorial

https://openwrt.org/docs/guide-user/network/dsa/converting-to-dsa#dsa

ps: skip this part because you can't find it on your router:

https://openwrt.org/docs/guide-user/network/dsa/converting-to-dsa#swconfig_dsa_vlan_configuration_comparison

ps: how to configure your router depends on the purpose you want to implement on it

2 Likes

After installing swconfig, I get the following message:
"The switch0 has an unknown structure, the VLAN settings may be inappropriate"
when I call switch in the luci interface. How do I get rid of this error message?

you don't need swconfig so remove it...

opkg remove swconfig

if the error persists even after removing the package my advice is to do a reset (if you have not configured the router specifically)

https://openwrt.org/docs/guide-user/troubleshooting/failsafe_and_factory_reset

ps: usually if someone doesn't know what the effects of the actions are they ask before installing a package (I don't blame you but it's just to make you aware of the actions you took)

1 Like

Official OpenWrt images come with the necessary software to manage the device switch. It's a basic function for a router. So there is nothing to install for this matter, just configure at your will.
There are two sets of software : DSA is the newer, swconfig is the older. Targets are migrating from swconfig to DSA at each new release. mt7621 has been migrated a few versions ago.

2 Likes

But I want to use the swconfig package. Why do I get this error message? Do I need to make any changes to the "/etc/config/network" configuration file when installing swconfig?

If I don't install the swconfig software, I don't see the "switch" menu item under Network in the luci web interface. Why?

unfortunately you will not be able to use swconfig as your router relies directly on "DSA" so you will have to do everything through the new interface:

https://www.kernel.org/doc/html/latest/networking/dsa/dsa.html

https://forum.openwrt.org/uploads/default/original/3X/0/e/0ee81127069c7978a8b9fa70a3b0ae5c7c3fd467.png

https://forum.openwrt.org/uploads/default/original/3X/3/a/3af4a6fcd0b2990eca8441eedfc7232649ade2e9.png

2 Likes

I don't know if a DSA migrated device can be reconfigured to use swconfig without impacting deep parts of the software. Many changes have occured when migrating (firewall for example).
DSA can achieve anything, just find the right infos and configuration for your purpose. @ncompact gave you the URLs for all the necessary infos.

2 Likes

I assume you are looking for the VLAN settings? They are elsewhere: go to network -> interfaces -> Devices tab -> br-lan, click on configure

1 Like

It is not possible to run swconfig on a DSA kernel.

The "Bridge VLAN Filtering" page is the new equivalent to swconfig. Place all the physical ports into one bridge then build out your VLANs on the filtering page. You can select which ports are in which VLAN and whether tagged or untagged just like swconfig did.

Then attach each VLAN to a network Interface with the notation br-lan.X This is the only place the dotted vlan notation is used in DSA. VLANs that exist only to hardware switch between ports still need an Interface of proto Unmanaged.

Note that you will also need to migrate the lan and wan Ethernet networks to be numbered VLANs (traditionally numbers 1 and 2), include them in the filtering table and reassign their network's Devices to be br-lan.1 and 2. It is best to be connected to the router by wifi while doing this so you don't lose access.

4 Likes

Thank you very much for your support. I've now configured everything via br-lan and DSA. Everything works. Thank you.

2 Likes

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