Asus RT-AC58U switch configuration in LuCi (/etc/board.json) vs swconfig command line

Maybe I'm wrong, but when I change something in the Asus RT-AC58U switch page nothing works well and always ends in a factory reset.

I've run the swconfig dev switch0 show command and output is not the same that I see in LuCi

VLAN 1:
	vid: 1
	ports: 0 1 2 3 4 
VLAN 2:
	vid: 2
	ports: 0t 5 

Switch

If I look at git target ipq40xx etc there is no specific board.json
(I think I am looking at the wrong place)

Filesystem has this:

{
	"model": {
		"id": "asus,rt-ac58u",
		"name": "ASUS RT-AC58U"
	},
	"led": {
		"wlan2g": {
			"name": "WLAN2G",
			"sysfs": "rt-ac58u:blue:wlan2G",
			"trigger": "phy0tpt"
		},
		"wlan5g": {
			"name": "WLAN5G",
			"sysfs": "rt-ac58u:blue:wlan5G",
			"trigger": "phy1tpt"
		},
		"usb": {
			"name": "USB",
			"sysfs": "rt-ac58u:blue:usb",
			"type": "usbport",
			"ports": [
				"usb1-port1",
				"usb2-port1",
				"usb3-port1",
				"usb4-port1"
			]
		},
		"wan": {
			"name": "WAN",
			"sysfs": "rt-ac58u:blue:wan",
			"type": "netdev",
			"device": "eth1",
			"mode": "link tx rx"
		},
		"lan": {
			"name": "LAN",
			"sysfs": "rt-ac58u:blue:lan",
			"trigger": "switch0",
			"type": "switch",
			"port_mask": "0x1e",
			"speed_mask": ""
		}
	},
	"network": {
		"lan": {
			"ifname": "eth0",
			"protocol": "static",
			"macaddr": "18:31:bf:5a:96:80"
		},
		"wan": {
			"ifname": "eth1",
			"protocol": "dhcp",
			"macaddr": "18:31:bf:5a:96:84"
		}
	},
	"switch": {
		"switch0": {
			"enable": true,
			"reset": true,
			"ports": [
				{
					"num": 0,
					"device": "eth0",
					"need_tag": false,
					"want_untag": true
				},
				{
					"num": 1,
					"role": "lan"
				},
				{
					"num": 2,
					"role": "lan"
				},
				{
					"num": 3,
					"role": "lan"
				},
				{
					"num": 4,
					"role": "lan"
				}
			],
			"roles": [
				{
					"role": "lan",
					"ports": "1 2 3 4 0",
					"device": "eth0"
				}
			]
		}
	}
}

Should I edit this file in order to add WAN interface as hardware config shows?

Best howto I found is this mail list entry

Any insight?

First thing I can confirm is that port index are reversed. Port 1 is index 4, 2 is 3, 3 is 2 and port 4 is index 1.

1 Like

And finally I managed to configure a separated subnet on physical port #4 with this board.json

{
	"model": {
		"id": "asus,rt-ac58u",
		"name": "ASUS RT-AC58U"
	},
	"led": {
		"wlan2g": {
			"name": "WLAN2G",
			"sysfs": "rt-ac58u:blue:wlan2G",
			"trigger": "phy0tpt"
		},
		"wlan5g": {
			"name": "WLAN5G",
			"sysfs": "rt-ac58u:blue:wlan5G",
			"trigger": "phy1tpt"
		},
		"usb": {
			"name": "USB",
			"sysfs": "rt-ac58u:blue:usb",
			"type": "usbport",
			"ports": [
				"usb1-port1",
				"usb2-port1",
				"usb3-port1",
				"usb4-port1"
			]
		},
		"wan": {
			"name": "WAN",
			"sysfs": "rt-ac58u:blue:wan",
			"type": "netdev",
			"device": "eth1",
			"mode": "link tx rx"
		},
		"lan": {
			"name": "LAN",
			"sysfs": "rt-ac58u:blue:lan",
			"trigger": "switch0",
			"type": "switch",
			"port_mask": "0x1e",
			"speed_mask": ""
		}
	},
	"network": {
		"lan": {
			"ifname": "eth0",
			"protocol": "static",
			"macaddr": "18:31:bf:5a:96:80"
		},
		"wan": {
			"ifname": "eth1",
			"protocol": "dhcp",
			"macaddr": "18:31:bf:5a:96:84"
		}
	},
	"switch": {
		"switch0": {
			"enable": true,
			"reset": true,
			"ports": [
				{
					"num": 0,
					"device": "eth0",
					"need_tag": false,
					"want_untag": true
				},
				{
					"num": 1,
					"role": "lan",
					"index": 4
				},
				{
					"num": 2,
					"role": "lan",
					"index": 3
				},
				{
					"num": 3,
					"role": "lan",
					"index": 2
				},
				{
					"num": 4,
					"role": "lan",
					"index": 1
				},
				{
					"num": 5,
					"role": "wan",
				}
			],
			"roles": [
				{
					"role": "lan",
					"ports": "1 2 3 4 0",
					"device": "eth0.2"
				},
				{
					"role": "wan",
					"ports": "0t 5",
					"device": "eth0.1"
				}
			]
		}
	}
}

and this LuCi > Network > Switch settings:
port4
(post edited, wrong pic from another hw)

HTH!

This is common.

It's nice too see you look into switch issue in rtac58u. I have problem when setting up vlan via LuCI. Is it resolved in your side ?

It worked for me!
It is explained in my 3rd post

  • What do you do with that json file?
  • Where it is saved?

I saved the current file in /etc/board.json and I copied mine over it

1 Like

You are right. I never noticed the small port numbers on the back. Do you think you can make a patch for it?
All that would be required is to reverse the "x:lan" numbers in this line:

Heh, I carried this patch:


that makes it possible to reassign the VLANs and Ports the way most people are used to with OpenWrt.
Problem is: it never got accepted. John removed it from the initial ipq40xx-target patch (when the target was split from the ipq806x) without any comments as to why. So no point in posting it again.

Let me try this weekend :wink:

chances are you'll be dealing with the mac80211 ath10k-ct fallout. My advise would be to stick with the solution you have for the moment and wait until it's blown over.

Sorry, but now I think that switch it is still NOT working only editing the board.json. Maybe only last vlan works. I need to do more tests.

Definitely not.

I unchecked a bridged interface using LuCi (network > Intefaces > Physical settings) without setting before only one interface in the "interfaces combo box" and in fact I had a brigde although I didn't notice (maybe is a LuCi bug, I'm not sure).

Last weekend I saw two ifname configured in my /etc/config/network file and I realized the mistake: where there should be only one (the vlan that seemed to work) where two, so in fact there was no vlan traffic, but eth0 traffic. My apologizes for the confusion.

I cannot find a configuration to get the switch work.

Anybody knows if the AC58U switch does really works in openwrt?

Hi There! I´ve tried your board.json and my ports lost connectivity. Would it be possible to share too your etc/config/network file content ?

Thanks a lot!

I have no vlan working configuration. That didn't work and those config files where lost. Sorry