[Solved] Issues regarding link negotiation between Mikrotik hAP ac2 and switch

Hey! I have a Mikrotik hAP ac2 running OpenWrt 23.05.0-rc3, which is connected to a cheap tp-link unmanaged gigabit switch (Tp-Link TL-SG1005D), via one of its LAN ports. I recently noticed it sometimes negotiates a link of 100Mbps with it despite both devices supporting 1Gbps. Initially I tried restarting the switch and it got fixed, but after some time it reverted back to 100Mbps, and now restarting doesn't help anymore. The cable I'm using to connect them is cat 5e, and apparently the rest of devices connected to the switch are running on 1Gbps.

This is the output of ethtool, so it seems the switch announces up to 100Mbps:

root@OpenWrt:~# ethtool lan4
Settings for lan4:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: external
        Auto-negotiation: on
        MDI-X: off (auto)
        Supports Wake-on: d
        Wake-on: d
        Link detected: yes

And this is my network config:

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 'fddd::/48'

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

config device
        option name 'lan1'
        option macaddr '---------'

config device
        option name 'lan2'
        option macaddr '---------'

config device
        option name 'lan3'
        option macaddr '--------'

config device
        option name 'lan4'
        option macaddr '---------'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ip6assign '64'
        list ipaddr '192.168.1.1/24'
        option delegate '0'
        option ip6hint '0'

config device
        option name 'wan'
        option macaddr '-------'

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'
        option peerdns '0'
        list dns '127.0.0.1'
        option delegate '0'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'
        option reqaddress 'try'
        option reqprefix 'auto'
        option peerdns '0'
        list dns '::1'

config interface 'iot'
        option proto 'static'
        list ipaddr '192.168.2.1/24'
        option delegate '0'

Logs when I restart my switch:

Sun Sep 10 00:31:25 2023 daemon.notice netifd: Network device 'lan4' link is up
Sun Sep 10 00:31:34 2023 daemon.notice netifd: Network device 'lan4' link is down
Sun Sep 10 00:31:34 2023 kern.info kernel: [666613.049595] qca8k-ipq4019 c000000.switch lan4: Link is Down
Sun Sep 10 00:31:34 2023 kern.info kernel: [666613.049948] br-lan: port 4(lan4) entered disabled state
Sun Sep 10 00:31:58 2023 kern.info kernel: [666636.969852] qca8k-ipq4019 c000000.switch lan4: Link is Up - 100Mbps/Full - flow control rx/tx
Sun Sep 10 00:31:58 2023 kern.info kernel: [666636.970062] br-lan: port 4(lan4) entered blocking state
Sun Sep 10 00:31:58 2023 kern.info kernel: [666636.977467] br-lan: port 4(lan4) entered forwarding state
Sun Sep 10 00:31:58 2023 daemon.notice netifd: Network device 'lan4' link is up

Does anyone have any idea why this could fail? I tried disabling autonegotiation and setting the speed to 1Gbps with full duplex but it doesn't work, the link doesn't go up. I'm also planning to buy an ethernet cable tester to see if that helps me with the troubleshooting (the cable connecting router-switch was built by me, but it always worked at ~960Mbps, so i suspect that shouldn't be the issue). Thanks in advance!

Try other cables... preferably some new and short ones. It is possible/likely that there is an issue with the cable itself (an internal break, bad termination, etc. -- something that may be marginal but working some of the time).

Also, inspect the ports on both ends to make sure that the don't have any bent pins and/or debris.

Hmm maybe that could explain it, the cable is around 15 meters long, because the router and switch are not in the same room. I will see what I can do with it and report back. Thanks!

Ethernet is rated to 100m, of course, so 15m isn't in itself a problem. But the chances of a short cable having a problem are just a bit less likely than a long one (less length to get damaged), thus the reason I mentioned testing with a short cable.... we want to rule out any issues with the active devices on each end.

Sounds good, I don't have physical access to the router rn but i'll test tomorrow morning and report back :slight_smile:

Hm, yeah it seems that when connecting router and switch with a short cable it negotiates 1Gbps, I even tried multiple times and always the same result. Using the original cable still gives me 100Mbps after the test. Sooo, I'll probably try to replace the ethernet cable and see if that helps, or just use 100Mbps for now idk. Thank you!

Glad I was able to help.

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks! :slight_smile:

1 Like

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