mii-tool ou ethtool: Qual usar?
Dica publicada em Linux / Comandos
mii-tool ou ethtool: Qual usar?
Senhores, vi um artigo publicado pelo Daniel Zaia Manzano, que aliás estava muito bem escrito, sobre mii-tool, só que por essa ferramenta não ser tão atual, vou colocar algumas diferenças aqui entre eles.
Vendo se a interface eth0 está online, notamos abaixo que o ethtool é uma ferramenta muito mais completa no que precisamos:
# mii-tool eth0
Já o ethtool, somente colando a interface, já vai lhe apresentar um relatório completo:
# mii-tool eth2
# ethtool -s eth2 speed 100 duplex full
Assim colocamos a interface eth2 rodando a 100 fullduplex.
O modelo abaixo serve de referência para a configuração (o que acho raramente necessário) da interface de rede:
# ethtool -s [interface] speed [velocidade] duplex [half | full]
Vendo se a interface eth0 está online, notamos abaixo que o ethtool é uma ferramenta muito mais completa no que precisamos:
# mii-tool eth0
eth0: negotiated 1000baseT-FD flow-control, link ok# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: d
Link detected: yes
Agora, quando vemos uma interface acima de 1000M temos dificuldades com o mii-tool, por ser uma ferramenta antiga. Ele percebe que o link está OK, mas apresenta alguns erros; aliás, se você não tiver configurado o IP na interface, ele nem vai mostrar como "link OK".
Já o ethtool, somente colando a interface, já vai lhe apresentar um relatório completo:
# mii-tool eth2
SIOCGMIIREG on eth2 failed: Input/output error SIOCGMIIREG on eth2 failed: Input/output error eth2: negotiated 1000baseT-FD flow-control, link ok# ethtool eth2
Settings for eth2:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
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: pumbag
Wake-on: d
Current message level: 0x00000001 (1)
Link detected: yes
Para alterar a velocidade da interface e/ou formas de negociação, como o exemplo abaixo:
# ethtool -s eth2 speed 100 duplex full
Assim colocamos a interface eth2 rodando a 100 fullduplex.
O modelo abaixo serve de referência para a configuração (o que acho raramente necessário) da interface de rede:
# ethtool -s [interface] speed [velocidade] duplex [half | full]
Nossas dicas se complementam. :)
Abraços