Swich ports offline if plugged during boot

I’m experiencing the same.

My guess is that issue is somewhere around link/MDI-X negotiation (turris can’t detect other side auto-neg?.. possibly cable? I’ve tested 3 but all straight… don’t have any cross at hand right now)

after reboot with: [root@turris:~]# reboot

on turris:

root@turris:~# ethtool eth0
Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   1000baseT/Half 1000baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes:  1000baseT/Half 1000baseT/Full 
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes <===================================
    Link partner advertised link modes:  1000baseT/Full 
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: No <=======================
    Speed: 1000Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: external
    Auto-negotiation: on <==============================================
    Link detected: yes <================================================

on laptop (tg3 driver):

root@pve:~# ethtool eth0
    Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes <=================================
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on <==================================================
        MDI-X: Unknown
        Supports Wake-on: g
        Wake-on: d
        Current message level: 0x00000020 (32)
                       ifup
        Link detected: no <=====================================================

when it works (after “ethtool -s eth0 autoneg on” or ifconfig eth0 down && ifconfig eth0 up on laptop):

on turris:

root@turris:~# ethtool eth0
Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   1000baseT/Half 1000baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes:  1000baseT/Half 1000baseT/Full 
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Link partner advertised link modes:  1000baseT/Full 
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: No <===============================
    Speed: 1000Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: external
    Auto-negotiation: on
    Link detected: yes

on laptop:

root@pve:~# ethtool eth0
Settings for eth0:
    Supported ports: [ TP ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Half 1000baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Half 1000baseT/Full 
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                         100baseT/Half 100baseT/Full 
                                         1000baseT/Full 
    Link partner advertised pause frame use: Symmetric
    Link partner advertised auto-negotiation: Yes
    Speed: 1000Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 1
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: off
    Supports Wake-on: g
    Wake-on: d
    Current message level: 0x00000020 (32)
                   ifup
    Link detected: yes <==============================

It doesn’t help when I run ethtool -r eth0 on laptop but it helps when I do “ethtool -s eth0 autoneg on” even if it is already on.

For now, as a workaround, I’m gonna put cron entry to run “ethtool -s eth0 autoneg on” every minute on my laptop.