How to restart one ethernet port?

Hi All,

As I am having issue related to this topic:

https://forum.openwrt.org/t/ethernet-port-issue-after-updating-do-21-02-0/105298/5

I am looking for a software work around to this problem.

What I am trying to achieve is to restart one particular ethernet port on the router's built-in switch.

Command /etc/init.d/network restart restarts the port but that command also restarts all other ports and even both Wi-Fi radios.

My question is how to actually restart only one ethernet port in OpenWRT?

I am on Linksys WRT3200ACM and 22.03.0 OpenWRT.

ifdown/ifup?

Wouldn't that take down the LAN though which is trying to be avoided? I can't check right now but maybe ifconfig ethX down/up might do it.

Since the port is connected to a switch chip, it is unlikely that you can bounce that port individually. I may be wrong here, but in general, that level of control is not exposed through the switch chip to the OS and then to the userland.

Thanks guys but none of the above brings stuck port to live.

Any other suggestions i may try?

What?

Are you saying that you have some other issue that you want to restart one port to fix?

If so, have you check the cable?

No, i have only issue reported in this thread:

The issue is happening on different ports. Actually on all 4 of them. The one I am experecing the 'stuck' port the most is the one with Raspberry Pi device which i restart the most. This way the port of that deivce gets stuck the most. But of course i had replaced the for tests at the very begginig when i notices the problem. That did not resolve the problem.

OK...interesting...this must be a DSA device or something since they could address a "lan1". Also, ip is a raw Linux command. I see your issue.

I'm not sure that's a supported OpenWrt feature.

That's one supported command. Ill have to search; I recall other threads of users wanting to restart a single port. Did you try this command instead:

/etc/init.d/network reload

(instead of restart?)

I will definitely try this one next time the port will stuck. Thanks a lot for your input.

1 Like

Unfortunately

/etc/init.d/network reload

does not do much in my case. I have tried to invoked that command couple of times in a row. Port is still dead after this command.

I have just noticed that even

/etc/init.d/network restart

does not work every single time. Sometimes i have to invoke this command 2-3 times and then port is back to live.

If there is no way to restart single port, perhaps there is a way to restart just the built in switch without having to restart Wi-Fi interfaces also?